How to setup RDP Support for Linux VM

Setup RDP Support for Linux VM

  1. Within the Azure Portal, locate the Virtual machine blade for your Linux VM. Then clicking Create button will give you a sample SSH command to use at the Bash Shell. Or, you can also retrieve the Public IP address from the Overview pane to type the command manually, or using a utility like PuTTy to connect.
    The SSH command will have the following syntax:
    ssh <username>@<ip address>
    	
  2. When using the SSH command, you’ll need to enter it into a bash shell on your local machine. This could be the “Ubuntu Bash Shell” on Windows 10, or a Terminal window on macOS.
  3. When prompted, enter the Username and Password what was specified for the Admin user when the Ubuntu Linux VM was created previously.
    Also, you’ll likely be prompted with an “Are you sure you want to continue connecting (yes/no)?” message. The reason for this is that your local machine hasn’t seen the key fingerprint from that Linux machine yet. For the sake of the exercise, type yes and press Enter to continue. Once you enter “yes”, you’ll need to enter the SSH command again to initiate the connection.
  4. Next, you’ll need to install a Desktop graphical UI (User Interface) before you’ll be able to setup RDP support. To do this, you can run the following command to install lxde on the Linux VM:
    sudo apt-get install lxde -y
    	

    If you’re interested in using the Ubuntu Desktop UI instead, you can use the great tips from Sorcia25 here: https://sorcia25.wordpress.com/2018/03/02/how-to-setup-an-ubuntu-linux-vm-in-azure-with-remote-desktop-rdp-access-ubuntu-desktop-gui/

  5. Next, you’re ready to install RDP support by installing the xrdp project on the VM. You can do this with the following command:
    sudo apt-get install xrdp -y
    	
  6. Next, you need to start xrdp running on the VM. This can be done with the following command:
    /etc/init.d/xrdp start
    	
  7. Next, before you can Remote Desktop into the Linux VM, you need to be sure to open port 3389on the Network Security Group (NSG) that is securing access to the VM within Azure. To do this, navigate to the Resource group blade for your VM, then click on the Network Security Groupresource.
  8. On the Network security group blade, click on the Inbound security rules link.
  9. Click the +Add button then fill in the following details for a new Inbound security rule to open port 3389, then click OK.
    1. Source: Any
    2. Source port ranges: *
    3. Destination: Any
    4. Destination port ranges: 3389
    5. Protocol: TCP
    6. Action: Allow

With RDP support installed on the Ubuntu Server Linux VM in Azure, and the NSG Firewall is open on Port 3389 to allow RDP connections, you are ready to use a Remote Desktop client to connect.

Did this answer your question? Thanks for the feedback There was a problem submitting your feedback. Please try again later.

Still need help? Contact Us Contact Us