How to setup xRDP for Ubuntu 20.04 in Windows Hyper-V?
Solution 1
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.
Solution 2
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!
Comments
-
VidathD over 1 year
I want to know how to setup xRDP for Ubuntu 20.04 in Windows Hyper-V? Tutorials for Ubuntu 18.04 doesn't seem to work. I am using the ISO that I downloaded.
These are the tutorials I used. They all basically say the same thing...
-
Jon Watte over 3 yearsThis almost works for me. I can see a login session with my name. When I mouse over the HyperV window, the Windows cursor is hidden. However, the cursor on the linux desktop does not move, and I cannot make it take click events. When I keep moving the mouse, the Windows cursor shows up again outside the window. I'm presumably missing some mouse driver module, but which one? The status icons on the bottom say "keyboard captured" and "mouse not captured," and I can't change them. Ctrl-Alt-Rightarrow does nothing.
-
rize over 3 yearsI'm working with sensitive data and so do you know about the security of this setup i.e. could this expose my VM to public internet or even my organisation network through RDP? Or is it just my local computer ie. host OS win 10?
-
Stefan Golubović over 3 yearsI would also add that it doesn't work well with the image from Quick Create. At least, it didn't work for me, and I'm not the only one.
-
JimLohse over 3 yearsI get to the final screenshot, login in and just get a black screen
-
VidathD over 3 years@JimLohse Do you have autologin enabled in Ubuntu during install
-
JimLohse over 3 yearsThanks, that was it. In LXQt had to edit the /etc/sddm.conf.d/autologin.conf file per askubuntu.com/a/1124789/471065 to turn off the auto-login
-
EM90 about 3 yearsCan't understand why, but this procedure doesn't work in my case. I followed every single step, but without any success.
-
VidathD about 3 years@EM90 Can you give some details as to "doesn't work"?
-
EM90 about 3 yearsYeah: I simply get a black screen (after inputing the login credential in the screen above) for 1 second (at most!), then the connection drops.
-
EM90 about 3 yearsFor the time being, I decided to get back to good old Ubuntu 18.04, which works great for my current needs... Though, if you can give me more insight, I'd be very grateful!
-
andrew pate almost 3 yearsI found I had hourly dropouts, doing the following seems to have cured it: hypervmanager->[yourvm]->hardware->network->hardware acceleration -> VMQ ... Set this to off . as mentioned here: dmunified.com/2016/05/16/…
-
Tim Wißmann almost 3 yearsFor some reason, xRDP was not able to start it's service after a reboot in my case. It showed an error message, that the address is already in use (or something like that). What fixed the problem was changing the port line in
/etc/xrdp/xrdp.ini
fromport=3389
toport=vsock://-1:3389
and settinguse_vsock=false
. -
VidathD almost 3 yearsUpvoted. I think Microsoft archived their repo 🤷♂️.