Azure Linux Vm Remote Desktop



  1. Linux Vm Download
  2. Linux Vm Image
  3. Enable Remote Desktop Azure Vm

Installing Chrome Remote Desktop on the VM instance. The next step is to install Chrome Remote Desktop on the VM instance. In the SSH window connected to your VM instance, update the package manager data and install wget: sudo apt update sudo apt-get install -assume-yes wget Download the Debian Linux Chrome Remote Desktop installation package. What is Azure Remote Desktop Services? Azure Remote Desktop Services (RDS) is a VDI solution on Azure, which provides secure access to virtualized applications and desktops. RDS lets end users access their applications and desktops remotely on the cloud, via mobile and desktop devices.

The Enter-AzVM cmdlet starts an interactive session with a single Azure VM. During the session, the commands that you type are run on the Azure VM, just as if you were typing directly on the Azure VM’s PowerShell console. This is perfect for those real-time ad-hoc scenarios. Here's a typical scenario with Enter-AzVm to a Windows VM. Use SSH to connect to your Linux VM. The following example connects to the VM with FQDN mydtl1450000.eastus.cloudapp.azure.com, with the username of vmuser and port 51637. Enter the password for the user to connect to the VM.

-->

This article shows you how to do the following tasks:

  • Enable graphical remote desktop sessions for a Linux VM
  • How to connect to a Linux VM using RDP (Remote Desktop Protocol) or X2Go remote desktop clients

Set up graphical remote desktop solution

When a lab is created from a Linux image, SSH (Secure Shell) access is automatically configured so that the instructor can connect to the template VM from the command line using SSH. Likewise, when the template VM is published, students can also connect to their VMs using SSH.

To connect to a Linux VM using a GUI (graphical user interface), we recommend using either RDP or X2Go. Both of these options require the instructor to do some additional setup on the template VM:

RDP Setup

To use RDP, the instructor must:

  • Enable remote desktop connection; this is specifically needed to open the VM's port for RDP.
  • Install the RDP remote desktop server.
  • Install a Linux graphical desktop environment (such as MATE, XFCE, and so on).

X2Go Setup

To use X2Go, the instructor must:

  • Install the X2Go remote desktop server.
  • Install a Linux graphical desktop environment (such as MATE, XFCE, and so on).

X2Go uses the same port that is already enabled for SSH. As a result, no extra configuration required to open a port on the VM for X2Go.

Note

In some cases, such as with Ubuntu LTS 18.04, X2Go provides better performance. If you use RDP and notice latency when interacting with the graphical desktop environment, consider trying X2Go since it may improve performance.

Important

Some marketplace images already have a graphical desktop environment and remote desktop server installed. For example, the Data Science Virtual Machine for Linux (Ubuntu) already has XFCE and X2Go Server installed and configured to accept client connections.

Enable remote desktop connection for RDP

This step is only needed to connect using RDP. If instead you plan to use X2Go, you can skip to the next section since X2Go uses the SSH port.

Linux Vm Download

  1. During lab creation, the instructor has the option to Enable Remote Desktop Connection. The instructor must enable this option to open the port on the Linux VM that is needed for an RDP remote desktop session. Otherwise, if this option is left disabled, only the port for SSH is opened.

  2. On the Enabling Remote Desktop Connection message box, select Continue with Remote Desktop.

Install RDP or X2Go

After the lab is created, the instructor needs to ensure that a graphical desktop environment and remote desktop server are installed on the template VM. Instructors must first connect to the template VM using SSH to install the packages for:

  • Either the RDP or X2Go remote desktop server.
  • A graphical desktop environment, such as MATE, XFCE, etc.

After this is set up, the instructor can connect to the template VM using either the Microsoft Remote Desktop (RDP) client or X2Go client.

Follow the below steps to set up the template VM:

  1. If you see Customize template on the toolbar, select it. Then, select Continue on the Customize template dialog box. This action starts the template VM.

  2. After the template VM is started, you can select Connect template and then Connect via SSH on the toolbar.

  3. You see the following Connect to your virtual machine dialog box. Select the Copy button next to the text box to copy it to the clipboard. Save the SSH connection information. Use this connection information from an SSH terminal (like Putty) to connect to the virtual machine.

  4. Install either RDP or X2Go along with the graphical desktop environment of your choice. Refer to the following instructions:

Connect to the template VM via the GUI

Azure linux vm remote desktop

After the template VM is set up, the instructor can connect via the GUI using either the Microsoft Remote Desktop (RDP) client or X2Go client. The client that you use depends on if RDP or X2Go is configured as the remote desktop server on the template VM.

Microsoft Remote Desktop (RDP) client

The Microsoft Remote Desktop (RDP) client is used to connect to a template VM that has RDP configured. The Remote Desktop client can be used on Windows, Chromebooks, Macs and more. Refer to the article on Remote Desktop clients for further details.

Follow the below steps based on the type of computer used to connect to the template VM:

  • Windows

    1. Click Connect to template on your lab's toolbar and select Connect via RDP to connect to the template VM.
    2. Save the RDP file and use it to connect to the template VM using the Remote Desktop client.
    3. Typically, the Remote Desktop client is already installed and configured on Windows. As a result, all you need to do is click on the RDP file to open it and start the remote session.
  • Mac

    1. Click Connect to template on your lab's toolbar and then select Connect via RDP to save the RDP file.
    2. Then, refer to the how-to article Connect to a VM using RDP on a Mac.
  • Chromebook

    1. Click Connect to template on your lab's toolbar and then select Connect via RDP to save the RDP file.
    2. Then, refer to the how-to article Connect to a VM using RDP on a Chromebook.

X2Go client

The X2Go client is used to connect to a template VM that has X2Go configured. Using the template VM's SSH connection information, follow the steps in the how-to article Connect to a VM using X2Go.

Next steps

After an instructor sets up either RDP or X2Go on their template VM and publishes, students can connect to their VMs via the GUI remote desktop or SSH.

For more information, see:

-->

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.

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.

Server

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

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.

Azure

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:

Linux Vm Image

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.

Enable Remote Desktop Azure Vm

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