Connecting Linux VM hosted in Azure from Windows 10 using RDP

Hi All,

Greetings for the day πŸ™‚ LIFE IS BEAUTIFUL πŸ™‚

In one of the previous article – Connecting Linux VM from Windows 10 using puTTY we discussed how to connect Linux server using PuttY from Windows 10

In this article we will discuss how to connect Linux server from Windows 10 using RDP

Detailed steps :

  • I have created Linux VM – “KnowledgeJunction-Ubuntu” on my free Azure subscription as
Linux VM is created from Azure Portal
Fig : Linux VM is created from Azure Portal
  • Next step is I need to connect this Linux VM using RDP and start exploring DOCKER πŸ™‚
  • In above Fig – if we notice there is option “Connect” in top navigation bar as
Linux VM - "Connect" option in top navigation bar
Fig : Linux VM – “Connect” option in top navigation bar
  • If we click on “Connect” option we get three options as
Linux VM - Options to connect the VM - SSH / RDP / Bastion
Fig : Linux VM – Options to connect the VM – SSH / RDP / Bastion
  • Here we will connect respective Linux VM using RDP option
  • Click on “RDP“, we will be redirected to RDP tab as
Linux VM -  Connecting through RDP
Fig : Linux VM – Connecting through RDP
  • As in above Fig, we can “Download RDP File
  • OR just type in “MSTSC” in Windows run box, we will have “Remote Desktop Connection” dialog as
Linux VM -  Connecting through RDP
Fig : Linux VM – Connecting through RDP
  • If we will click on “Connect” on “Remote Desktop Connection” we wont get connected directly, we will get an error as
Linux VM -  Connecting through RDP - Error while connecting
Fig : Linux VM – Connecting through RDP – Error while connecting
  • To connect the Linux VM in Azure we need Desktop Virtual Environment installed on Linux VM. Its not installed by default
  • There are various Desktop Virtual Environments are available but we will use “xfce4
  • To install “xfce4” we need to connect Linux VM using SSH
  • Please follow article – Connecting Linux VM from Windows 10 using puTTY for connecting Linux VM using PuttY
  • Once we connected through SSH we are ready to install “xfce4” as
sudo apt-get -y install xfce4

  • Now we have desktop virtual environment on our Linux VM next step is to configure a remote desktop service (xrdp) to listen for incoming connections – xrdp
  • To install xrdp we need to execute following commands
Linux VM connected through SSH - installing Desktop Virtual Environment - "XFCE4"
Fig : Linux VM connected through SSH – installing Desktop Virtual Environment – “XFCE4”

sudo apt-get -y install xrdp
sudo systemctl enable xrdp

  • Next step is to update Remote Desktop Service – xrdp what desktop environment to use when we start our session
  • To configure xrdp to use xcfe desktop environment, execute following command

echo xfce4-session >~/.xsession

  • To have this change we need to restart xrdp service as
sudo service xrdp restart

az vm open-port --resource-group KnowledgeJunction --name KnowledgeJunction-Ubuntu --port 3389

  • Once this command executed successfully we are ready to connect the server as
Linux VM -  Connecting through RDP
Fig : Linux VM – Connecting through RDP
  • After successful entering username and password we will be able to connect Linux server πŸ™‚ as
Linux VM -  Connected through RDP
Fig : Linux VM – Connected through RDP

References:

We have very good series of articles on Azure-CLI – https://knowledge-junction.com/?s=azure-cli please have a look once

We have very good series of articles on Ubuntu / Linux – https://knowledge-junction.com/category/technology-articles/linux/

Thanks for reading πŸ™‚ HAVE A SAFE LIFE πŸ™‚ TAKE CARE πŸ™‚

Prasham Sabadra

LIFE IS VERY BEAUTIFUL :) ENJOY THE WHOLE JOURNEY :) Founder of Knowledge Junction and live-beautiful-life.com, Author, Learner, Passionate Techie, avid reader. Certified Professional Workshop Facilitator / Public Speaker. Scrum Foundation Professional certificated. Motivational, Behavioral , Technical speaker. Speaks in various events including SharePoint Saturdays, Boot camps, Collages / Schools, local chapter. Can reach me for Microsoft 365, Azure, DevOps, SharePoint, Teams, Power Platform, JavaScript.

You may also like...

1 Response

  1. August 15, 2021

    […] follow article – Connecting Linux VM hosted in Azure from Windows 10 using RDP for connecting Linux VM using […]

This site uses Akismet to reduce spam. Learn how your comment data is processed.

%d bloggers like this: