3 issues are present immediately when trying to install Archlinux in a Gen2 HyperV VM:
- Keyboard doesn't work. See http://www.gossamer-threads.com/lists/linux/kernel/1985855 for more details.
- 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.
- 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:
- http://dynamict.se/2014/04/08/archlinux-and-hyper-v-3-0-generation-2-uefi-vm-troubles/
- http://dynamict.se/2014/04/08/archlinux-and-hyper-v-3-0-generation-2-uefi-vm-troubles-part-2/
- http://www.mail-archive.com/kvm@vger.kernel.org/msg41958.html
- https://bugs.launchpad.net/ubuntu/+source/isc-dhcp/+bug/930962
- https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1285434
- https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1292216
- https://bugs.archlinux.org/task/41135
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!
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.