You’ve been seeing a lot of virtualization specific posts recently here at Ubuntu Tutorials. I’ve been tinkering with a number of virtualization options, namely VMware Server, Virtualbox and now KVM with Virt-Manager.
I’m not going to go into comparing the three in this post, but I will say that KVM is the only solution that will let me run 64bit guests on my 64bit host. It also cleanly manages networking, whereas VirtualBox still has issues there. KVM is still fairly new however so the UI features are not as nice as the other two.
Installing The Packages
Assuming your machine will support KVM (generally, core 2 duo and later) lets get the right packages installed.
sudo aptitude install kvm virt-manager libvirt-bin
This will install the Virt-Manager graphical interface for creating and managing your virtual installations. It’ll also install the kernel module to make use of the KVM instruction set and the libvirt library.
Once you’ve got the right packages installed you’ll need to give yourself access to the KVM device. This is done simply enough using:
sudo gpasswd -a username libvirtd
This will require you to logout and login again. When you get back we’ll get Virt-Manager launched and some virtual machines built. Go ahead, relogin. I’ll wait…
Virt-Manager is a nice kvm/qemu/xen management interface developed by the good folks at RedHat. This utility makes it really easy to create, manage and delete virtual installations. You can launch Virt-Manager via the command line, or the Applications menu.
If you have VirtualBox installed you may run into conflicts between the kernel modules. Make sure to remember to remove the conflicting module before you run either of the virtualization solutions. You can do this by using these commands.
To remove the VirtualBox module:
sudo modprobe -r vboxdrv
To remove the KVM module:
sudo modprobe -r kvm-intel
Updated: added user to libvirtd group instead of kvm group. Removed launching with sudo.