Microsoft Remote Desktop On Linux



-->

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) and remote desktop (xrdp) for your Linux VM running Ubuntu.

Since Linux servers don’t have a pre-installed DE (Desktop Environment), an implementation of Microsoft RDP is used for providing a fully RDP-compatible experience. Therefore, a Debian RDP server is working with an open-source Remote Desktop Protocol server named XRDP. The xRDP is an open-source remote desktop protocol (RDP) server using by Linux operating systems. How to Remote Access Windows 10 via Ubuntu Linux? The process you need to apply for remote desktop configuration from Windows 10 to Linux Ubuntu and from Linux Ubtun to Windows 10. To install the RPM package on Fedora, run the following command. $ sudo dnf localinstall teamviewer.x8664.rpm. If you are running Arch Linux or Arch-derivatives, you can grab TeamViewer from AUR here. Once the installation is complete, launch the app. Accept the license agreement. TeamViewer is now ready to set up a remote desktop connection. Dec 22, 2019 Open Remote Desktop Connection Application Windows. Enter your Ubuntu machine IP. Then press the connect button to continue. Open Remote Desktop Connection Application Windows. You should get a warning message, and you can press Yes button to open the connection. Remote Desktop Warning Message.

The article was writen and tested using an Ubuntu 18.04 VM.

Prerequisites

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:

  • The Azure CLI
  • The Azure portal

Install a desktop environment on your Linux VM

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.

Linux

The following example installs the lightweight xfce4 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).

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.

Next, install xfce using apt as follows:

Install and configure a remote desktop server

Windows Remote Desktop On Linux

Now that you have a desktop environment installed, configure a remote desktop service to listen for incoming connections. xrdp 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:

Tell xrdp what desktop environment to use when you start your session. Configure xrdp to use xfce as your desktop environment as follows:

Restart the xrdp service for the changes to take effect as follows:

Set a local user account password

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:

Note

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.

Create a Network Security Group rule for Remote Desktop traffic

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? You can also use the Azure portal to create a network security group rule.

The following example creates a network security group rule with az vm open-port on port 3389. From the Azure CLI, not the SSH session to your VM, open the following network security group rule:

Connect your Linux VM with a Remote Desktop client

Open your local remote desktop client and connect to the IP address or DNS name of your Linux VM.

Enter the username and password for the user account on your VM as follows:

After authenticating, the xfce desktop environment will load and look similar to the following example:

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.

Troubleshoot

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:

The following example shows the VM listening on TCP port 3389 as expected:

If the xrdp-sesman service is not listening, on an Ubuntu VM restart the service as follows:

Review logs in /var/log on your Ubuntu VM for indications as to why the service may not be responding. You can also monitor the syslog during a remote desktop connection attempt to view any errors:

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.

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.

Next steps

For more information about creating and using SSH keys with Linux VMs, see Create SSH keys for Linux VMs in Azure.

For information on using SSH from Windows, see How to use SSH keys with Windows.

-->

This article shows how students can connect to a Linux virtual machine (VM) in a lab using:

  • SSH (secure shell protocol) terminal
  • GUI (graphical user interface) remote desktop

Microsoft Remote Desktop Download Pc

Important

Microsoft Remote Desktop On Linux Computer

SSH is configured automatically so that both students and the instructor can SSH into Linux VMs without any additional setup. However, if students need to connect to using a GUI remote desktop, the instructor may need to do additional setup. For details, see Enable remote desktop for Linux virtual machines.

Connect to the student VM using SSH

  1. When a student signs in to the Labs portal directly (https://labs.azure.com) or by using a registration link (https://labs.azure.com/register/<registrationCode>), a tile for each lab the student has access to is displayed.

  2. On the tile, toggle the button to start the VM if it's in stopped state.

  3. Select Connect. You see two options to connect to the VM: SSH and RDP.

  4. Select the SSH option and you will see the Connect to your virtual machine dialog box:

  5. Click the Copy button next to the text box to copy the SSH connection information to the clipboard.

  6. Save the SSH connection information, such as in Text pad, so that you can use this connection information in the next step.

  7. From an SSH terminal (like Putty), connect to your VM.

Connect to the student VM using GUI remote desktop

The instructor may choose to configure VMs so that students can also connect using a GUI remote desktop. In this case, students need to find out from their instructor whether to connect to their VMs using the Microsoft Remote Desktop (RDP) or X2Go client application. Both of these applications allow a student to connect remotely to their VM and display the Linux graphical desktop on their local computer.

Connect to the student VM using Microsoft Remote Desktop (RDP)

Students can use Microsoft Remote Desktop (RDP) to connect to their Linux VMs after their instructor sets up their lab with RDP and GUI packages for a Linux graphical desktop environment (such as MATE, XFCE, and so on). Here are the steps to connect:

  1. On the tile for your VM, ensure the VM is running and click Connect. You see two options to connect to the VM: SSH and RDP.

  2. Select the RDP option. When the RDP file is downloaded onto your machine, save it to your VM.

  3. If you are connecting from a Windows computer, typically, the Microsoft Remote Desktop (RDP) client is already installed and configured. As a result, all you need to do is click on the RDP file to open it and start the remote session.

    Instead, if you are connecting from either a Mac or Chromebook, refer to the following steps:

    • Connect to a VM using RDP on a Mac.
    • Connect to a VM using RDP on a Chromebook.

Connect to the student VM using X2Go

Students can use X2Go to connect to their Linux VMs after their instructor sets up their lab with X2Go and the GUI packages for a Linux graphical desktop environment (such as MATE, XFCE, and so on).

Students need to find out from their instructor which Linux graphical desktop environment their instructor has installed. This information is needed in the next steps to connect using the X2Go client.

  1. Install the X2Go client on your local computer.

  2. Follow the instructions in the first section to copy the SSH connection information for your VM. You need this information to connect using the X2Go client.

  3. Once you have the SSH connection information, open the X2Go client and select Session > New Session.

  4. Enter the values in the Session Preferences pane based on your SSH connection information. For example, your connection information will look similar to this:

    Using this example, the following values are entered:

    • Session name - Specify a name, such as the name of your VM.
    • Host - The ID of your VM; for example, ml-lab-00000000-0000-0000-0000-000000000000.eastus2.cloudapp.azure.com.
    • Login - The username for your VM; for example, student.
    • SSH port - The unique port assigned to your VM; for example, 12345.
    • Session type - Select the Linux graphical desktop environment that your instructor configured your VM. You need to get this information from your instructor.

    Finally, click OK to create the session.

  5. Click on your session in the right-hand pane.

    Note

    If you are prompted with a similar message to this, select yes to continue to entering your password: The authenticity of host '[00000000-0000-0000-0000-000000000000.eastus2.cloudapp.eastus.cloudapp.azure.com]:12345' can't be established. ECDSA key fingerprint is SHA256:00000000000000000000000000000000000000000000.Are you sure you want to continue connecting (yes/no)?

  6. When prompted, enter your password and click OK. You will now be remotely connected to your VM's GUI desktop environment.

Next steps

To learn how to enable the remote desktop connection feature for Linux VMs in a classroom lab, see Enable remote desktop for Linux virtual machines.