Share via

VM_GUI_Connect_problem

Sam Rabinovich 0 Reputation points
2026-03-03T17:41:12.5366667+00:00

Having problems getting access to ubuntu VM's GUI via SSH or RDP

Azure Virtual Machines
Azure Virtual Machines

An Azure service that is used to provision Windows and Linux virtual machines.

0 comments No comments
{count} votes

3 answers

Sort by: Most helpful
  1. Nikhil Duserla 9,685 Reputation points Microsoft External Staff Moderator
    2026-03-11T05:34:46.7066667+00:00

    Hello @Sam Rabinovich ,Are you looking for assistance accessing a Linux VM in Azure?

    The most common method to access a Linux VM is through the Secure Shell (SSH) protocol. You can open a CLI/terminal on your local machine and use the following command:

    ssh <username>@<public-ip-of-your-vm>
    

    Please replace <username> and <public-ip-of-your-vm> with the appropriate values for your virtual machine.

    If you are accessing the VM using an SSH key pair, you can use the following command:

    ssh -i ~/.ssh/myKey.pem azureuser@20.51.230.13
    

    Make sure to replace the key file path and VM public IP address with the correct values for your environment.

    Please refer to this link for more detailed steps: https://learn.microsoft.com/en-us/azure/virtual-machines/linux-vm-connect?tabs=Linux

    Are you looking to connect to an Azure Windows VM using Remote Desktop Protocol (RDP)?

    To connect, open the Remote Desktop (RDP) application on your local machine. Enter the public IP address of the virtual machine and click Connect.

    When prompted, provide the username and password configured for the VM, then click OK to establish the connection.

    Please refer to this link for more detailed steps: https://learn.microsoft.com/en-us/azure/virtual-machines/windows/connect-rdp#connect-to-the-virtual-machine

    are you looking to Install and configure xrdp to use Remote Desktop with Ubuntu. Please follow this link for more detailed information: https://learn.microsoft.com/en-us/azure/virtual-machines/linux/use-remote-desktop?tabs=azure-cli

    Note: Please ensure that the required ports are allowed in the NSG inbound rules:

    • Port 3389 for RDP (Windows VM access)
    • Port 22 for SSH (Linux VM access).

    Hope this helps. Please let me know if you have any queries

    0 comments No comments

  2. SUNOJ KUMAR YELURU 17,981 Reputation points MVP Volunteer Moderator
    2026-03-04T08:29:17.1766667+00:00

    Hello @Sam Rabinovich,

    If you’re experiencing issues accessing the GUI of an Ubuntu VM via SSH or RDP, there are several factors to consider. First, ensure that the VM is properly configured to allow remote desktop connections. For Linux VMs, Azure Lab Services automatically enables SSH, but for GUI access, additional setup is required on the template VM, including installing a desktop environment and configuring RDP settings.

    To connect to a Linux VM using RDP, the lab creator must enable the Client connection (RDP) setting and ensure that a GUI desktop and RDP (like xrdp) are installed. If these steps are not completed, you may face difficulties connecting.

    If you are using xrdp and cannot connect, check if the xrdp service is running and listening on the correct port (usually 3389). You can verify this by running sudo netstat -plnt | grep rdp on your VM. If the service is not running, you can restart it with sudo systemctl restart xrdp.

    Additionally, ensure that your network security group rules allow traffic on TCP port 3389

    Install and configure xrdp to use Remote Desktop with Ubuntu


    If this answers your query, do click Accept Answer and Up-Vote for the same. And, if you have any further query do let us know.

    0 comments No comments

  3. Jilakara Hemalatha 10,365 Reputation points Microsoft External Staff Moderator
    2026-03-03T18:52:33.7333333+00:00

    Hello Sam,

    Thank you for reaching out.

    Based on your description, it appears you are trying to access the Ubuntu VM’s graphical interface using SSH or RDP. Please note that Ubuntu Server images do not include a graphical desktop environment by default, and SSH provides command-line access only. GUI access requires additional configuration.

    To log in to a Linux virtual machine with a GUI, you first need to ensure the machine has a Public IP address assigned. After that, make sure port 22 (SSH) is added to the inbound rules in the Network Security Group (NSG).

    Once confirmed, connect to the Linux VM from your local machine using the following command:

    ssh <Username>@<Public IP of your VM>
    

    After connecting to the Azure Linux machine, I ran the following commands to install XRDP and the XFCE desktop environment.

    Update Your System sudo apt update && sudo apt upgrade -y

    Install XFCE Desktop Environment: sudo apt install xfce4 xfce4-goodies -y

    Install xRDP sudo apt install xrdp -y

    Start and Enable xRDP Service sudo systemctl enable xrdp

    And start the Xrdp by using below command sudo systemctl start xrdp

    Check XRDP Status sudo systemctl status xrdp

    Configure Firewall to Allow RDP Traffic (Port 3389)

    sudo ufw allow 3389/tcp

    sudo ufw reload

    Make sure to add RDP port 3389 to the inbound rules of the Network Security Group to access the GUI.

    User's image

    After completing these steps, try connecting through Remote Desktop using the VM’s Public IP address.

    Reference: Enable Remote Desktop Protocol Using xrdp on Ubuntu 22.04

    Install and configure xrdp to use Remote Desktop with Ubuntu

    Hope this helps. Please let me know if you have any queries


Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.