Palegray.net - Code, Linux/BSD, Tech, and more
Home Projects Tutorials Forums About Contact

Debian 6 (Squeeze) KVM Virtualization Howto

Deploy Your First KVM Virtual Machine

Select "Virtual Machine Manager" from the "System Tools" menu to get started.

Virtual Machine Manager menu entry on Debian 6.

Select the "localhost" host entry, and choose "Host Details" from the "Edit" menu.

Host Details menu entry in the Virtual Machine Manager on Debian 6.

Uncheck the box labeled "Autoconnect" on the "Overview" tab. By default, the Virtual Machine Manager will attempt to connect to the local machine, but this is unnecessary since you won't be running any virtual machines within the KVM VM desktop machine.

Disabling autoconnect for localhost in the Virtual Machine Manager on Debian 6.

Back on the application screen, select "Add Connection" from the "File" menu.

Add Connection menu entry in the Virtual Machine Manager on Debian 6.

Select "QEMU/KVM" for the "Hypervisor" option, "Remote Tunnel over SSH" for the "Connection" option, and enter your KVM server's hostname in the "Hostname" field. Check the "Autoconnect" box, and click "Connect" to proceed.

KVM host connection details in the Virtual Machine Manager on Debian 6.

Right click on your KVM server entry in the hosts list, and select "New" to begin creating a new VM.

New VM menu entry in the Virtual Machine Manager on Debian 6.

Assign a name to your VM, select your KVM host from the "Connection" list, and make sure "Local install media" is selected. Click "Foward" to proceed.

New VM name in the Virtual Machine Manager on Debian 6.

Select the Debian 6 ISO image you previously downloaded to your KVM host for the "Use ISO image" field. Select "Linux" from the "OS type" list, and select "Debian Squeeze" from the "Version" list. Click "Forward" to proceed.

Installation media and operating system type settings in the Virtual Machine Manager on Debian 6.

Choose the amount of RAM and number of virtual CPUs you would like to assign to this VM, and click "Forward" to continue. It's best to assign fewer virtual CPUs than the number of physical CPU cores present on the host.

Memory and CPU settings in the Virtual Machine Manager on Debian 6.

Select the amount of disk storage space you would like to allocate to this VM's virtual hard disk. By default, a virtual disk image file will be created for the VM under the "/var/lib/libvirt/images" directory. If you wish, you may also choose a pre-configured LVM volume or spare physical disk partition on your host.

Virtual hard disk settings in the Virtual Machine Manager on Debian 6.

Expand the "Advanced options" section on the summary screen. Enter "br0" in the "Bridge name" field, and select your desired architecture from the "Architecture" list. If you intend on installing the 64-bit version of Debian 6 as your first guest VM, make sure "x86_64" is selected. Click "Finish" to initialize and boot your guest VM.

Advanced settings in the Virtual Machine Manager on Debian 6.

Once your guest VM has booted for the first time, you'll be connected to its virtual console. From here, you may proceed to install the guest operating system just as you would on any other computer. Congratulations, you've got your first KVM guest up and running!

A guest VM booted for the first time in the Virtual Machine Manager on Debian 6.

Read on for some helpful notes and tips.

Continue: Final Notes and Tips
Previous: Install and Configure virt-manager on the Workstation