Linux on Hyper-V

Linux on Hyper-V

  • Comments 26
  • Likes

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 1600x1200, 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 (1152x864), 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
  • Good post - I haven't come across a distro which doesn't work well on Hyper-V yet.

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

  • 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

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

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

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

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

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

  • 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

  • Sean,

    I'm wondering if you got the mouse working in Hyper-V for Ubuntu...

  • 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 1024x768, 16-bit. 788 is 800x600 and 794 is 1280x1024.

    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      "1024x768"

       EndSubSection

    EndSection

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

  • 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.

  • 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!

  • 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!

  • 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 :)

Your comment has been posted.   Close
Thank you, your comment requires moderation so it may take a while to appear.   Close
Leave a Comment