Microsoft Remote Desktop Ubuntu 18.04



Want to connect to Ubuntu desktop from your Windows 10 machine via remote desktop connection? Well, it’s possible with xrdp opensource tool..

  1. Microsoft Remote Desktop Client Ubuntu 18.04
  2. Install Remote Desktop On Ubuntu

In most cases, VNC server and other opensource remote connection tools are the only options available to Linux users… You don’t see tool supporting Microsoft Remote Desktop Connction (RDP) protocols to connect to Linux desktop… The only tool that gets this done is xrdp..

xrdp is an open source remote desktop protocol server which uses RDP to present a GUI to the client. It provides a fully functional Linux terminal server, capable of accepting connections from rdesktop, freerdp, and Microsoft’s own terminal server / remote desktop clients.

This brief tutorial is going to show students and new users how to using Windows own remote desktop connection protocol to connect to Ubuntu 16.04 / 17.10 and 18.04 desktops

When you’re ready, follow the steps below to get it working…

Screen sharing is baked into the operating system if you’re using the latest version of Ubuntu (18.04), so you just need to download and install remote desktop software on the computer you want. I think I am asking a old question for a newer version of Ubuntu 18.04 LTS. I have done my research for past 2 weeks and I didn't find a single blog or guide in SoF or any other source with a working solution to use Windows RDP to access an Ubuntu session. I have minutely followed this answer: Can I access Ubuntu from Windows remotely? In today’s guide, we will use Window’s native RDP client to remote connect into your local WSL2 Ubuntu on the same machine. (when is the last time you RDP into localhost? And the destination is also running in Linux, not Windows) This never happened to me until just recently. This brief tutorial shows students and new users how to remotely access Ubuntu 18.04 LTS desktop from Windows or other Linux machines using VNC protocol and clients Although Remote Desktop Connections isn’t enabled for Linux systems, Windows users may use other protocols like VNC to connect to Ubuntu desktop.

Step 1: Install Xrdp Server

To get Ubuntu desktop accepting RDP connections, you must first install and enable Xrdp tool… to do that, run the commands below

After running the commands below, logout or reboot your desktop.

Step 2: Connect from Windows 10

Now that Xrdp server is installed, go and open Windows Remote Desktop Connection app and connect to the server IP or hostname…

Then click Connect to initiate the connection to Xrdp… you should be warned about Windows not trusting the computer you’re conneting to… Accept and continue to connect anyway..

Next, type in your Ubuntu machine account username and password and connect using Xorg session

When your accout username and password are confirmed, you should be logon to your Ubuntu machine from Windows… as shown in the image below

That’s it!

You are now connected to your Ubuntu desktop from Windows using Microsoft own remote desktop connection protocol (RDP)… The graphic isn’t great, but good enough to get your work done.

Update

I have read all the comments below… and tried again was successfull… Here’s the trick..

  1. Make sure you’re not already logged on to the Ubuntu desktop… best thing is to restart and don’t logon
  2. If you try Xorg session and it quickly disconnect… select the X11rdp from the drop-down list.. it will hang and not fully logon… close the session and try the Xorg session again… that time it will work… but keep prompting you to authenticate… you can cancel the prompt windows…
  3. Restart again if step two doesn’t work right away..

Enjoy!

You should also like the post below:

-->

Linux virtual machines (VMs) in Azure are usually managed from the command line using a secure shell (SSH) connection. When new to Linux, or for quick troubleshooting scenarios, the use of remote desktop may be easier. This article details how to install and configure a desktop environment (xfce) and remote desktop (xrdp) for your Linux VM running Ubuntu.

The article was writen and tested using an Ubuntu 18.04 VM.

Prerequisites

This article requires an existing Ubuntu 18.04 LTS VM in Azure. If you need to create a VM, use one of the following methods:

  • The Azure CLI
  • The Azure portal

Install a desktop environment on your Linux VM

Most Linux VMs in Azure do not have a desktop environment installed by default. Linux VMs are commonly managed using SSH connections rather than a desktop environment. There are various desktop environments in Linux that you can choose. Depending on your choice of desktop environment, it may consume one to 2 GB of disk space, and take 5 to 10 minutes to install and configure all the required packages.

The following example installs the lightweight xfce4 desktop environment on an Ubuntu 18.04 LTS VM. Commands for other distributions vary slightly (use yum to install on Red Hat Enterprise Linux and configure appropriate selinux rules, or use zypper to install on SUSE, for example).

First, SSH to your VM. The following example connects to the VM named myvm.westus.cloudapp.azure.com with the username of azureuser. Use your own values:

If you are using Windows and need more information on using SSH, see How to use SSH keys with Windows.

Next, install xfce using apt as follows:

Install and configure a remote desktop server

Ubuntu remote desktop not working

Now that you have a desktop environment installed, configure a remote desktop service to listen for incoming connections. xrdp is an open source Remote Desktop Protocol (RDP) server that is available on most Linux distributions, and works well with xfce. Install xrdp on your Ubuntu VM as follows:

Tell xrdp what desktop environment to use when you start your session. Configure xrdp to use xfce as your desktop environment as follows:

Restart the xrdp service for the changes to take effect as follows:

Set a local user account password

If you created a password for your user account when you created your VM, skip this step. If you only use SSH key authentication and do not have a local account password set, specify a password before you use xrdp to log in to your VM. xrdp cannot accept SSH keys for authentication. The following example specifies a password for the user account azureuser:

Note

Specifying a password does not update your SSHD configuration to permit password logins if it currently does not. From a security perspective, you may wish to connect to your VM with an SSH tunnel using key-based authentication and then connect to xrdp. If so, skip the following step on creating a network security group rule to allow remote desktop traffic.

Create a Network Security Group rule for Remote Desktop traffic

To allow Remote Desktop traffic to reach your Linux VM, a network security group rule needs to be created that allows TCP on port 3389 to reach your VM. For more information about network security group rules, see What is a network security group? You can also use the Azure portal to create a network security group rule.

The following example creates a network security group rule with az vm open-port on port 3389. From the Azure CLI, not the SSH session to your VM, open the following network security group rule:

Connect your Linux VM with a Remote Desktop client

Open your local remote desktop client and connect to the IP address or DNS name of your Linux VM.

Enter the username and password for the user account on your VM as follows:

After authenticating, the xfce desktop environment will load and look similar to the following example:

If your local RDP client uses network level authentication (NLA), you may need to disable that connection setting. XRDP does not currently support NLA. You can also look at alternative RDP solutions that do support NLA, such as FreeRDP.

Troubleshoot

If you cannot connect to your Linux VM using a Remote Desktop client, use netstat on your Linux VM to verify that your VM is listening for RDP connections as follows:

The following example shows the VM listening on TCP port 3389 as expected:

If the xrdp-sesman service is not listening, on an Ubuntu VM restart the service as follows:

Review logs in /var/log on your Ubuntu VM for indications as to why the service may not be responding. You can also monitor the syslog during a remote desktop connection attempt to view any errors:

Other Linux distributions such as Red Hat Enterprise Linux and SUSE may have different ways to restart services and alternate log file locations to review.

If you do not receive any response in your remote desktop client and do not see any events in the system log, this behavior indicates that remote desktop traffic cannot reach the VM. Review your network security group rules to ensure that you have a rule to permit TCP on port 3389. For more information, see Troubleshoot application connectivity issues.

Next steps

Microsoft Remote Desktop Client Ubuntu 18.04

For more information about creating and using SSH keys with Linux VMs, see Create SSH keys for Linux VMs in Azure.

Install Remote Desktop On Ubuntu

For information on using SSH from Windows, see How to use SSH keys with Windows.