On virtualization…

Well, I quit using VirtualBox for my virtualization needs. I am now using kernel based virtualization, or kvm. Kvm offers many advantages, in my opinion, the key being the simplicity and ease of use. I did not like the VBox abstraction.

  • kvm’s core code is *in* the kernel, userspace tools are in a package. Kvm is part of Linux and uses the regular Linux scheduler and memory management. This means that kvm is much smaller and simpler to use. [1]
  • kvm is Free Software released under the GPL.
  • kvm uses processor extensions (HVM) for virtualization.
  • kvm supports 64bit guests out of the box.

Also, kvm is a breeze to setup. In a nutshell, create the img. kvm-img create gentoo-amd64.img 10G then boot the gentoo live cd. kvm -hda gentoo-amd64.img -cdrom /path/to/iso -boot d. Then follow the gentoo install handbook. Simple.

Lastly, kvm images are easily transportable and will run on other hosts (within reason, can’t run a 64bit guest on a 32bit host, etc). As a matter of fact, I present to a amd64 guest if you would like to use it*, here. Unpack it, and it will decompress to 15-16G (sparse files). Then you can start it by simply running kvm /path/to/img. In that guest you will find a pretty recent stage 3 install and emerge -e world done. There are a few other essential apps on there (vim & dhcpcd). From there, you can emerge xorg-x11, a DE, do whatever you want, really. I am using that guest to test out xfce development efforts and to be sure that we can bring you guys xfce-4.6 asap, once it is ready :) Cheers, and have fun playing with kvm!

*I do not wish to support this in ANY way, shape, or form. Use it how you wish, but do not expect help with it. Sorry.

9 Comments

  1. Donnie Berkholz says:

    It might be fun to post more VMs like this in the future, if tb will host ‘em all.

  2. Alec says:

    I wish I could ditch my virtualbox and get use kvm, but my processor does not support native virtualization :(

  3. Cynyr says:

    Do you have an easy example to get networking working? that has basicly the only thing keeping me on VBox instead of kvm (all i really need is nat networking as it is called in vbox, an internal dhcp server and a software transport to the real interface) Also know even the simplest of gui’s for kvm? like a list and when you double click it launches one? I looked at writing on in python/gtk but it never got off the ground…

  4. Cynyr says:

    disregard the comment about networking… they must have added -net user since about version 63

  5. Bruce says:

    @Cynyr
    Have a look at qemulator, a front end for qemu. The faq indicates that it should work with kvm too, although it has not been well tested yet.

  6. manfred says:

    There are contradictory reports floating around concerning the efficiency esp. comparing kvm and virtualbox; examplum gratia:
    http://ww1.4hf.de/2008/08/virtualisierung-desktop-virtualisierung-im-vergleich.html
    cites really outstanding benchmarks esp, for virtualbox ;)
    How are your experiences with kvm so far? Are you content?
    Kind regards!

  7. jolexa says:

    @Cynyr: nat networking worked for me out of the box. I had a harder time getting VBox networking to work right.
    @Bruce: thx for the hint, I will look into that myself and bring the ~amd64 kw to it if it works.
    @manfred: I didn’t think the best of VBox performance. Disk I/O took a horrible hit and compilation was slow. I don’t have any concrete numbers and this is my opinion of course but at least I *did* try both ;) Also, you can pass -smp to the kvm arguments and your vm will have multiple processors. This way I can keep my host cpu usage at 100% (if desired) vs 40-50% max with VBox. Maybe there is a way to tweak this in VBox..not sure though.

  8. jolexa says:

    On the topic of kvm frontends:

    qemulator is a mess on amd64. I did eventually get it to work by unpacking the tarball and running it from there (it is a simple python script) but the ebuild is no where near ready for amd64.

    virt-manager has about ~80 deps on my machine and I don’t care to install it. I think Ubuntu may be going down that route. [1] The screenshots of this one look promising.

    virt-viewer: haven’t quite figured out how to use this.

    others?

    [1]: http://brainstorm.ubuntu.com/idea/282/

  9. tux2 says:

    QtEmu [1] is an other frontend for kvm/qemu.

    [1] http://qtemu.org/

Leave a Reply