Hello friends hope you are doing good . In this article we will talk about getting vnc into ubuntu from azure ubuntu VPS . Vnc server gives you a graphical interface to work on . Many people hate CLI mode to work with , and loves to work on graphical interface . So in order to provide users a graphical interface vnc server comes into the room and fulfill their wish . Now let’s move toward achieving our goal .

So , In order to get vnc server from azure ubuntu server you need to have these following things :

  • Azure Ubuntu VM

Step 1 : Login to your Azure account

Login to your azure account first by going to https://portal.azure.com and connect your vm through ssh by cllick on connect button .

Step 2 : Open 5901 port for vnc in networking port inbound rules in azure

how to vnc into ubuntu
port open in inbound port

As you can see in above picture by clicking on add inbound port you will get an interface like below image

how to vnc into ubuntu
Enter port number in port ranges

Now enter port number 5901 in destination port ranges and leave sources to any , source port ranges to * , destination to any , service to custom protocol to any , action to allow , priority to as it is , name to port_5901 and description to empty and click on add.

Step 3 : Connect with ssh

Now after login to your azure portal connect with your ubuntu vm through ssh by this command .

ssh [email protected]_ip_of_vm

After getting the ssh access run the following command to update your ubuntu server

sudo apt-get update

Step 4 : Install tightvncserver

Now after updating your ubuntu vm install tightvncserver package by running this command .

sudo apt-get install tightvncserver

Step 5 : Install Desktop Environment

Now it’s time to install a desktop environment for your azure ubuntu vm .So, install lxde desktop environment by this command .

sudo apt-get install lxde

Step 6 : Setting up vnc server

Now to set up vnc server type


Note : Enter the password here carefully less than 6 character and remember for later use .

Enter your password and remember this password because when you connect to vnc later then this password will be used there.

Step 7 : Test for open port 5901

Test whether the port 5901 is opened or not by running the following command .

nc localhost 5901
RFB 003.008

Step 8 : Configure ~/.vnc/xstartup file

Now it’s time to configure vnc xstartup file to run lxde everytime at startup of vncserver.To do this run following command.

sudo nano ~/.vnc/xstartup

Add the following line at the bottom


Now press Ctrl+O to write out and then press enter to save and press Ctrl+X to exit.

Step 9 : Kill vncserver previously created instance

Now kill instance of vncserver which was created previously by running the following command .

vncserver -kill :1

Step 10 : Start vncserver again

Now start vnc server once again by running the following command


Step 11 : Install a VNC Client

Now to connect with your vnc server you need to install a vnc client like RealVNC Viewer . Download and install it.

Step 12 : Connect to vnc server

Now connect to your vnc server by entering ip along with port like xx.xx.xx.xx:5901 in address bar like below image.

how to vnc into ubuntu
connecting to vnc server

Now you are all done .Enjoy your ubuntu vnc server ✌ .

If you want to remotely control your android device from windows then go through this article , you will find it helpful .

You can visit my profile and follow me on :

Linkedin : https://www.linkedin.com/in/anand-raj-7ba6431a8

Twitter : https://twitter.com/anand__346

Youtube : https://www.youtube.com/channel/UC1DcIKA0zixS5LOJ1wV1lAg

Note : if you are interested in making your own chat application with the help of firebase , javascript and jquery then enroll the below course .You will get in-depth knowledge of firebase realtime database working with firebase auth.

Udemy Course link : https://www.udemy.com/course/chat-application-with-javascript-jquery-and-firebase/?referralCode=1747A5E2136F2B76D21C

Enjoy your Azure ubuntu VM with VNC server

Thank you for reading this article , have a great day 🙂