Linux on Hyper-V


As you have probably seen on every blog under the sun, Hyper-V has released.

hero-hyper-v

Rather than rehash the announcement, I thought I would try something fun.  How hard is it to get various Linux distributions up and running in Hyper-V?

The official list of supported operating systems on Hyper-V is available here: http://www.microsoft.com/windowsserver2008/en/us/hyperv-supported-guest-os.aspx.  While there are a ton of supported Operating Systems, you will notice only one supported Linux distro:

Linux Distributions (VMs configured with 1 virtual processor only)
  • SUSE Linux Enterprise Server 10 with Service Pack 2 x86 Edition

  • SUSE Linux Enterprise Server 10 with Service Pack 2 x64 Edition

  • SUSE Linux Enterprise Server 10 with Service Pack 1 x86 Edition

  • SUSE Linux Enterprise Server 10 with Service Pack 1 x64 Edition

Before we go any further, I want to clarify "supported" (and this is my own paraphrasing, not the Official Microsoft Support Policy).  Supported means that we have thoroughly tested a specific configuration.  If you have a problem, you can call up Microsoft Support, and we will troubleshoot and resolve the problem, and release a fix if necessary.  If the problem is with somewhere in SUSE, we can work with the fine folks at Novell to have a fix released on their end.  In other words, if you are running SUSE Linux Enterprise Server 10 on top of Hyper-V and encounter a problem, between Microsoft and Novell, we will support you. If you are running your company on Hyper-V virtualized instances of BeOS or Ubuntu… you do so at your own risk.  Is it because we hate BeOS or Ubuntu?  Heck No!  It’s just that we can’t do a whole lot to fix a problem when a linux kernel update breaks compatibility.  Can you imagine the slashdot story if we released updates to the Linux kernel?  Good grief!

<double-negative alert!>

Just because something isn’t "supported", however, doesn’t mean that it won’t work.

</double-negative alert!>

If you are running servers in a production environment, you want to be in a supported configuration (see above). If you are a an IT-Pro geek that just likes playing with things to see how they work, then you can throw caution to the wind and try things out that haven’t been tested :)  With that… let’s load a few distros up on Hyper-V!

