Deprecated - Microsoft quit updating vm tools in favor of WSL2, it's only a matter of time before this breaks untirely (if it isn't already).
Credits, the original guide which has strangely vanished but can still be found via wayback machine here
This is largely the same as the original but with some updates
- Setup a new machine in HyperV Manager. Make sure you choose 'Generation 2' and assign default switch for networking (or whatever other adapter you use). Then go to the new VM's settings, disable secure boot, and attach the manjaro iso to it (at the time of writing this, gnome doesn't work).
- Boot up the vm, you'll be meeting with a black screen or the cli will show it stopped around display starting or whatever. Drop into terminal with CTL + ALT+ F2.
- Login and type:
pacman -Sy && pacman -S xf86-video-fbdev
- Then restart the display manager:
systemctl restart lightdm
(sddm if on kde) - Now you'll be able to see the gui where you can run setup normally
- NOTE: SET A PASSWORD and DO NOT SET AUTOLOGIN, if you don't, you won't be able to login once this is all setup
- Once rebooting, you'll have to do the same thing as before to get the right graphics driver installed and the gui back. Once this is done:
sudo pacman -S git
git clone https://github.com/Microsoft/linux-vm-tools.git
cd linux-vm-tools/arch
sed -i "s/-devel-git//g" makepkg.sh
./makepkg.sh
sudo ./install-config.sh
sed -i "s/ --exit-with-session//" ~/.xinitrc
[ "$DESKTOP_SESSION" == "xfce" ] && sed -i 's/args+=("$1")/args+=(xfce4-session)/' .xinitrc
-
Now shutdown you vm, open admin powershell, and type:
Set-VM -VMName Your_Manjaro_VM -EnhancedSessionTransportType HvSocket
- Where
Your_Manjaro_VM
is the name of you vm
- Where
-
Reboot and you'll be prompted to login
-
Notes on the fixes above:
- the xorgxrdp package in makepkg needs changed to the regular repo
- removing --exit-with-session is a well documented fix
- When logging in with enhanced session, no DESKTOP_SESSION is set and so the wildcard entry in .xinitrc is triggered. For whatever reason, this part of the case statment is setup incorrectly in XFCE Manjaro edition (KDE is fine)
Hopefully but I wouldn't count on it. Microsoft's gone all in on WSL2 and is even adding support for GUI apps. Fine with me as performance is/will be generally better than in hyperv