Slashdot Mirror


Linux Kernel to Include KVM Virtualization

It looks like the newest version of the Linux kernel (2.6.20) will include KVM, the relatively new virtualization environment. From the article: "Thanks to its approach KVM already runs in the current kernel, without any extensive bouts of patching and compiling being required, after the fairly simple compilation of a module. Virtual machines that run unmodified operating systems are meant to appear in the host as a simple process and work independently of the host kernel. In a fashion comparable to that of Xen a modified QEMU is used for the supportive emulation of typical PC components of the virtual machines."

51 of 194 comments (clear)

  1. Yes... by Anonymous Coward · · Score: 2, Funny

    ...but does this Linux run Linux?

    1. Re:Yes... by Anonymous Coward · · Score: 2, Funny

      Of course. But remember, it violates Microsoft's Valuable Intellectual Property each time it does so!

      Microsoft's Valuable Intellectual Property is important! Respect Microsoft's Authoritah!

  2. how many KVMs by Gopal.V · · Score: 5, Informative

    First there was KVM switches and then there was the Java KVM (kilobyte VM).

    Now there's the linux KVM which has nothing to do with either those or the Kernel VM rewrites of the linux past.

    Leave that acronym alone !

    1. Re:how many KVMs by should_be_linear · · Score: 3, Insightful

      All three-letter acronyms are recycled many times already but it will not stop future projects/organizations to recycle them once more.

      --
      839*929
    2. Re:how many KVMs by bazorg · · Score: 3, Funny

      yep, there just aren't enough TLA...

    3. Re:how many KVMs by the-stringbean · · Score: 3, Funny

      Now all we need is somebody to connect a KVM (switch) to a KVM (virtualisation) machine that's running a KVM (Java KVM)!

      I just know that someone is going to comment on KVM overlords soon...

    4. Re:how many KVMs by lintux · · Score: 2, Interesting

      And it's not even an KDE app! I used to think it was some KDE front-end to an existing virtualization program...

    5. Re:how many KVMs by freakmn · · Score: 2, Funny

      Now all we need is somebody to connect a KVM (switch) to a KVM (virtualisation) machine that's running a KVM (Java KVM)!

      If I get to pick who gets to hook all this up, my vote goes to K. V. Mahadevan, who is also under KVM in wikipedia. Or perhaps a member of the Belgian Football Team, while visiting the Kalamazoo Valley Museum. Actually, looking at a list of Acronyms for KVM, it appears that this usage of KVM ranks second to last of the 8 that it lists, only above the Belgian Football team, Koninklijke Voetbalclub Mechelen. Pretty pathetic, if you ask me.
      --
      warning: This post is likely to contain gobs of dripping sarcasm. Consume at your own risk.
    6. Re:how many KVMs by Andrewkov · · Score: 2, Funny
      First there was KVM [wikipedia.org] switches and then there was the Java KVM [sun.com] (kilobyte VM).

      Now there's the linux KVM [sf.net] which has nothing to do with either those or the Kernel VM rewrites of the linux past.

      Leave that acronym alone !

      KVM? Personally, I'm waiting for the Gnome version.

    7. Re:how many KVMs by grammar+fascist · · Score: 2, Funny

      Well you know, there are only 26 * 26 * 26 = 17576 combinations of TLAs to choose from. Of course, some are a priori more likely than others because of the relative frequencies of letters that start proper names.

      And if you throw out the lame ones, you have, like, five left. That's the problem.

      --
      I got my Linux laptop at System76.
  3. KVM switch? by advocate_one · · Score: 4, Funny

    I take it this has nothing to do with the other meaning for KVM, Keyboard, Video, Mouse switches... there I was thinking that my Belkin KVM switch was finally gonna work properly (I have two mice connected as the switch cannot switch the mice correctly)

    --
    Donald 'Duck' Dunn: We had a band powerful enough to turn goat piss into gasoline.
    1. Re:KVM switch? by Anonymous Coward · · Score: 2, Insightful

      > there I was thinking that my Belkin KVM switch was finally gonna work properly
      > (I have two mice connected as the switch cannot switch the mice correctly)

      Keyboard and mouse data comes in packets of about 3 or 4 bytes. If a KVM switch toggles mid-packet the PC and/or the peripheral may get badly confused. A well-designed KVM product will get this right, but many don't; it looks like your Belkin product falls into this category.

      KVM swithces also vary enormously in their video quality. It is a mistake to think of a KVM switch as a "commodity" device. It is well worth spending a bit extra to get a well-designed product. You're unlikely to have any problems with Adder or Avocent kit.

    2. Re:KVM switch? by TheThiefMaster · · Score: 3, Informative

      Don't get me started on belkin, I've had trouble with everything they've made. I've even got a usb bluetooth adapter here that isn't xp sp2 compatible. It's an F8T001_v1, I've had it since before SP2 was released, and I tried it again recently and they still haven't made SP2 drivers for it (last driver release was 2003).

      But seriously, I read an article once about why kvms can't switch mice properly, apparently it's because the ps2 mouse protocol has no synchronisation in it. So when a cheap kvm switches the mouse to the other pc, switching in the middle of a data packet more often than not, the pc starts thinking the start of the packet is the middle. This results in things like "moving the mouse clicks the buttons" and other such fun. Most mouse drivers can identify this problem and correct for it, but it takes a few seconds of mouse movement. Even better, some laptops have a kind of ps2 merge circuit for their ps2 touchpad and external mouse, so if the external mouse gets out of sync there is no way to correct it, because the merge is too stupid and the drivers can't see the touchpad and mouse separately, so it can't independently change the synch of the external mouse.

      In other words, either get a decent kvm, a kvm that can switch usb mice (which do have synch and so don't have this problem), or stick to two separate mice.

      Oh, one more word of kvm warning, they often can't handle resolutions above 1024x768 on the monitor without blurring badly. Whether this is the fault of the cheap cables they always come with or the kvm itself, I don't know.

  4. Not frist psot! by Aladrin · · Score: 3, Interesting

    Not first post, but at least I can be the first not to kvetch about them not integrating a physical object with a piece of software. -sigh-

    The article talks about a news article mistakenly stating it was for Intel processors only. I imagine it said that because the official site says it's for Intel only. http://kvm.sourceforge.net/howto.html

    It does also say elsewhere on the site http://kvm.sourceforge.net/faq.html that it's for certain AMDs also.

    It claims it can run 32-bit windows inside the virtualization. Does this mean Windows can directly access the hardware, and provide true 3D support and such? Or is it simply another hardware emulator with all the associated problems? Too bad 'windows guest' installation is broken at the moment.

    --
    "If you make people think they're thinking, they'll love you; But if you really make them think, they'll hate you." - DM
  5. Excellent by October_30th · · Score: 2, Interesting

    But is this going to let me run 32-bit Windows under 64-bit Linux? Apparently Xen can't do it and that really bugs me.

    --
    The owls are not what they seem
    1. Re:Excellent by repvik · · Score: 2, Informative

      Yes:

      "The driver supports i386 and x86_64 hosts and guests. All combinations are allowed except x86_64 guest on i386 host. For i386 guests and hosts, both pae and non-pae paging modes are supported." (From LKML)

  6. Only up to date processors? How up to date? by Viol8 · · Score: 2, Insightful

    It mentions some code names but I'm not au fait with Intel or AMD code names. How long have these functions been in CPUs? Will my P4 support it or is it only the latest core duos and so forth?

    1. Re:Only up to date processors? How up to date? by d34d.10n · · Score: 4, Informative

      From Wikipedia:

      "Intel VT was officially launched at the Intel Developer Forum Spring 2005. It is available on most Pentium 4 6x2, Pentium D 9x0, Xeon 3xxx/5xxx/7xxx, Core Duo and Core 2 Duo processors. On some implementations, IVT support may be switched off in the BIOS/EFI."

      "AMD processors using Socket AM2, Socket S1, and Socket F include AMD Virtualization support. In May 2006, AMD introduced such versions of the Athlon 64 and Turion 64 processors. AMD Virtualization is also supported by release two (x2xx series) of the Opteron processors."

  7. I hope Windows can't access the hardware. by Viol8 · · Score: 2, Insightful

    If you it gives another OS *full* access to everything then you'd be just as vulnerable to viruses , worms etc as if you were running that OS natively and you could well find your linux filesystem hosed. Hopefully guest OSes will be in a sandbox or at the very least only allowed to directly access specific user defined hardware resources. If not then I certainly won't be taking advantage of this system anytime soon.

    1. Re:I hope Windows can't access the hardware. by Schraegstrichpunkt · · Score: 4, Informative

      How in the WORLD does access to the video, sound, or any other daughterboard grant access for a virus?

      DMA + lack of IOMMU = unrestricted access to system memory

      ... in the WORLD

    2. Re:I hope Windows can't access the hardware. by LarsG · · Score: 4, Insightful

      How in the WORLD does access to the video, sound, or any other daughterboard grant access for a virus?

      If you don't know, please leave your geek-card at the door on your way out.

      Short answer - DMA.

      Long answer - memory protection between processes (and in this case guest OSes) is done by the MMU, making sure that process A can't read/write to memory owned by process B (or in this case guest OS and host OS). Unfortunately, the memory space seen by devices on extention buses like PCI is not mapped by the MMU. If a process has direct access to a device that supports DMA, it can tell the device to read or write memory that belongs to other processes (f.ex. order the sound card to read the sound buffer from kernel space. The process can then read the sound buffer to get access to kernel memory).

      To safely allow a process (or guest OS) direct access to hardware devices, the hardware architecture and OS needs to be designed so that a DMA from the hardware device can only access memory owned by the process that ordered the DMA.

      --
      If J.K.R wrote Windows: Puteulanus fenestra mortalis!
  8. VMWare by brunes69 · · Score: 2, Informative

    You can do that in VMWare player and VMWare server, both of which are free (as in beer).

    http://www.vmware.com/

    1. Re:VMWare by BokLM · · Score: 2, Funny

      You can do that in VMWare player and VMWare server, both of which are free (as in beer).

      You mean I can get drunk if I use them too much ?

  9. Virtualisation on Linux by cortana · · Score: 4, Informative

    Xen
    VMWare
    linux-vserver
    UML
    OpenVZ
    Plex86
    Qemu
    Bochs
    lhype

    and now

    KVM

    http://linuxvirtualization.com/ has some good linux to recent announcements regarding virtualisation software on Linux.

    Are there any more?

    1. Re:Virtualisation on Linux by julesh · · Score: 4, Informative

      Many of these are substantially different from standard virtualization systems, though:

      linux-vserver and OpenVZ are chroot-based virtual hosting environments, not virtualized operating systems. You can add OpenVSD to the list of such projects, although it appears to be practically dead.

      Qemu and Bochs are PC emulators, not virtual machines, which is a slightly more subtle distinction, but still one that needs to be made.

      UML is something different entirely -- an operating system that is designed to run as a process on another operating system with a similar syscall interface.

      That leaves KVM, Xen (which uses an exokernel, so is effectively its own OS, not a Linux-hosted VM), VMware (which is proprietary) and plex86 (which will only run modified kernels so doesn't provide a true virtual machine).

      So, you see, KVM is effectively the only Linux-based VM system (by the traditional definition) on that list.

    2. Re:Virtualisation on Linux by Ed+Avis · · Score: 2, Informative

      You left out dosemu (the earliest hardware virtualization, using the V86 mode of all 386-compatible processors - but also supporting 32-bit DPMI applications) and DOSBox (which is based on bochs). Also Cooperative Linux for running a Linux system under other OSes, such as Windows.

      --
      -- Ed Avis ed@membled.com
    3. Re:Virtualisation on Linux by baadger · · Score: 2, Informative

      Actually there is/was an open source effort to replace the KQEMU "accelerator" module... QVM86. Unfortunately it needs work, it's functional but only operates on x86 (no x86_64). There are patches against current CVS for compatibility with KQEMU 1.3.x and QEMU 0.8.2 on the QVM86 newsgroup but development seems to have otherwise stagnated.

      Also the author of KQEMU did say he would open up the source if sponsored.

  10. Not everything, just video by brunes69 · · Score: 3, Interesting

    One of the main barriers to Linux adoptoin is the fact that you can't ru Windows games in Linux, unless you reboot into windows. If LVM / Xen / QEMU / VMWare started realizing this and made video driver performance a priority, they could have a real market leader on their hands.

    I know if there was a VM out there that coudl run Windows games with full native windows video accelleration, I woudl pay very good money for it.

    Sound / disk / CPU performance has been there in VMs for years, at least froma desktop users standpoint. The one area that lags behind all other sis video support. Even with VMWare (arguable the fastest VM out there right now), running a full scrteen Windows session under Linux feels sluggish at best...a nd there isno Direct3D support at all.

    And as far as your comment - there is absolutely nothing stopping them from doing this. Just look at X, it interfaces direct with the kernel via DRI, and it's secure.. a crashing X session won't bring your whole machine down.

    1. Re:Not everything, just video by Schraegstrichpunkt · · Score: 2, Insightful

      One of the main barriers to Linux adoptoin is the fact that you can't ru Windows games in Linux, unless you reboot into windows. If LVM / Xen / QEMU / VMWare started realizing this and made video driver performance a priority, they could have a real market leader on their hands.

      If the full interface documentation for recent Nvidia and ATI video cards was released, and GPL-compatible drivers existed, this would probably already be in the works.

    2. Re:Not everything, just video by Alioth · · Score: 2, Insightful

      Games is not the main barrier to adoption. The home desktop is low price, low margin cut-throat business. Why would VMware, XenSource etc. want to go after a market which will be difficult to support, and not provide them with the money they need to keep going? The corporate market (particularly servers) is far larger and far more important for them - so don't expect video drivers to ever be a priority.

    3. Re:Not everything, just video by Mad+Merlin · · Score: 2, Insightful

      Games may be an inhibitor for Linux adoption in the home market, but Xen/QEmu/KVM/VMWare aren't aimed at the home market at all. When you consider the fact that what you want is most definitely not a simple task, you may understand why nobody has done it yet.

    4. Re:Not everything, just video by Viol8 · · Score: 2, Insightful

      "a crashing X session won't bring your whole machine down."

      If it locks up the video sub system it can make the machine unusable except via a net or dumb terminal connection , which could mean the machine needs a reboot. Not good in a business enviroment.

  11. For those brain-dead like me: by erroneus · · Score: 4, Informative

    http://www.haifux.org/lectures/152/kvm-external.pd f

    This breaks down in fairyly simple terms where KVM fits in. Basically, the approach is pretty close to the VMware approach but presently requires the newer, more advanced processors to operate. So where VMware can run on more hardware such as my Pentium M processor based laptop, KVM will not likely work as far as I can tell. (Please tell me I'm wrong if I am.)

    I'm disappointed that I will not be able to play with this new toy any time soon as I don't think I will be buying new hardware any time soon.

    1. Re:For those brain-dead like me: by Conley+Index · · Score: 5, Funny

      I'm disappointed that I will not be able to play with this new toy any time soon as I don't think I will be buying new hardware any time soon. You can always emulate modern hardware...
    2. Re:For those brain-dead like me: by erroneus · · Score: 2, Informative

      http://www.intel.com/products/processor_number/pro c_info_table.pdf

      This confirms it. I can't play. But it also lists who can play! Are you on the list? Check it out.

    3. Re:For those brain-dead like me: by zdzichu · · Score: 5, Informative

      Yes, it needs processor with Intel VT-x (Vanderpool) or AMD SVM (Pacifica). So Pentium 4/D (available since 2005), most of Core Duos, Core 2 or AMD CPUs sold since August this year (Socket F/1207 and AM2) qualify.

      --
      :wq
    4. Re:For those brain-dead like me: by gbjbaanb · · Score: 3, Informative

      No, KVM will work, but it will not be as fast as you'd like. With the new CPU instructions, it will be a lot faster. (the reason is down to the memory management unit, with a VM every time it context switches, it throws away some cached page state. The new CPUs deal with this so you get the better performance).

      I read a ng post where the author said his VM desktop was fine, but with the new CPUs you'd get performance very near running natively.

    5. Re:For those brain-dead like me: by idlake · · Score: 2, Informative

      Basically, the approach is pretty close to the VMware approach but presently requires the newer, more advanced processors to operate.

      That's not a good way of putting it, because it incorrectly suggests that VMware somehow pioneered virtualization and KVM follows it. But what VMware actually pioneered was a workaround for a lack of virtualization instructions on older x86. Modern x86 virtualization follows models that have been around since long before VMware existed.

  12. VMotion/HA? by Stile+65 · · Score: 4, Interesting

    The company I work for now is virtualizing on RedHat boxes running VMWare, and one of the neat features that it has is called VMotion, which lets you nearly instantly move a virtual machine from one box to another without interrupting its execution (except a slight delay). The high availability (HA) feature, which they also have but we have not yet configured, allows this to happen automatically if a host box goes down. There are rules about which VMs may not run on the same machines, etc. (for redundancy purposes, you don't want all your web servers running on the same host, for example).

    Is this at all possible with KVM? If not, are they planning it? Is it possible to approximate it with something like OpenMosix, since (IIRC) OpenMosix can move processes around dynamically when nodes fail or get bogged down, and a VM is just a process (assuming a central SAN that all the host boxes connect to)?

    --
    I claim first use of "Error No. 0B" - or "No. 0B error." It'll be the new ID 10T!
    1. Re:VMotion/HA? by Stile+65 · · Score: 2, Funny

      Not unless it really IS made of cheese.

      --
      I claim first use of "Error No. 0B" - or "No. 0B error." It'll be the new ID 10T!
    2. Re:VMotion/HA? by hey! · · Score: 4, Funny

      How about the moon on a stick? Would you like the moon on a stick?


      I'm an American, you insensitive clod. That means on a stick, wrapped in a pork rind, breaded, then deep fried. Mmmm.
      --
      Post may contain irony: discontinue use if experiencing mood swings, nausea or elevated blood pressure.
    3. Re:VMotion/HA? by smodak · · Score: 3, Informative

      Well, the company behind KVM (I realy hope they choose some other name for the finished product) reportedly has Moshe Bar on their payroll. IIRC he is the guy involved in OpenMosix, so I'd think that this facility, if not already available, would be available very soon.

  13. Re:qemu by Shawn+is+an+Asshole · · Score: 2, Insightful

    Why does it matter if you're running a proprietary OS in a proprietary VM? If you're concerned about only using free software, why bother with the proprietary OS? If you're wanting to virtualize Free operating systems, use Xen. It rocks.

    --
    "It ain't a war against drugs.it's a war against personal freedom" --Bill Hicks
  14. A W E S O M E ! ! ! by Anonymous Coward · · Score: 4, Interesting

    According to http://kvm.sourceforge.net/faq.html is will support VMWare images and it does run win32.

    Now turn that kernel into a BIOS http://linuxbios.org/Welcome_to_LinuxBIOS and you will be able to use the same images for all your machines.

  15. SVM for .net / Java by 0xABADC0DA · · Score: 2, Interesting

    Probably a joke but shouldn't be. The kernel developers could make it possible to accelerate the JVM/CLR by giving faster access to the actual hardware pages. What I mean is, the JVM has a 'scratch' area where recently created objects are allocated and then after garbage collecting this area the leftover objects are moved out. They do this because the vast majority of objects last only a tiny amount of time. So to be able to do a GC *only* of this scratch area the JVM actually replaces reference assignment with code that ads to a big list of all objects that took references to objects in this scratch area. Even though this is obviously slow it means the JVM doesn't have to garbage collect the entire contents of memory to make sure nothing has a ref to a new object.

    If the JVM could get access to the hardware's dirty page bit that says if a page has been modified since last checked then the JVM could do direct reference assignment and then when garbage collecting only search the modified pages for references into the 'scratch' area. I expect this would be many times faster than the pointer write barrier used now.

    Maybe a system call could take a mmap region and return a bitmask of page dirty flags? I think in any case there are plenty of things the kernel developers could do to make software virtual machines better if they tried. I think they just don't care to since that world is alien to them.

  16. Re:What benefits does this give? by BokLM · · Score: 4, Informative

    Why is this comment rated informative ?
    For thoses who are interested, look at this page :
    http://kvm.sourceforge.net/faq.html

    It is the same thing, but it is actually readable.

  17. KVM? by MMC+Monster · · Score: 2, Funny

    Does this mean I can use 2 mice independently on my system? Cool!

    --
    Help! I'm a slashdot refugee.
  18. Re:qemu by brunes69 · · Score: 2, Informative

    Take off your tinfoil hat and let your head breathe.

    You think VMWare tells anything to Microsoft? Why would they? They are about as far from being "in bed" with them as you can imagine. For one, Microsoft is their #1 competitor (with Virtual Server).

    You can rest assured that VMWare tells **as little as possible** to Microsoft about everything.

    All this is not to mention the fact that what you are implying would be highly unethical and if VMWare actually did that, they would have been found out long ago and publicly flogged. VMWare does not "phone home" to anyone, including VMWare Inc. itself.

  19. What is the big deal? by jlbprof · · Score: 2, Insightful

    I understand we are talking about virtual machines that is multiple OS's running on the same machine simultaneously.

    My question is: what does that offer me? Other then possibly running a linux and XP on my home machine what could that possibly offer anyone?

    Thanx

    Julian

    --
    I go out of my way to complicate the simple things, so that I can simplify the complicated things.
    1. Re:What is the big deal? by An+Onerous+Coward · · Score: 2, Informative

      Running Windows and Linux at the same time is a pretty big deal, if you need access to Windows-only apps. It's good for web developers, who need to check out their results in IE, and it may make some Windows to Linux migration attempts easier (since the migration might otherwise be held up by a desperate need for a single legacy app).

      What else does it offer you, the consumer? Well, you can try things that no sane mortal should attempt with their computer. Install crapware and find out what it actually does to your system, and just delete the VM when you're done. Or let your kid loose on your computer knowing that there isn't much he can do to hose it.

      Since you ask "what could it possibly offer anyone", I'd also point out that VMs are getting popular on computer farms (web hosting, etc), where clients are allowed to rent a virtual machine with guaranteed access to a certain amount of memory, a certain amount of clock cycles, etc. In clusters, there is also technology for halting a virtual machine on one box, migrating it to another, then starting it running there. That makes it much easier to take down a given box for maintenance.

      One other thing you can do is network simulations. You could have a dozen VMs running on a single host, all forming a virtual network of whatever topology you desired. This can be useful for trying out new network protocols and distributed applications.

      I'm sure there are lots of other examples that I'm not aware of.

      --

      You want the truthiness? You can't handle the truthiness!

  20. Read their FAQ by Shadowlore · · Score: 2, Informative

    It says in their FAQ:
    "kvm today supports non-live migration, where there is a pause while memory content is transferred. Pauseless live migration is work in progress."

    --
    My Suburban burns less gasoline than your Prius.