Skip to content

Instantly share code, notes, and snippets.

@Zackptg5
Last active September 12, 2024 07:04
Show Gist options
  • Save Zackptg5/82e0b717f37da5bb87d5458cc0d793ad to your computer and use it in GitHub Desktop.
Save Zackptg5/82e0b717f37da5bb87d5458cc0d793ad to your computer and use it in GitHub Desktop.
Manjaro HyperV Install Guide

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
  • 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)
@Zackptg5
Copy link
Author

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

@YuJin44
Copy link

YuJin44 commented Nov 29, 2021

does not work with KDE, when trying to install xf86-video-fbdev it sais that it is interfering with the xorg-server so xorg-server needs to be uninstalled and asks me if I want to do that. Answering with yes fails to uninstall it, because sddm depends on it, saying no fails to install xf86-video-fbdev because of the mentioned interference.

@mtoldfield
Copy link

I have hit the same issue as @YuJin44 with the XFCE build.

Running Hyper-V on Windows 11 using the latest manjaro-xfce-21.1.6-211017-linux513.iso, when I attempt to install xf86-video-fbdev, it attempts to install xf86-video-fbdev-0.5.0-3 which requires removal of xorg-server. As a result, running systemctl restart lightdm does seemingly nothing as there is no X server installed any more.

@TimurKazimirov
Copy link

I use Manjaro KDE Plasma on Hyper-V (Windows Server 2019) for about an year. All worked fine. But recently after updates the graphical environment does not start after rebooting. If I swithch to console (Ctrl-Alt-F2) and run startx all graphics load normally. No errors are presented in journalctl -b
If I run systemctl status sddm it shows that sddm loaded and running. What's happened? What I need to correct?

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