If it is advisable to distant right into a GUI-enabled Linux server, your quickest, least expensive choice is VNC.
If it is advisable to distant right into a GUI-enabled Linux server, your quickest, least expensive choice is VNC. Jack Wallen exhibits you ways.
There are situations when it is advisable to not solely log right into a distant Linux machine however acquire entry to the total desktop of stated machine. When it is advisable to do such a factor, you are going to want the assistance of a VNC server.
Happily, organising such a server is not difficult and could be carried out with out spending a single penny on software program. I will stroll you thru the method of putting in and configuring a VNC server with the assistance of the Ubuntu Server, model 18.04.
SEE: Server deployment/migration guidelines (Tech Professional Analysis)
What you want
With a view to efficiently get this up and working, you want the next:
- Ubuntu Server 18.04.
- Person with sudo privileges.
- VNC Shopper to hook up with the distant machine.
With the necessities met, let’s make this occur.
Putting in a desktop
We have to have a desktop on our Ubuntu server. For this, we’ll set up the light-weight Xfce desktop (since we’ll be working it remotely). To do that, log into your Ubuntu Server occasion and problem the command:
sudo apt-get set up xfce4 xfce4-goodies -y
Putting in the VNC server
We will use TightVNC for this function. It is pretty simple to rise up and working and dependable. To put in this explicit VNC server, open a terminal window on the machine you want to use remotely and problem the command:
sudo apt-get set up tightvncserver -y
Upon the completion of the set up, problem the command:
This may create the preliminary VNC configuration. You’ll be required to create passwords (which can’t be longer than eight characters) for each login and view-only entry (Determine A). The view-only entry password is non-obligatory.
When this step completes, it’s best to see reported there’s a new ‘X’ desktop working (Determine B) at USERNAME:1 (the place HOSTNAME is the hostname of the distant machine).
Now kill the VNC server with the command:
vncserver -kill :1
Configure the VNC server
Earlier than restarting the VNC server, you will wish to create a brand new configuration file. Run the command:
On this file, paste the next contents:
#!/bin/bash xrdb $HOME/.Xresources startxfce4 &
Save and shut that file. Change the execution permissions of the file with the command:
sudo chmod +x ~/.vnc/xstartup
Restart the VNC server with the command:
It’s best to now see reported that the brand new ‘X’ desktop is at HOSTNAME:1 (the place HOSTNAME is the hostname of the distant server).
Connecting to the server
We will use SSH tunneling to the server (for a safe connection). I am going to connect with the distant Linux server utilizing an area Linux machine. On the native desktop create the SSH tunnel with the command:
ssh -L 5901:127.zero.zero.1:5901 -C -N -l USER SERVER_IP
the place USER is the distant username used to begin and configure the VNC server, and SERVER_IP is the IP handle of the distant server. You’ll be prompted for the distant person’s password. As soon as that authenticates, the safe tunnel is working (you will not get the immediate again).
Begin your VNC consumer device and enter localhost:5901 because the handle for the VNC server. As soon as linked, you will be prompted to enter the VNC password you created. Upon profitable authentication, it’s best to see the distant desktop (Determine C).
While you’re completed with the connection, shut out your consumer utility, and kill the SSH tunnel by typing the [Ctrl]+[C] keyboard mixture within the terminal window. If you wish to reconnect to the distant VNC server, you will must re-create the SSH tunnel earlier than connecting together with your consumer.
Able to distant
And that’s all there’s to organising a VNC server on Linux. While you want to have the ability to distant right into a server, and use a GUI desktop, this is likely to be your best choice—not less than once you need it up and working quick and on a budget.