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.

If this site has been useful, please consider participating in the Fundraiser.

Other Points of Interest

Comments

11 Responses to “KVM and Virt-Manager On Ubuntu 8.04”

  1. Vadim P. on June 8th, 2008 2:36 pm

    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.

  2. T.C. on June 9th, 2008 1:26 am

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

  3. dremon on June 9th, 2008 2:40 am

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

  4. lovag on June 9th, 2008 8:21 am

    “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

  5. asa-ayers on June 9th, 2008 9:11 am

    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.

  6. Divan Santana on June 20th, 2008 3:11 am

    KVM vrs XEN

    Found this
    http://linuxtoday.com/news_story.php3?ltsn=2008-06-19-023-26-NW-HE-RH
    Looks like KVM is the way to go in the future.

  7. mariuz on June 25th, 2008 8:05 am

    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

  8. anonymous on July 1st, 2008 9:08 pm

    asa-ayers, did you ever find a solution to switching ISO files when the VM is running? It seems the same as https://bugs.launchpad.net/ubuntu/+source/virt-manager/+bug/230359

  9. Tux World on July 23rd, 2008 6:04 pm

    perfect! but is there anyway to switch from cd to iso?

  10. Andres on July 27th, 2008 1:14 am

    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

  11. http://mapopa.blogspot.com/ on August 18th, 2008 9:38 am

    The ubuntu install worked for i386 on an x86-64 host

    so now i can test it
    http://mapopa.blogspot.com/2008/08/installing-kvm-for-conference-for.html

Leave a Comment




    Subscribe to the RSS feed!


    subscribe to the ubuntu tutorials RSS feed

    Ubuntu Tutorials Fundraiser


    Please Donate to
    Server Improvement

    Target amount: USD1,000.00
    Total Donations: USD255.00
    Amount Needed: USD745.00

    Thank you for your support!

    Click to Donate

    Polls



  • Blogroll

  • Ads by Google