Skip to content

Instantly share code, notes, and snippets.

@nogweii
Last active July 14, 2017 17:08
Show Gist options
  • Star 7 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nogweii/c18a166197f1f1a03c74 to your computer and use it in GitHub Desktop.
Save nogweii/c18a166197f1f1a03c74 to your computer and use it in GitHub Desktop.
rough draft for why arch linux doesn't work with Gen2 HyperV machines

3 issues are present immediately when trying to install Archlinux in a Gen2 HyperV VM:

  1. Keyboard doesn't work. See http://www.gossamer-threads.com/lists/linux/kernel/1985855 for more details.
  2. The network doesn't work. See http://www.hurryupandwait.io/blog/running-an-ubuntu-guest-on-hyper-v-assigned-an-ip-via-dhcp-over-a-wifi-connection for more details.
  3. When you do try to do network operations, there are checksum errors. See http://forge.univention.org/bugzilla/show_bug.cgi?id=33160 for more details.

To solve the keyboard, you need to enable the SERIO_I8042 kernel module. Which won't autoload (when it's set to =M in Kconfig) as HyperV gen2 images don't virtualize any PS/2 devices. And due to a missing dependency, hyperv_keyboard.ko can't load without it. (https://bugs.archlinux.org/task/39820 for some more details.)

The network doesn't work at all, as the traffic isn't getting outside of the VM. This is the case with other Linux VMs, and isn't necessarily Arch's fault. Sharing the network connection fixes this.

The only fix I have found for #3 is to simply disable checksum offloading. Wireshark has a good tutorial.

Other references:

That all being said though, from HyperV's Generation 2 FAQ:

Is there a performance gain to generation 2 virtual machines?

In the daily running of a virtual machine, there is no performance difference between generation 1 and generation 2 virtual machines. You might see a slight improvement in virtual machine boot and installation times with generation 2 virtual machines.

So just make a generation 1 VM and be done with it! They work fine!

@JW0914
Copy link

JW0914 commented Jan 2, 2016

I could be wrong, but I do not believe it's possible to run SELinux on a Gen 1 VM. I prefer utilizing SELinux, however some may not... it's just something to be aware of.

@lf-
Copy link

lf- commented May 21, 2016

@JW0914 How does that work? SELinux doesn't even depend on specific hardware...

@vikas5914
Copy link

if you use quick create option in hyper-v, it will create Gen2 HyperV which works perfectly fine.

but if you use new->virutal machine and select Gen2 then the keyboard will not work.

@vikas5914
Copy link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment