Tombuntu

Virtualization with Virt-Manager and KVM in Ubuntu 8.04

Ubuntu 8.04 has introduced a new option for virtualization: Virt-Manager. Using Virt-Manager, libvirt, and KVM, you can take advantage of the virtualization hardware built-in to recent CPUs.

Virt-Manager is a GUI for managing virtual machines with the Libvirt toolkit. KVM is the infrastructure in the Linux kernel that uses Intel and AMD’s virtualization extensions. I installed and set up Virt-Manager with KVM on Ubuntu 8.04, where they are both easily installable from the repositories.

Here are some screenshots:
Virt-Manager windows
Virt-Manager VM

You’ll need to find out if your CPU has virtualization support and whether it is turned on. Support may be turned off in your BIOS. Running the command below appropriate for your CPU manufacturer will produce output if KVM support is found:

Once you find that your KVM support is working, start the installation:

  1. Install the packages for virt-manager, libvirt-bin, and kvm:

    sudo apt-get install virt-manager libvirt-bin kvm
    
  2. Add your user to the kvm group so you can run it as your normal user:

    sudo adduser $USER kvm
    
  3. Log out and back in to make the group change take effect.

  4. Try running kvm in a terminal. If you get usage information and no errors, then KVM is working.

  5. Start Virt-Manager from Applications->System Tools->Virtual Machine Manager.

  6. Whenever you open Virt-Manager you’ll need to click connect to QEMU. Click File->Open Connection. Set Hypervisor to QEMU and Connection to Local. You should now see the connection in the main list.

  7. Select your connection and click New to create a new virtual machine using the step-by-step guide. When you get to the step Choosing a Virtualization Method check Enable kernel / hardware acceleration.

Once your VM is set up, right click on it in the list and click Run to open it. Also, click Details for more configuration.

One problem you’ll likely notice is that Virt-Manager uses a VNC server to display the guest, which causes graphical slowdowns. There’s an option to add a SDL graphics device similar to VirtualBox. Open the VM details dialog, and select the Hardware tab. Find the existing display device and remove it. Click Add, and in the wizard select Graphics device and Local SDL Window. The display will be much faster now, but it will be in a simple QEMU window without the VM controls. You can still administer the VM from the main Virt-Manager window.

Virt-Manager is definitely much more powerful and server-oriented than my favorite virtualization app, VirtualBox. Most casual VM users will be better to use VirtualBox or VMware. Power VM users can take advantage of the more advanced configurability and server support. However, Virt-Manager with KVM does seems to run faster than VirtualBox.

Archived Comments

Arp

Does this offer ‘seamless’ windows as well?

Scott Wegner

I just started using kvm and qemu inside of Hardy to test other Linux distros. However, I’ve had trouble when configuring a guest machine with 2 processor cores. When installing the OS, the process will hang sporadically, so I will have to restart the install. I haven’t had this problem when only using 1 virtual processor.

Has anyone else had this problem? I was reluctant to file a bug report because I thought it might be something I was doing wrong, but I haven’t been able to figure it out.

--Scott

Tom

Arp:
This doesn’t offer seamless windows, but it should still possible to do.
https://help.ubuntu.com/community/SeamlessVirtualization

Scott:
I’ve tested a VM with 2 cores and it seemed to work fine, but I haven’t tried installing an OS with more than one.

shell

can use USB web cam??

Aaron

I’m excited to see virt-manager in Ubuntu 8.04. That is most definitely a welcomed piece of software. One question I have though is, did you have any trouble setting up bridged networking, so the host can talk to the guest, the guest to the host, and guest to guest? I really need this to work.

Arp

The breadth and depth of community documentation continually surprises me. I can’t wait to have some downtime to make the switch.

Tom

shell:
I’m not sure whether this supports USB.

Aaron:
I haven’t tried bridged networking, and there doesn’t seem to be a simple way to set it up in the GUI.

sparks40

I am running Ubuntu 8.04 as my primary OS and trying to set up Windows XP as my first virtual machine. Everything is fine until I get to the “Locating Installation Medium” screen. The “CD or DVD” opton is grayed out even though I have the original Windows XP CD residing in my CD ROM. The only other options are “ISO Image Location” and “Network PXE”, either of which I believe to be incorrect. Any suggestions?

Anonymous

Looking at the screen trying to load windows, click on the View/Details menu. The info-box will pop-up in Overview mode. Click on the Hardware tab. Now, click on the +Add button. In the new info-box, select Storage device on the drop down, then click Forward. In the new window, select Normal Disk Partition. In the Partition field enter /dev/cdrom or /dev/cdrw, or whatever is the appropriate device location for you CD drive. In Device type, select IDE, even if it’s a SATA CD drive. Click Forward and voila! You might have to shutdown and restart the Windows session for it to recognize the CD but that should do it.
HTH
EoRaptor

Anonymous

I’m having the same CD problem. I tried Anonymous’ add hardward solution. I can’t select ‘Normal Disk Partition’ as it is unavailable. I am running 64 bit if that helps.

Anonymous

it seems to be a bug in virt-manager, check:

https://bugs.launchpad.net/ubuntu/+source/virt-manager/+bug/238692

I (re)booted it from the command line, using
kvm -no-acpi -m 512 -cdrom /dev/cdrom -boot d .img
and that worked.
After installing run & manage from virt-manager.
Only thing is you (still) got no working cdrom in windoze :-(

Sven

Hi, I just don’t get it. I have started all of the above but when it comes to the point of creating an image and installing I always think this is the wrong solution for me??? I’m running Ubuntu 8.04 as a host and want to have my already installed Windows Vista (on \dev\sda1; Formatted as ntfs; unmounted at the moment) as a guest. How do I make that? Thanks for helping out a newbe.

Michel

Did you find a solution? (I have the same problem with Windows XP on a second disk))

Anonymous

sparks40,
Cd rom is NOT grayed out..just click on the drop down menu..you will see your cd o/s image loaded..it takes a few seconds for it to show up..and proceed onto the next step. it works fine for me.

Xyem

Just after virt-manager has finished creating the image file, it gives me an error ( Ubuntu 8.10 ). I posted the full error on the Ubuntu Forums.

http://ubuntuforums.org/showpost.php?p=6373094&postcount=2

Anyone else experienced this?

Respond via email