Hey there! How’s it going? Today what we are going to do is remotely connect to a linux machine with a GUI. Better than ssh right? For that we’ll be using VNC.

So VNC?

Virtual Network Computing (VNC). VNC is a graphical desktop sharing system. It uses Remote Frame Buffer protocol (RFB) protocol for the communication. If you are curious about the operation,

“The VNC server is the program on the machine that shares its screen. The server passively allows the client to take control of it. The VNC client (or viewer) is the program that watches, controls, and interacts with the server. The client controls the server.” – Wikipedia

We are using x11vnc as the VNC tool. Package: x11vnc, VNC server to allow remote access to an existing X session. Below is the simplest way to get the job done. Let’s dive in. SSH should be configured before hand.

Note that step 1 and 2 are server side configurations where as step 3 and 4 are client slide.

Step 1

Install x11vnc on the remote machince(Server)

 

Step 2

Run the below command to start to sharing. Here Xauhority file is provided to Light DM

 

If the command is successfully executed you should get the O/P shown in the Figure 1. If you want a bigger resolution set the resolution using geometry parameter as below.

Step 3

Install the VNC client on the machince(Client)

 

Step 4

Connect from the remote machine(Client). The option -via is for using ssh.

 

Below is the Figure 1

This is one of the most easiest way to connect to a remote machine with a GUI in a Linux environment. There is a lot more to be done. As an example you could set up a password for the connection to make it more secure.

Troubleshooting

You might get a error like below if you try below.

Try executing below command.

reaplce -auth parameter with the given O/P as below

That’s it.

Hope you got an idea about how to remotely login with a GUI in Linux. If you have any questions let me know in the comments below. Your feedback is highly appreciated(happy-face).

Be Sociable, Share!