In this guide, we’ll walk through the process of setting up a VNC (Virtual Network Computing) server on a Ubuntu 18.04 system. We’ll be using the tightvncserver software for this purpose. VNC allows remote access to graphical desktops, which is useful for remote administration, accessing GUI-based applications, or providing technical support.
Step 1: Install tightvncserver
First, ensure your Ubuntu 18.04 system is up to date:
sudo apt update
sudo apt upgrade
Next, install tightvncserver:
sudo apt install tightvncserver
Step 2: Set Up a VNC Password
Run the following command to set up a VNC password. This password will be required when connecting to the VNC server:
tightvncserver
Follow the prompts to set and confirm your password.
Step 3: Configure VNC Server
Now, stop the VNC server to make some configurations:
tightvncserver -kill :1
Next, open the configuration file for editing:
nano ~/.vnc/xstartup
In this file, you’ll need to specify the desktop environment you want to use. For example, to use the default GNOME desktop environment, add the following lines to the file:
#!/bin/sh
xrdb $HOME/.Xresources
xsetroot -solid grey
export XKL_XMODMAP_DISABLE=1
/etc/X11/Xsession
gnome-session &
Save and close the file.
Step 4: Restart VNC Server
Restart the VNC server to apply the changes:
tightvncserver
Step 5: Connect to the VNC Server
Now that the VNC server is set up, you can connect to it from a VNC client. Use the IP address of your Ubuntu 18.04 system followed by the display number (default is :1). For example, if the IP address is 192.168.1.100, you would connect to 192.168.1.100:1
.
You’ll be prompted to enter the VNC password you set earlier.
Step 6: Disconnect and Stop VNC Server
When you’re done using the VNC session, you can disconnect from the VNC client. To stop the VNC server completely, use the following command:
tightvncserver -kill :1
Conclusion
Setting up a VNC server on Ubuntu 18.04 using tightvncserver allows for remote graphical desktop access, providing flexibility and convenience for various tasks. Whether you need to remotely administer your system, access GUI-based applications, or provide technical support, a VNC server offers a straightforward solution for remote access. With these steps, you can configure your Ubuntu 18.04 system to enable remote desktop access securely and efficiently.