This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
public:techstuff:libvirt [2012/09/22 03:44] – nathan | public:techstuff:libvirt [2020/04/25 13:05] (current) – external edit 127.0.0.1 | ||
---|---|---|---|
Line 3: | Line 3: | ||
===== Creating a VM ===== | ===== Creating a VM ===== | ||
- | virt-install \ | + | ==== Creating an KVM VM ==== |
- | --name=<VM name> \ | + | |
- | --ram=<memory in MB> \ | + | |
- | --location=http:// | + | |
- | --os-type=linux \ | + | |
- | --os-variant=debiansqueeze \ | + | |
- | --disk=/ | + | |
- | --network=bridge=int,model=virtio \ | + | |
- | --extra-args=console=ttyS0, | + | |
- | ===== Creating | + | virt-install |
+ | --name=<VM name> | ||
+ | --ram=< | ||
+ | --location=http:// | ||
+ | --os-type=linux | ||
+ | --os-variant=debiansqueeze | ||
+ | --disk=/ | ||
+ | |||
+ | ==== Creating an LXC VM ==== | ||
+ | |||
+ | * Capped resources at 512mb of ram and 2 cpus | ||
+ | |||
+ | cd /img | ||
+ | mkdir < | ||
+ | sudo debootstrap wheezy < | ||
+ | sudo virt-install --connect lxc:/// --name cubert --ram 512 --vcpu 2 --filesystem / | ||
virt-install \ | virt-install \ | ||
- | --name <VM name> | + | |
- | --ram < | + | --name httpd_guest |
- | --vcpus 1 \ | + | --ram 512 |
- | --disk path=/ | + | --vcpus 2 |
+ | ==== Existing KVM image ==== | ||
+ | |||
+ | virt-install | ||
+ | | ||
+ | --ram < | ||
+ | --disk path=/ | ||
--import --noautoconsole --force | --import --noautoconsole --force | ||
+ | |||
+ | ==== Other Useful Options ==== | ||
+ | |||
+ | * Create VM with a bridge attached to eth0 | ||
+ | < | ||
+ | |||
+ | * Run install over console | ||
+ | |||
+ | < | ||
+ | |||
+ | * Installing to an LVM Pool instead. Replace disk line with this one. You'll end up with a volume called < | ||
+ | |||
+ | < | ||
+ | |||
+ | * If you want a specific name you'll need to create the volume manually first. | ||
+ | |||
+ | < | ||
+ | |||
+ | And then use this line to specify it. | ||
+ | |||
+ | < | ||
===== Open Serial Console to VM ===== | ===== Open Serial Console to VM ===== |