- Input the following command in the terminal to install the VNC server software.
sudo apt-get update
sudo apt-get install vnc4server
- Use the following command to start the VNC server and set a password:
vncserver
- When you run the VNC server for the first time, you will be asked to set an access password. Simply enter the password twice to complete the setup.
- Use the following command to stop the VNC server:
vncserver -kill :1
- Input the following command in the terminal to edit the VNC server configuration file, in order to modify the relevant settings of the VNC server.
nano ~/.vnc/xstartup
- After finishing editing, save the file and exit the editor.
- Restart the VNC server and apply the new settings.
vncserver
- Enter the IP address and port number of the Ubuntu host in the VNC client program to connect to the VNC server, then input the previously set password to remotely access the Ubuntu desktop.