How To Install and configure Remote Desktop to connect a Linux VM in Azure Cloud
Linux VM usually managed from the command line but for making it simple for troubleshooting, installation of software packages. We are going to install xrdp service in Ubuntu 18.04 VM.
Step:- 1 Login to your Linux VM using public IP
# ssh username@yourpublicip
Step:-2 After login you should update your system and install xfce4 desktop environment using below command.
# sudo apt-get update # sudo apt-get install xfce4
Step:-3 Install and configure a remote desktop server
we have already installed xfce4 desktop environment. xrdp is an open-source Remote Desktop Protocol (RDP) server that is available on most Linux distributions. we need to install and configure it to connect Ubuntu 18.04 VM using xrdp.
# sudo apt-get -y install xrdp # sudo systemctl enable xrdp
Step:- 4 Configure session for the Xfce desktop environment using the below command.
# echo xfce4-session >~/.xsession
Step:-5 Restart the xrdp service
# sudo service xrdp restart
Step:- 6 Setup a local user for login using xrdp
if your VM created using username and password then no need to create a new user but if your VM created by using ssh key then you should create a new user. in my case, VM created using the password.
# sudo passwd sysadmin
sysadmin@my-test-1:~$ sudo passwd sysadmin Enter new UNIX password: Retype new UNIX password: passwd: password updated successfully sysadmin@my-test-1:~$
Step:-7 Create a rule on NSG (Network Security Group) to allowing remote desktop traffic. Allow TCP port 3389.
Step:-8 Connect your Linux VM using your local Remote Desktop Client. put your public IP and port number as per below.
Step:- 9 Now put the username and password of your system and click on “ok”
Conclusion:- Done, you’ve successfully installed xfce4 and xrdp on your Ubuntu Linux. If you’re facing any issue during installation and configuring it feel free to use our comment section for solutions.
I am a professional Cloud Engineer and founder of LinuxFork. I am working on Infrastructure Deployment and focusing on the integration of open source technologies with the Cloud. I am an avid Linux lover and open source enthusiast. mostly, I am working with Redhat and Ubuntu Linux in the production environment. apart from this I always believe in knowledge sharing.