Freigeben über


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: https://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 https://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: https://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: https://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

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

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

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

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

  • Anonymous
    January 01, 2003
    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 :)

  • Anonymous
    January 01, 2003
    The comment has been removed

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

  • Anonymous
    January 01, 2003
    Sean, I'm wondering if you got the mouse working in Hyper-V for Ubuntu...

  • Anonymous
    January 01, 2003
    Is it possible to run Linux distros (Ubuntu specifically) on a Hyper-V VM with 4 virtual processors?

  • Anonymous
    January 01, 2003
    The comment has been removed

  • Anonymous
    January 01, 2003
    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!

  • Anonymous
    January 01, 2003
    "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.

  • Anonymous
    January 01, 2003
    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

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

  • Anonymous
    January 01, 2003
    The comment has been removed

  • Anonymous
    January 01, 2003
    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.

  • Anonymous
    January 01, 2003
    Good post - I haven't come across a distro which doesn't work well on Hyper-V yet.

  • Anonymous
    June 09, 2010
    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.

  • Anonymous
    July 15, 2010
    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 ?

  • Anonymous
    September 20, 2011
    Have you tried Fedora 14 in Hyper-V?  I'm looking at doing it at home in the near future.

  • Anonymous
    March 12, 2012
    Hyper-V don't support full with CentOS. i'm try setup but Hyper-v don't support Mouse hardware.

  • Anonymous
    December 13, 2012
    Full CentOS 6.3 integration from what I can tell!

  • Anonymous
    February 15, 2013
    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 (1680x1050)?

  • Anonymous
    June 14, 2013
    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. www.emailocean.com

  • Anonymous
    August 13, 2013
    You rock! This is exactly what I needed for internet to work. Thanks

  • Anonymous
    October 16, 2014
    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 :)

  • Anonymous
    March 04, 2015
    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