Skip to content

Commit c34f933

Browse files
Merge pull request #232476 from mattmcinnes/docs-editor/use-remote-desktop-1680034914
Update use-remote-desktop.md
2 parents 29db230 + 262df7f commit c34f933

File tree

1 file changed

+29
-17
lines changed

1 file changed

+29
-17
lines changed

articles/virtual-machines/linux/use-remote-desktop.md

Lines changed: 29 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -7,41 +7,43 @@ ms.service: virtual-machines
77
ms.collection: linux
88
ms.workload: infrastructure-services
99
ms.topic: how-to
10-
ms.date: 07/25/2022
10+
ms.date: 03/28/2023
1111
ms.author: mattmcinnes
12-
1312
---
13+
1414
# Install and configure xrdp to use Remote Desktop with Ubuntu
1515

1616
**Applies to:** :heavy_check_mark: Linux VMs :heavy_check_mark: Flexible scale sets
1717

18-
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](https://www.xfce.org)) and remote desktop ([xrdp](http://xrdp.org)) for your Linux VM running Ubuntu.
18+
When new to Linux, or for quick troubleshooting scenarios, the use of remote desktop may be easier than Secure Shell (SSH) access. This article details how to install and configure a desktop environment ([xfce](https://www.xfce.org)) and remote desktop ([xrdp](http://xrdp.org)) for your Linux VM running Ubuntu.
1919

2020
The article was written and tested using an Ubuntu 18.04 VM.
2121

22+
> [!NOTE]
23+
> Using Remote Desktop over the internet will introduce noticeable "lag" (input latency) when compared to local desktop use. This can be influenced by multiple factors including local internet speed and distance from the datacenter where the virtual machine is hosted. This lag does not usually reflect the performance of the VM itself.
24+
2225
## Prerequisites
2326

24-
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:
27+
This article requires an existing Ubuntu 18.04 LTS or Ubuntu 20.04 LTS VM in Azure. If you need to create a VM, use one of the following methods:
2528

2629
- The [Azure CLI](quick-create-cli.md)
2730
- The [Azure portal](quick-create-portal.md)
28-
29-
31+
3032
## Install a desktop environment on your Linux VM
3133

32-
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.
34+
Most Linux VMs in Azure don't have a desktop environment installed by default. Linux VMs are commonly managed using SSH connections rather than a desktop environment, however there are several desktop environments that you can choose to install. Depending on your choice of desktop environment, it consumes up to 2 GB of disk space and take up to ten minutes to both install and configure all the required packages.
3335

34-
The following example installs the lightweight [xfce4](https://www.xfce.org/) 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).
36+
The following example installs the lightweight [xfce4](https://www.xfce.org/) desktop environment on an Ubuntu 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).
3537

3638
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:
3739

3840
```bash
3941
4042
```
4143

42-
If you are using Windows and need more information on using SSH, see [How to use SSH keys with Windows](ssh-from-windows.md).
44+
If you're using Windows and need more information on using SSH, see [How to use SSH keys with Windows](ssh-from-windows.md).
4345

44-
Next, install xfce using `apt` as follows:
46+
Next, install xfce using `apt` :
4547

4648
```bash
4749
sudo apt-get update
@@ -50,14 +52,15 @@ sudo apt install xfce4-session
5052
```
5153

5254
## Install and configure a remote desktop server
53-
Now that you have a desktop environment installed, configure a remote desktop service to listen for incoming connections. [xrdp](http://xrdp.org) 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:
55+
Now that you have a desktop environment installed, configure a remote desktop service to listen for incoming remote access connections. [xrdp](http://xrdp.org) 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:
5456

5557
```bash
5658
sudo apt-get -y install xrdp
5759
sudo systemctl enable xrdp
5860
```
5961

60-
On Ubuntu 20, you'll need to give certificate access to an xrdp user:
62+
On Ubuntu 20, you need to give certificate access to an xrdp user:
63+
6164
```bash
6265
sudo adduser xrdp ssl-cert
6366
```
@@ -75,7 +78,7 @@ sudo service xrdp restart
7578
```
7679

7780
## Set a local user account password
78-
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*:
81+
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 don't have a local account password set, specify a password before you use xrdp to log in to your VM. xrdp can't accept SSH keys for authentication. The following example specifies a password for the user account *azureuser*:
7982

8083
```bash
8184
sudo passwd azureuser
@@ -85,6 +88,9 @@ sudo passwd azureuser
8588
> 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.
8689
8790

91+
92+
93+
8894
## Create a Network Security Group rule for Remote Desktop traffic
8995
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?](../../virtual-network/network-security-groups-overview.md) You can also [use the Azure portal to create a network security group rule](../windows/nsg-quickstart-portal.md).
9096

@@ -125,7 +131,6 @@ Add-AzNetworkSecurityRuleConfig @params | Set-AzNetworkSecurityGroup
125131
```
126132

127133
---
128-
129134
## Connect your Linux VM with a Remote Desktop client
130135

131136
Open your local remote desktop client and connect to the IP address or DNS name of your Linux VM.
@@ -140,11 +145,16 @@ After authenticating, the xfce desktop environment will load and look similar to
140145

141146
![xfce desktop environment through xrdp](./media/use-remote-desktop/xfce-desktop-environment.png)
142147

148+
149+
143150
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](https://www.freerdp.com).
144151

145152

153+
154+
155+
146156
## Troubleshoot
147-
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:
157+
If you can't 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:
148158

149159
```bash
150160
sudo netstat -plnt | grep rdp
@@ -157,7 +167,7 @@ tcp 0 0 127.0.0.1:3350 0.0.0.0:* LISTEN 53192/xrdp-sesm
157167
tcp 0 0 0.0.0.0:3389 0.0.0.0:* LISTEN 53188/xrdp
158168
```
159169

160-
If the *xrdp-sesman* service is not listening, on an Ubuntu VM restart the service as follows:
170+
If the *xrdp-sesman* service isn't listening, on an Ubuntu VM restart the service as follows:
161171

162172
```bash
163173
sudo service xrdp restart
@@ -171,10 +181,12 @@ tail -f /var/log/syslog
171181

172182
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.
173183

174-
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](/troubleshoot/azure/virtual-machines/troubleshoot-app-connection).
184+
If you don't receive any response in your remote desktop client and don't see any events in the system log, this behavior indicates that remote desktop traffic can't 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](/troubleshoot/azure/virtual-machines/troubleshoot-app-connection).
185+
175186

176187

177188
## Next steps
178189
For more information about creating and using SSH keys with Linux VMs, see [Create SSH keys for Linux VMs in Azure](mac-create-ssh-keys.md).
179190

180191
For information on using SSH from Windows, see [How to use SSH keys with Windows](ssh-from-windows.md).
192+

0 commit comments

Comments
 (0)