Can I use Hyper-V gen 2 with Ubuntu?

22,110

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:

Share:
22,110

Related videos on Youtube

user1623709
Author by

user1623709

Updated on September 18, 2022

Comments

  • user1623709
    user1623709 over 1 year

    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?

  • Martin Brown
    Martin Brown over 9 years
    I tried to set the resolution to 2160x1440 to match my Surface 3's screen. However this gives an out of range error on boot-up. Is there any way to get it to support resolutions this high? If not what is the maximum it will support?
  • Jan Henke
    Jan Henke over 9 years
    FullHD seems the maximum supported resolution right now. You can check the comment at the top of the Hyper-V frame-buffer driver file (git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/tre‌​e/…). It looks like a limitation of Hyper-V.