New(ish) Linux-based Hypervisor: KVM

drag

Elite Member
Jul 4, 2002
8,708
0
0
It's aviable as a module and also will be aviable in vanilla kernel 2.6.20 when that gets released.

The basic requirements is that you have to be running Linux (obviously) and you have to have a machine that supports either the AMD or Intel virtualization extensions (SVM/AMD-V and VT respectively), This requires both motherboard and cpu support to work. Some motherboards may have a bios upgrade avaible that adds the features, other times they are purposely disabled for whatever reason.

It's designed to be very simple and use as much existing functionality in the kernel as possible. The one thing limiting it right now is a lack of proper MMU optimization, but right now it should be usefull for desktop stuff and it's being worked on.

If you ever used Qemu then this thing is be very similar... For running Windows inside of Linux you'd go like this (if your running Debian, and assuming you have a windows cdrom in /dev/cdrom (works with iso images also))


sudo apt-get install kvm kvm-source module-assistant # install software, may need to install qemu stuff also
sudo m-a a-i kvm # using module assistant to compile and install kvm-source
sudo modprobe kvm # make sure it's loaded
qemu-img create -f qcow vdisk.img 10G # creating disk image, you can use raw devices or drive images also
sudo kvm -no-acpi -hda vdisk.img -cdrom /dev/cdrom-boot d -m 384 # boot to the installation cdrom
sudo kvm -no-acpi -hda vdisk.img -boot c # run the operating system

They have a generic howto, some Suse information, some Debian information (were I got above) and some other stuff at
http://kvm.sourceforge.net/

I haven't had a chance to look at it yet, but it should be interesting for people that want to try out multiple versions of Linux or have Windows aviable for running those applications you can't get for Linux. Not usefull for games that require hardware acceleration, of course.

(I wrote a long ass and possibly misleading article here)
 

drag

Elite Member
Jul 4, 2002
8,708
0
0
Not sure. You can find out if your system supports the extensions by going:
egrep '^flags.*(vmx|svm)' /proc/cpuinfo
 

drag

Elite Member
Jul 4, 2002
8,708
0
0
According to this:
http://lists.xensource.com/archives/html/xen-users/2006-09/msg00378.html

All AM2 socket proccessors support AMD-V, except for Sempron

Also all AMD (Opteron included) proccessors that support DDR2 will have AMD-V, except for Sempron.


edit:
For Intel I know that the Pentium-D 9xx series dual-core proccessors support VT. The 8xx series, like the Pentium-D 830, do not support VT.

I don't know about Xeons (newer ones all should), and I assume that all the Core Duo stuff should support it. I don't know about single core ones and I would be suprised if Celerons support it.

Remember that it depends on the motherboard supporting it also. (so look for a bios upgrade if your extensions aren't working) I've seen one person post that it was disabled in his Thinkpad for some reason...
 

SleepWalkerX

Platinum Member
Jun 29, 2004
2,649
0
0
Cool. Suse has this neat graphical xen virtual machine manager in yast that I was going to play around with, but I found out my 3000+ wasn't supported and I was sad. Can't wait to play around with virtual machines though. It'd be really cool to get Windows running while inside Suse.
 

kamper

Diamond Member
Mar 18, 2003
5,513
0
0
So this is like a xen alternative? Why do we need another one and how were they able to pull it off this fast (I don't think I've heard of it before)?
 

drag

Elite Member
Jul 4, 2002
8,708
0
0
Originally posted by: kamper
So this is like a xen alternative? Why do we need another one and how were they able to pull it off this fast (I don't think I've heard of it before)?

Sure it's a Xen alternative. Without the MMU optimizations it's going to be much more CPU intensive, but it probably won't reach the performance level of Xen even with the MMU improvements being worked on. It'll be more along the lines of Vmware Workstation or Microsoft Virtual Server speeds.

I haven't had a chance to try it yet, probably get around to it this weekend. But if you ever used Qemu Accelerator with it's propriatory kernel module I expect it to be about that fast right now.

The reason it's gotten into the so quickly is because it's small (and probably well programmed, and probably done by existing kernel programmers) and uses as much as the existing Linux kernel code as possible. So it doesn't require the large amounts of patches and changes that you would have to do for Xen/Linux.

The cool thing about it is that it's so simple. just a kernel module and you have pretty decent speeds. Userland is all based on Qemu stuff, which has gui front ends and such.

edit:
..and since it's aviable in the kernel by default it will end up getting a much larger audiance then what Xen has enjoyed, so expect nice integration into desktops with GUIs and such fairly quickly. The major thing holding it back is that you have to have the hardware to support it.

If you don't and it still seems attractive you can check out Qemu Accelerator that will do about the same thing and isn't limited by the hardware. It requires the use of propriatory kernel driver, unfortunately, but it does work pretty well.

Qemu will be aviable by default on Debian and such, and you can go to their website.

the images and such used by Qemu should be compatable with KVM. In fact they said somewere that due to troubles with APIC and the windows installer you can install it first using Qemu and then use KVM to run it afterwards.
http://fabrice.bellard.free.fr/qemu/qemu-accel.html

Of course the nice thing about KVM is that it'll probably end up faster and it isn't propriatory.
 

Nothinman

Elite Member
Sep 14, 2001
30,672
0
0
Not sure. You can find out if your system supports the extensions by going:
egrep '^flags.*(vmx|svm)' /proc/cpuinfo

That's not 100% telling, for instance the Lenovo X60s (I believe that's the model) support the instructions in the CPU but the BIOS disables them so it can't work.

