KVM and Virt-Manager On Ubuntu 8.04

By | 2008/06/08

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.

Initial Setup

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…

Running Virt-Manager

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.

virt-manager

Troubleshooting

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

Enjoy.

Updated: added user to libvirtd group instead of kvm group. Removed launching with sudo.

11 thoughts on “KVM and Virt-Manager On Ubuntu 8.04

  1. Vadim P.

    I tried KVM before, but the windows install was failing for some odd reasons in it. I’ll give it a try when I’ll be needing a 64bit ubuntu though later on.

    Reply
  2. T.C.

    virt-manager works as regular user if you add yourself to “libvirtd” group. You don’t need to add yourself to the “kvm” group.

    Reply
  3. dremon

    There is no need to run virt-manager with sudo as long as the user is added to the libvirtd group.

    Reply
  4. lovag

    “I will say that KVM is the only solution that will let me run 64bit guests on my 64bit host.”

    I am not agree with you…

    I have as host Ubuntu 8.04 64bit, running VMWare server 1.0.5 and I have guests using 64bit OS (Ubuntu 8.04) and I have no problems with this…

    Just my 2cents

    Reply
  5. asa-ayers

    Is there a way to switch ISOs with virt-manager now? I tried using it before, but once your virtual CD-ROM had an iso in it, the only way I found to change disks was to shut down the VM, delete the CD-ROM, and create a new CD-ROM pointing to a new ISO.

    Reply
  6. mariuz

    I just installed and when i try to run the jeos install when booting from cd the keyboard is not accessible and have no reaction from it (send ctrl-alt-del …)

    This is on an remote server with hardy+kvm
    and i login to it with -X

    Reply
  7. Andres

    I did the “aptitude install kvm virt-manager libvirt-bin” but can not find any KVM package under to download. Seems that my list of apt-get sites is not the most appropiate… Any suggestion of site to add to my list so I can download the package ?

    Thks

    Reply

Leave a Reply

Your email address will not be published. Required fields are marked *