How to setup xRDP for Ubuntu 20.04 in Windows Hyper-V?
Apparently Microsoft haven't added support for 20.04 yet. There is a pull request on GitHub but it is yet to be merged. However, you can use it.
To set up xRDP for Ubuntu 20.04 LTS,
-
Disable "Auto Login" if you enabled it.
-
Open a terminal and issue the following commands.
wget https://raw.githubusercontent.com/Hinara/linux-vm-tools/ubuntu20-04/ubuntu/20.04/install.sh sudo chmod +x install.sh sudo ./install.sh
-
After you’ve run your scripts, shut down your VM. On your host machine in an Administrator PowerShell prompt, execute this command:
Set-VM -VMName <your_vm_name> -EnhancedSessionTransportType HvSocket
-
Start your virtual machine and connect. You will be greeted with a connection prompt windows that asks for a screen resolution--this will indicate that everything is installed correctly.
-
This will take you to a Xorg login. This indicates that you've successfully brokered a connection and that the xrdp service is running. Login to begin your session.
I would like to add an additional step to Sasuke Uchiha's great post:
After finishing step#2, the VM terminal will prompt you to reboot the VM which can be done by simply $reboot
.
Doing so will put the VM in a "saved" state which will require you to turn it back on by pressing "start".
After the reboot, go back to your VM terminal and run the third command once again to finish the installation process OR THE REST OF THE STEPS WILL NOT WORK!!!
sudo ./install.sh
You will know that the installation has completed successfully when you see the following:
Install is complete. Reboot your machine to begin using XRDP.
Big props to Sasuke and Hinara for carrying Microsoft's lack of quick-PR-merge weight!