Installing a VNC Server on an Online Server needs a few basic steps as given below. This can be applied for any server type like AWS EC2, GCP Compute Engine, Azure VMs or even a server in a private cloud.
1) Step 1: Install a VNC Server on a machine
The installation steps might be different based on the Operating System. So Google and follow any guide that suits your OS. Make sure you set up a proper username and password for the VNC account on the server, after installation.
eg: CentOS - Guide
2) Open 5901 Port from server
This can be a firewall configuration, network configuration or even a security group configuration. This depends on the server you are using.
3) Check whether the VNC server is running on the server
If you have installed vncserver
, you can simply use the following command to start the server.
vncserver
And run the following command to see what VNC servers are currently active.
vncserver -list
4) Check whether the VNC server is accessible from outside
Open up a terminal and run the following command. Let us assume your server Public IP is 104.197.91.140
.
$ nc 104.197.91.140 5901
// alternatively you can use telnet
$ telnet 104.197.91.140 5901
// the response should like this
RFB 003.008
If this is successful, the you can proceed to the next step. If not, it means one of the following.
- Your server does not expose port 5901 and your public IP is not accessible
- You server does not have a proper VNC installed.
5) Connect using your VNC Client
This depends on the operating system you are using. So, you can simply google and find out your relevant application.