I figured out the super slow booting issue on HyperV, there are some missing kernel patches. I made a prototype NixOS boot image with them. All I did was use Microsoft’s fork of the linux kernel and built it in a NixOS boot image. I never bisected the exact relevant commits, however looking at Microsoft’s commit history, one can make an educated guess.
If someone knows how to build an Ubuntu installer image with a customer kernel, I think it should work. Here is my experiment: GitHub - starside/Nix-On-Hyper-V-Gen-2-X-Elite: Nix derivation to build iso installer that will run on Windows 11 Hyper V. Uses the Microsoft Linxus WSL2 kernel 6.6.
If you try this, I noticed the installer image works fine, but the installed image does not. It is possible to get a fully functioning install by using the installer to install Nix, then manually install the custom kernel.
I’d rather install Ubuntu, but I used nix because its so easy to make a custom installer.