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
+19-27Lines changed: 19 additions & 27 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -18,14 +18,17 @@ ms.author: mattmcinnes
18
18
19
19
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://www.xrdp.org/)) for your Linux VM running Ubuntu.
20
20
21
-
The article was written and tested using an Ubuntu 18.04 VM.
22
-
23
21
> [!NOTE]
24
22
> 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.
25
23
24
+
> [!IMPORTANT]
25
+
> Starting with Red Hat 9, xrdp is not supported anymore since it requires third party repositories, Red Hat has specific steps on how to enable this kind of access described [here](https://docs.redhat.com/en/documentation/red_hat_enterprise_linux/9/html/getting_started_with_the_gnome_desktop_environment/remotely-accessing-the-desktop-as-a-single-user_getting-started-with-the-gnome-desktop-environment)
26
+
26
27
## Prerequisites
27
28
28
-
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:
29
+
This article and steps provided were taken from testing Ubuntu 24.04 and SUSE Enterprise Linux 15.
30
+
31
+
If you need to create a VM, use one of the following methods:
29
32
30
33
- The [Azure CLI](quick-create-cli.md)
31
34
- The [Azure portal](quick-create-portal.md)
@@ -34,7 +37,7 @@ This article requires an existing Ubuntu 18.04 LTS or Ubuntu 20.04 LTS VM in Azu
34
37
35
38
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.
36
39
37
-
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).
40
+
The following example installs the lightweight [xfce4](https://www.xfce.org/) desktop environment on an Ubuntu VM.
38
41
39
42
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:
Now that you have a desktop environment installed, configure a remote desktop service to listen for incoming remote access connections. [xrdp](http://www.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:
61
+
Install all the required packages using `zypper` :
57
62
58
63
```bash
59
-
sudo apt-get -y install xrdp
64
+
sudo zypper in xorg-x11-server xterm xorg-x11-xauth xrdp ssl-cert xhost xclock
60
65
sudo systemctl enable xrdp
61
66
```
62
-
63
-
On Ubuntu 20, you need to give certificate access to an xrdp user:
67
+
### On Ubuntu 24, you need to give certificate access to an xrdp user:
64
68
65
69
```bash
66
70
sudo adduser xrdp ssl-cert
67
71
```
68
72
73
+
### The steps below apply to both distributions (Ubuntu 24 and SUSE Enterprise Linux 15)
74
+
69
75
Tell xrdp what desktop environment to use when you start your session. Configure xrdp to use xfce as your desktop environment as follows:
70
76
71
77
```bash
@@ -88,10 +94,6 @@ sudo passwd azureuser
88
94
> [!NOTE]
89
95
> 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.
90
96
91
-
92
-
93
-
94
-
95
97
## Create a Network Security Group rule for Remote Desktop traffic
96
98
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?](/azure/virtual-network/network-security-groups-overview) You can also [use the Azure portal to create a network security group rule](../windows/nsg-quickstart-portal.md).
97
99
@@ -146,14 +148,8 @@ After authenticating, the xfce desktop environment will load and look similar to
146
148
147
149

148
150
149
-
150
-
151
151
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).
152
152
153
-
154
-
155
-
156
-
157
153
## Troubleshoot
158
154
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:
159
155
@@ -180,12 +176,8 @@ Review logs in */var/log* on your Ubuntu VM for indications as to why the servic
180
176
tail -f /var/log/syslog
181
177
```
182
178
183
-
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.
184
-
185
179
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).
186
180
187
-
188
-
189
181
## Next steps
190
182
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).
0 commit comments