Cool. Suse has this neat graphical xen virtual machine manager in yast that I was going to play around with, but I found out my 3000+ wasn't supported and I was sad. Can't wait to play around with virtual machines though. It'd be really cool to get Windows running while inside Suse.

You can still play around with Xen without the VT hardware support, you just can't use OSes that aren't ported to Xen so you're stuck with Linux, OpenSolaris, NetBSD and I think FreeBSD.

So this is like a xen alternative? Why do we need another one and how were they able to pull it off this fast (I don't think I've heard of it before)?

It's not on feature-par with Xen yet, but probably will be eventually. And it was able to be done so fast because it's so small, most of the work is done in qemu which they forked for the initial release. Eventually their changes will be folded back into qemu and then you'll be able to choose whether to use qemu with or without kvm.
 

drag

Elite Member
Jul 4, 2002
8,708
0
0
That's not 100% telling, for instance the Lenovo X60s (I believe that's the model) support the instructions in the CPU but the BIOS disables them so it can't work.

Well you need support in both the motherboard and on the CPU to determine weither or not you can use it, I beleive. So it's telling if you want to know if a system will support the software.

(like I said, if your not getting support and your cpu model should support it look for a bios-upgrade for your motherboard. Especially if you have a Intel motherboard...)
 

drag

Elite Member
Jul 4, 2002
8,708
0
0
It's not on feature-par with Xen yet, but probably will be eventually. And it was able to be done so fast because it's so small, most of the work is done in qemu which they forked for the initial release. Eventually their changes will be folded back into qemu and then you'll be able to choose whether to use qemu with or without kvm.

Ya it should eventually have about the same amount of features of Xen, but Xen will always have a place for performance critical systems. This would be due to the fact that Xen is very thin and efficient compared to Linux, closer to 'bare metal' and as the hardware technology increases Xen is less and less dependant on the Linux kernel for abstracting I/O.

With KVM you will always have a conflict between how the Linux kernel scheduals stuff and does it's memory management vs how the hosted system manages stuff. For instance with KVM you can run into a situation were conflicts in I/O patterns between a hosted Solaris and the native Linux system can cause bad performance.. were as with Xen you could just stick them on different disks and you'll be fine.

It's like the difference between Vmware Server vs Vmware ESX.
 

Nothinman

Elite Member
Sep 14, 2001
30,672
0
0
Well you need support in both the motherboard and on the CPU to determine weither or not you can use it, I beleive. So it's telling if you want to know if a system will support the software.

I could be wrong but all I've seen in the discussion about the Lenovo notebooks is that the hardware is capable but the BIOS disables it for some reason, someone's blog mentioned them releasing an updated BIOS for a different model to enable the VT extensions so maybe the X60s will be fixed eventually too.

For instance with KVM you can run into a situation were conflicts in I/O patterns between a hosted Solaris and the native Linux system can cause bad performance.. were as with Xen you could just stick them on different disks and you'll be fine.

Putting them on different disks should be enough for both systems AFAIK, they'll be especially similar if you're using normal files for disks in the Xen images.
 

drag

Elite Member
Jul 4, 2002
8,708
0
0
I could be wrong but all I've seen in the discussion about the Lenovo notebooks is that the hardware is capable but the BIOS disables it for some reason, someone's blog mentioned them releasing an updated BIOS for a different model to enable the VT extensions so maybe the X60s will be fixed eventually too.

They may end up having to experiment with flashing a bios from a different manufacturer. Leveno may be purposely disabling VT for some reason. (don't ask me why, IBM has modified the bios of laptops in the past to block third party wifi cards also).

On my system at home I didn't immediately had VT aviable for my system until I flashed the bios, but that was due to the fact that the motherboard pre-dated VT aviability slightly.