I’ve been using KVM and virt-install to manage virtual machines on one of my servers, this post shows how to use virt-install.
According to the package management system I’m having the following packages installed:
|
|
Storage-wise I’m using a LVM volume group called ‘vg0’ (which was imported into the libvirt configuration).
How to use virt-install
To setup a new guest machine I’m using the following command:
|
|
That’s mostly it. The parameters configure the following
Parameter | Value | Why? |
---|---|---|
-n | virtual_machine_name | the name of the virtual machine, d’oh |
-r | 4096 | virtual memory size, this would be 4GB |
-l, -os* | .. | which operating system to install |
–disk | .. | create a new LVM volume with 40GB, use virtio drivers for higher performance |
-w | .. | network configuration, use the default bridge |
–graphics | none | we don’t need not graphical user interface |
–autostart | none | automatically start installation |
-x console | .. | also create a virtual console, this will allow us to finish installation |
The host-bridge setup (created by the debian installation) will assign a private IP address to the virtual machine through DHCP. I’m using the virtio drivers as those should yield better performance than the rest.