Skip to content

Commit be8f670

Browse files
Merge pull request #2370 from mabicca/patch-8
Revise remote desktop setup for Ubuntu 24.04 and SUSE
2 parents a60c33f + e1e3f0c commit be8f670

File tree

1 file changed

+19
-27
lines changed

1 file changed

+19
-27
lines changed

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

Lines changed: 19 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,17 @@ ms.author: mattmcinnes
1818

1919
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.
2020

21-
The article was written and tested using an Ubuntu 18.04 VM.
22-
2321
> [!NOTE]
2422
> 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.
2523
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+
2627
## Prerequisites
2728

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:
2932

3033
- The [Azure CLI](quick-create-cli.md)
3134
- 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
3437

3538
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.
3639

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.
3841

3942
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:
4043

@@ -44,28 +47,31 @@ ssh [email protected]
4447

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

47-
Next, install xfce using `apt` :
50+
### For Ubuntu 24.04
51+
52+
Install all the required packages using `apt` :
4853

4954
```bash
50-
sudo apt-get update
51-
sudo DEBIAN_FRONTEND=noninteractive apt-get -y install xfce4
52-
sudo apt install xfce4-session
55+
sudo apt update
56+
sudo apt install xfce4 xfce4-session xrdp
57+
sudo systemctl enable xrdp
5358
```
59+
### For SUSE Enterprise Linux 15
5460

55-
## Install and configure a remote desktop server
56-
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` :
5762

5863
```bash
59-
sudo apt-get -y install xrdp
64+
sudo zypper in xorg-x11-server xterm xorg-x11-xauth xrdp ssl-cert xhost xclock
6065
sudo systemctl enable xrdp
6166
```
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:
6468

6569
```bash
6670
sudo adduser xrdp ssl-cert
6771
```
6872

73+
### The steps below apply to both distributions (Ubuntu 24 and SUSE Enterprise Linux 15)
74+
6975
Tell xrdp what desktop environment to use when you start your session. Configure xrdp to use xfce as your desktop environment as follows:
7076

7177
```bash
@@ -88,10 +94,6 @@ sudo passwd azureuser
8894
> [!NOTE]
8995
> 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.
9096
91-
92-
93-
94-
9597
## Create a Network Security Group rule for Remote Desktop traffic
9698
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).
9799

@@ -146,14 +148,8 @@ After authenticating, the xfce desktop environment will load and look similar to
146148

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

149-
150-
151151
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).
152152

153-
154-
155-
156-
157153
## Troubleshoot
158154
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:
159155

@@ -180,12 +176,8 @@ Review logs in */var/log* on your Ubuntu VM for indications as to why the servic
180176
tail -f /var/log/syslog
181177
```
182178

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-
185179
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).
186180

187-
188-
189181
## Next steps
190182
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).
191183

0 commit comments

Comments
 (0)