Can I use Hyper-V gen 2 with Ubuntu?

I tried to install Ubuntu 13.10 on my Windows 8.1 Pro laptop. Now installing it as a gen 1 works fine but installing it as a gen 2 does not. I have to disable secure boot to get anything to happen which is expected but when I disable it i just get into grub version 2 with a couple options. No matter which i choose I get a blank screen and nothing happens. am I doing something wrong or am I missing any steps or is Hyper-v not going to be able to run Ubuntu as a gen 2 virtual machine?


Solution 1:

For the sake of completeness. 14.04 works on Hyper-V generation 2. Among other things kernel version 3.13 is required for generation 2. I am using it myself and it works nicely.

You might want to set the screen resolution manually though, as mode setting in the usual way is not yet supported by the hyperv_fb kernel module.

This can be archived by opening the file /etc/default/grub with the editor of your choice as root. Then edit the line

GRUB_CMDLINE_LINUX=""

to read

GRUB_CMDLINE_LINUX="video=hyperv_fb:[width]x[height]"

replacing [width] and [height] with the desired values. For example for FullHD resolution I use

GRUB_CMDLINE_LINUX="video=hyperv_fb:1920x1080"

to apply the new settings run afterwards in a terminal window

sudo update-grub

and restart the the guest system. The next time your guest Linux should have the desired resolution.

Solution 2:

Yes you can!

There is only one thing you need to know: Secure Boot has to be disabled. Hyper-V enables secure boot by default so if you just click through the wizard to create a VM it will not work. You have to disable Secure Boot. You can do so by changing the Settings of the virtual machine with the Hyper-V Manager. Under Firmware is an option for Secure Boot.

http://social.technet.microsoft.com/wiki/contents/articles/24545.installing-ubuntu-14-04-lts-as-a-generation-2-hyper-v-guest.aspx

Solution 3:

As noted in the discussion in the following blog post by one of the PM's working on Hyper-V it doesn't look like the current Linux distros support Hyper-V gen2.

Linux support is being worked on. It doesn't require any changes in Hyper-V, rather in the set of LIS components, plus some kernel changes to support the appropriate devices.

Cheers,

John.

Reference:

  • http://blogs.technet.com/b/jhoward/archive/2013/10/24/hyper-v-generation-2-virtual-machines-part-1.aspx#3605153