(by the way, Hyper-V has a really cool "Capture screen" option that is awesome for taking screenshots 🙂

image

#1 OpenSuse 11

On Virtual PC 2007, OpenSuse 10.2 installed like a champ.  OpenSUSE 11 was somewhat touch-and-go.  On Hyper-V, OpenSUSE 11 installs and runs like a champ.  The following screenshots are all from the installation:

image image image

The only thing that did not work when I hit the desktop was the network adapter.  By default, Hyper-V uses a synthetic network adapter, which requires you load integration components.  From the read-me for the Linux integration components (downloadable from http://connect.microsoft.com):

When installed into a virtual machine running a supported Linux operating system, the Linux Integration components provide the following functionality:

· Driver support for synthetic devices: The Linux integration components include support for both the synthetic network controller and synthetic storage controller that have been developed specifically for Hyper-V. These components take advantage of the new high-speed bus, VMBus, which was developed specifically for Hyper-V.

· Hypercall adapter: The Hypercall adapter is a thin layer of software that sits underneath the Xen-enabled Linux kernel, and translates the Xen-specific virtualization function calls to Microsoft Hyper-V hypercalls. This results in faster performance for the Linux virtual machine.

· *BETA* Mouse Support: Support for the synthetic mouse device has been added in the form of an early “preview” driver. This new mouse support allows the mouse to move in and out of the window without having to use the CTRL-ALT-LEFTARROW key command to break out.

· *BETA* Fastpath Boot Support: Support for faster single disk configurations has been added to the RC2 release. Boot devices now take advantage of the storage VSC to provide enhanced performance.

In other words, it makes everything go faster.  I don’t know if these components only work with SUSE Linux Enterprise Server 10, but the read-me does mention that "Integration Components for Red Hat Enterprise Linux 5 will be available in a future update." 

The install procedure looked too complex for a Saturday evening, so I will give you the workaround that (should) work on all distributions, whether or not integration components are available.  Shut down the VM, go into the properties, and add a legacy network adapter. 

image

Once back in the running OS, I had to run the two following commands to get an IP address, and then networking worked fine:

sudo /sbin/ifconfig eth0 up

sudo /sbin/dhclient

The other thing that does not work is sound, but that is because Hyper-V is a server product, and in the datacenter, no-one can hear you beep.  With Windows, you can get sound by RDP-ing into the VM (steps courtesy of James O’Neill here), but beats the heck out of me how you might get it to work on Linux.  Other than that, OpenSUSE 11 works like a champ, with no wrangling needed to get it up and running.

image

#2 Ubuntu 8.04 x64

I’ve done a ton of installs of Ubuntu (for the last several versions) in Virtual PC 2007 here: http://blogs.technet.com/seanearp/search.aspx?q=ubuntu&p=1.  All have had varying levels of success, and all of them have required a ton of tweaking to get running.  In Hyper-V, install was a snap.  The only snag was the fact that Ubuntu defaulted to a screen resolution of 1600×1200, which was much larger than my physical monitor, so I had to scroll around quite a bit during initial setup.  Once I logged on, I was able to change the resolution through the GUI, and all was well.  As with OpenSUSE, requires the Legacy Network Adapter to be able to browse the Internet.

image

#3 Fedora 9 x64

You can read about my attempts to install various version of Fedora on Virtual PC 2007 here: http://blogs.technet.com/seanearp/search.aspx?q=fedora&p=1.  All of them have required tweaking to get things like the mouse to work or the kernel to boot.  On Hyper-V, Fedora 9 x64 installs (just like OpenSUSE and Ubuntu) with no problems at all.  Like Ubuntu, it defaulted to a strange screen resolution (1152×864), but I was able to change the resolution in the GUI with no problems.  Fedora x64 works just fine on Hyper-V as well!

Yaaaay.

image

I will leave you with a screenshot of the Hyper-V manager showing me running with a mix of 32-bit and 64-bit virtual machines, both Linux and Windows, and all working like a champ.  How’s this for the ultimate geek playground?!?!?  I can setup and tear down machines at will, play with them, and practice setting up networks, all on a quite-responsive Hypervisor.  Good times!

Remember… just because it isn’t supported, doesn’t mean it won’t work. (Just don’t call Microsoft looking for support 😉

image

Comments (31)

  1. Anonymous says:

    In the week or so since Hyper-V RTMed there has been a huge amount of coverage on various websites. Here&#39;s

  2. Anonymous says:

    How hard is it to get various Linux distributions up and running in Hyper-V? The official list of supported

  3. Anonymous says:

    I’ve mentioned this program a couple of times, and now on the Windows Server Catalog site we have a page

  4. Anonymous says:

    C’est, semble-t-il, un sujet qui vous int&#233;resse. J’ai d&#233;j&#224; commis quelques articles ici

  5. Anonymous says:

    The install went spectacularly well, but I cannot RDP into Linux (Ubuntu 8.04, 32 bit) on Hyper-V.  

    Can something be done in Linux so that I can simply connect with RDP the same as all my Windows VMs?

    I’m a complete newbie with Linux, but have done some windows scripting and written some C, so be as detailed as you like when replying 🙂

  6. Anonymous says:

    Unless you’ve been living in a hole for the past few days, or you’re seriously anti-Windows or simply not into your virtualisation at all, you’re probably aware that Hyper-V, the replacement for Virtual Server 2005, has gone "gold" (RTM). There’s all

  7. Anonymous says:

    How hard is it to get various Linux distributions up and running in Hyper-V? The official list of supported

  8. Anonymous says:

    Sean,

    I’m wondering if you got the mouse working in Hyper-V for Ubuntu…

  9. Anonymous says:

    Is it possible to run Linux distros (Ubuntu specifically) on a Hyper-V VM with 4 virtual processors?

  10. Anonymous says:

    In several locations it is mentioned that Linux is only supported on Hyper-V with a single virtual processor. I’m wondering what is meant by "supported" in this case – I’ve just installed CentOS 5.2 on Hyper-V with two virtual processors, and it appears to be using them quite happily.

    Is it that only one core works after installing the linux integration components? Or is it simply that muliple cores is untested?

    If installing the integration components will remove the ability to use multiple cores, I wonder if the performance gain is even worth it…

    Thanks!

  11. Anonymous says:

    I have installed Fedora 10 without problem.  It seems to run fine.  But I have no mouse support!?!

    Is there a trick to get the mouse to function?

    Thanks!

  12. Anonymous says:

    "Can you imagine the slashdot story if we released updates to the Linux kernel?  Good grief!"

    Yup, it would look something like this: http://news.slashdot.org/story/09/07/20/1643251/Microsoft-Releases-Linux-Device-Drivers-As-GPL

    It was even tagged with hellfrozeover.

  13. Anonymous says:

    Have you or anyone been able to get integration services working on Linux, I have installed Fedora and it works fine from what I can tell but I am doing all this remotely so I can not capture my mouse

  14. Anonymous says:

    Was there any trick to getting the mouse to work in ubuntu?  I can’t get it going with my VM.

  15. Anonymous says:

    To change the screen resolution of ubuntu at booting and login screen:

    Edit /boot/grub/menu.lst

    Find something like "kernel /boot/vmlinuz-2.6.15-26-386 root=/dev/hda5 ro quiet splash" near the EOF, then add "vga=791" after the line so it becomes "kernel /boot/vmlinuz-2.6.15-26-386 root=/dev/hda5 ro quiet splash vga=791"

    791 stands for 1024×768, 16-bit. 788 is 800×600 and 794 is 1280×1024.

    Edit /etc/X11/xorg.conf

    Find the "Screen" section, then add a "Display" subsection. The result looks like this:

    Section "Screen"

       Identifier    "Default Screen"

       Device        "YOUR_DEVICE_NAME"

       Monitor       "YOUR_MONITOR_NAME"

       DefaultDepth  16

       SubSection "Display"

           Depth       6

           Modes      "1024×768"

       EndSubSection

    EndSection

    After these two steps, the screen resolution should be normal.

  16. Anonymous says:

    Very nice article Sean.

    I was able to get Ubuntu 8 and Suse Enterprise 10 running in VMs. All is fine : network, mouse. Hyper-V says "Integration Services are offered" but there must be a trick : I can’t properly stop my VM. When doing so, Hyper-V complains that either Integration Services are not offered or the VM has not reached a state which can allow a proper stop.

    What’s your experience with this stop/shutdown integration ?

    Thanks!

    O.R.

  17. Anonymous says:

    Good post – I haven’t come across a distro which doesn’t work well on Hyper-V yet.

  18. Anthony says:

    How do you get arround the 137GB hard drive space limitation.  HyperV and Ubuntu seem to choose PATA as its drivers and is limited to 137GB.

  19. Gamer says:

    Can the VMs access the full potential a 3d accelerated video card?    I would like to play games on a windows VM and use compiz-fusion a Ubuntu VM.  Is that possible with HyperV ?

  20. Shaun says:

    Have you tried Fedora 14 in Hyper-V?  I'm looking at doing it at home in the near future.

  21. son says:

    Hyper-V don't support full with CentOS. i'm try setup but Hyper-v don't support Mouse hardware.

  22. wpg4665 says:

    Full CentOS 6.3 integration from what I can tell!

  23. ritesh says:

    I have installed Centos 6.3 in a Hyper-V VM and the screen resolution is set incorrectly. The GUI config screen doesn't have the full screen reolution my monitor is capable of displaying. Where can I change the configuration so that it can display the screen in full screen resolution (1680×1050)?

  24. Madhab says:

    EmailOcean is a brand new platform to cater to your email marketing needs.

    It provides promotional emailing at an amazingly low rate of $0.10 per 1000 emails. The customer only pay for what is utilised. The brilliance of EmailOcean lies in it making the process easier and faster for the customer,as compared to Amazon and Sendgrid, EmailOcean has a beautiful Web-app which makes creating and sending the campaign a lot more easier. Using this web-app one can also send and track their campaigns.

    As of now,the registrations are open by invitation but register yourself with the website and keep self updated as to when they are open to all or for your surprise invitation code.

    http://www.emailocean.com

  25. Owais says:

    You rock! This is exactly what I needed for internet to work.

    Thanks

  26. Eduardo Gonçalves says:

    Olá pessoal. Para quem tiver tendo dificuldades no Pós Instalação do Slackware linux 14.1 no hyper-v e o sistema realizar o primeiro boot a tela trava na seguinte mensagem de “Kernel panic – not syncing: VFS: Unable to mout root fs on unkown-block”, fiz
    um guia passo a passo em português de como corrigir isso:
    http://egoncalves.com.br/slackware/instalando-slackware-linux-14-1no-hyper-v-6-4-rodando-em-windows-10/

    Espero ter colaborado 🙂

  27. NetoMeter says:

    You can change the screen resolution in CentOS or Red Hat Hyper-V guests – that’s valid for both v6 and v7. Simply use the grubby tool and pass the video argument with the needed screen resolution to the Microsoft Hyper-V Synthetic Video Frame Buffer driver.
    The following short video demonstrates the process:

    http://www.netometer.com/blog/?p=1663