Skip to content

Instantly share code, notes, and snippets.

@Zackptg5
Last active October 22, 2023 11:50
Show Gist options
  • Star 9 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • 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)
@MarcoGriep88
Copy link

Thanks man... Was wondering whats wrong with manjaro on hyper-v.

@Zackptg5
Copy link
Author

Zackptg5 commented Nov 6, 2021

No problem, looks like this is all EOL though. Microsoft is moving towards WSL2 which will allow GUI apps, the linux-vm-tools repo has been archived

@geistchevalier
Copy link

geistchevalier commented Nov 18, 2021

I'm writing this comment for those who are stuck at "Reached target Graphical Interface" (for version 21.1.6 ) and not that well versed with linux

If after running "systemctl restart lightdm" does nothing, you need to edit "~/.xinitrc" and then run "startx"

type (make sure you are not sudo)
nano ~/.xinitrc

look for the line
SESSION=${1:-xfce-session}

replace with
SESSION=${1:-xfce4-session}

and then look for another line like
*) dbus_args+=("$1")

and replace with
*) dbus_args+=("$SESSION")

press CTRL+X and then Y to save and exit

type the following and press enter
startx
and it should start the gui

referenced from this post https://forum.manjaro.org/t/manjaro-install-live-cd-stuck-at-reached-target-graphical-interface/62550/22

feel free to correct me if you think my information is not correct

@Zackptg5
Copy link
Author

The dbug_args is already addressed in the code section but I haven't needed to change the SESSION at all although this may be a new thing (haven't used hyperv in a while thanks to wsl2)

@geistchevalier
Copy link

The dbug_args is already addressed in the code section but I haven't needed to change the SESSION at all although this may be a new thing (haven't used hyperv in a while thanks to wsl2)

I was just trying out the different manjaro variants, 21.1.6 won't play ball with Hyper-V, maybe future versions will fix it

@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