You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: articles/virtual-machines/linux/use-remote-desktop.md
+14-8Lines changed: 14 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,10 +7,10 @@ ms.service: virtual-machines
7
7
ms.collection: linux
8
8
ms.workload: infrastructure-services
9
9
ms.topic: how-to
10
-
ms.date: 07/25/2022
10
+
ms.date: 03/28/2023
11
11
ms.author: mattmcinnes
12
-
13
12
---
13
+
14
14
# Install and configure xrdp to use Remote Desktop with Ubuntu
15
15
16
16
**Applies to:**:heavy_check_mark: Linux VMs :heavy_check_mark: Flexible scale sets
@@ -21,27 +21,29 @@ The article was written and tested using an Ubuntu 18.04 VM.
21
21
22
22
## Prerequisites
23
23
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:
24
+
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:
25
25
26
26
- The [Azure CLI](quick-create-cli.md)
27
27
- The [Azure portal](quick-create-portal.md)
28
28
29
29
30
30
## Install a desktop environment on your Linux VM
31
31
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.
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, however there are several desktop environments that you can choose to install. Depending on your choice of desktop environment, it will consume up to 2 GB of disk space and take up to ten minutes to both install and configure all the required packages.
33
33
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).
34
+
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).
35
35
36
36
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](ssh-from-windows.md).
43
44
44
-
Next, install xfce using `apt` as follows:
45
+
Next, install xfce using `apt` :
46
+
45
47
46
48
```bash
47
49
sudo apt-get update
@@ -50,7 +52,7 @@ sudo apt install xfce4-session
50
52
```
51
53
52
54
## 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:
54
56
55
57
```bash
56
58
sudo apt-get -y install xrdp
@@ -85,6 +87,7 @@ sudo passwd azureuser
85
87
> 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.
86
88
87
89
90
+
88
91
## Create a Network Security Group rule for Remote Desktop traffic
89
92
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).
## Connect your Linux VM with a Remote Desktop client
130
132
131
133
Open your local remote desktop client and connect to the IP address or DNS name of your Linux VM.
@@ -140,9 +142,11 @@ After authenticating, the xfce desktop environment will load and look similar to
140
142
141
143

142
144
145
+
143
146
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).
144
147
145
148
149
+
146
150
## Troubleshoot
147
151
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:
148
152
@@ -174,7 +178,9 @@ Other Linux distributions such as Red Hat Enterprise Linux and SUSE may have dif
174
178
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).
175
179
176
180
181
+
177
182
## Next steps
178
183
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).
179
184
180
185
For information on using SSH from Windows, see [How to use SSH keys with Windows](ssh-from-windows.md).
0 commit comments