If like me, you RDP to VMs running in Hyper-V, XenServer or vSphere quite often and you run Ubuntu you likely want to remote to these VMs too. Every time I setup a new Linux VM, I set this up. I documented the manual process for my own purposes and I thought I’d share. There are alternatives to using RDP of course but this is for those of you who prefer it.
Enter sudo apt-get update and hit enter. When prompted enter suitable credentials.
Enter sudo apt-get install xrdp and hit enter. This will install xrdp the remote desktop agent.
Enter sudo apt-get install xfce4 and hit enter. This will install Xfce desktop environment.
Enter echo xfce4-session >~/.xsession and hit enter.
Enter sudo nano /etc/xrdp/startwm.sh and hit enter to modify the text file.
Remove the line . /etc/X11/Xsession and add the line startxfce4 and then hit ctrl+X and save the file.
Enter sudo service xrdp restart and hit enter.
Enter hostname -I and hit enter. Make a note of the IP address.
Enter sudo usermod -a -G tsusers <username> and hit enter. This will add your account to the tsusers group which by default is the group with rights to RDP to this machine. Repeat this for all accounts you wish to RDP to the box with.
Launch the RDP client on your Windows machine, Mac or whatever you use and Connect to the IP address from your Ubuntu VM.
Enter your account credentials. Remember the username is case sensitive and hit OK.
The desktop will look pretty different but you should be able to work with it.