How to start GUI in cloud environment running CentOS using VNC
Description
It is usually easier to use Linux when there is graphical interface. For example, use a browser to download Charon products or other packages. However, in cloud deployment there is no console and therefore no graphical interface. To use graphical interface, it is necessary to install all related packages and also install remote desktop software like VNC as the media. VNC comes in the server part (install on the cloud instance) and the client part (local PC with graphic). Please note that different Linux version will be different. This following steps are tested under CentOS 7.x and Google Cloud Platform.
Step-by-step guide
VNC server
Login to the instance on cloud as normal user
If root user is not enabled previously, enable root user by command sudo passwd to change password for root, in which root user will be created
If root user is enabled previously, su to root
yum -y groupinstall "Workstation" to install all the packages for graphical interface
yum install tigervnc-server to install the VNC server
To start VNC server for graphical interface by vncserver :1 -geometory 1280x1024, in which “:1” is the display number. Then follow the instruction to start
VNC server will use port 5900+display number. The above will use 5901
In the cloud instance management, allow the port 5901 for connection
VNC viewer
On PC that is with graphical interface, runs the VNC viewer to connect to the IP address of the cloud instance and with the display number
Example vncviewer <host IP>:1
Give the password if password is defined
Related articles