Enable graphical remote desktop for Linux virtual machines in Azure Lab Services
Artikkeli
Tärkeä
Azure Lab Services will be retired on June 28, 2027. For more information, see the retirement guide.
When you create a lab from a Linux image, Azure Lab Services automatically enables Secure Shell (SSH). A lab creator can connect to the template virtual machine (VM) from the command line. After you publish the template VM, students can also connect to their VMs using SSH.
To connect to a Linux VM using a GUI, there are more steps to set up in the template VM. The steps vary based on the distribution, version, GUI desktop environment, and remote desktop technology that you choose to use with Azure Lab Services. This article shows how to set up common GUI desktops with Ubuntu 20.04/22.04 LTS using either Remote Desktop Protocol (RDP) or X2Go.
Huomautus
Linux uses an open-source version of RDP called Xrdp. For simplicity, we use the term RDP throughout this article.
Performance
Performance over a remote desktop connection varies by distribution, version, GUI desktop, and the remote desktop technology used. For example, you might notice latency over a remote desktop connection when using a resource intensive GUI desktop like GNOME and RDP. A light-weight GUI desktop like XFCE or X2Go tends to have better performance. To optimize performance, you should consider using:
Another option to consider is nested virtualization. Students can connect to a Windows lab host VM using RDP, and then use Linux on nested VMs. This approach might help improve performance.
There are several distributions/versions and GUI desktops that can be used with Azure Lab Services. This section shows how to set up a lab's template VM with the following common configurations:
For optimal performance, we recommend using XFCE with X2Go for remote desktop connection. The lab creator must perform the following steps on the lab template VM:
Install the XFCE GUI desktop
Install the X2Go remote desktop server
X2Go uses the same port as SSH (22), which is enabled by default when you create a lab. The following steps show how to set up XFCE and X2Go.
xUbuntu is another light-weight GUI desktop that can be used with X2Go for remote desktop connection. However, to optimize performance, you need to disable windows compositing. The lab creator must perform the following steps on the lab template VM:
Install the xUbuntu GUI desktop
Install the X2Go remote desktop server
Disable windows compositing
X2Go uses the same port as SSH (22), which is enabled by default when you create a lab. The following steps show how to set up xUbuntu and X2Go.
The MATE GUI desktop can also be used with X2Go for remote desktop connection. The lab creator must perform the following steps on the lab template VM:
Install the MATE GUI desktop
Install the X2Go remote desktop server
X2Go uses the same port as SSH (22), which is enabled by default when you create a lab. The following steps show how to set up MATE and X2Go.
GNOME is a more resource intensive desktop that requires RDP for remote desktop connection. The lab creator must perform the following steps:
Enable the Client connection (RDP) setting during lab creation.
On the template VM:
Install the GNOME GUI desktop
Install the RDP remote desktop server
Update RDP performance related settings
RDP uses port 3389 for connecting to a VM. By default, Linux lab VMs only have the SSH port 22 enabled. The following steps show how to enable port 3389 and how to set up GNOME and RDP.
During lab creation, use the Enabled connection types settings to select the Client connection (RDP) setting. You must enable this option to open the port on the Linux VM that is needed for an RDP remote desktop session. If this option is left disabled, only the port for SSH is open. The enabled ports can't be changed after a lab is created.
On the Enable Remote Desktop Connection message box, select Continue with Remote Desktop.
On the template VM, use the following ReadMe and script to install the GNOME GUI desktop, install the RDP server, and make RDP performance optimizations:
Azure Virtual Desktop on Microsoft Azure is a desktop and app virtualization service that runs on the cloud. Azure Virtual Desktop works across devices – including Windows, Mac, iOS, and Android – with full-featured apps that you can use to access remote desktops and apps.