Vncserver
Home > CentOS > CentOS 6.x > Remote administration tools > Vncserver
Latest vnc server notes are available at CentOS 7.x tigervnc-server
One time setup of tigervnc-server
It is possible to do graphical remote desktop on a machine using vncserver. Vncserver can be started remotely over SSH so direct physical access to computer is not required for enabling remote desktop. Use command 'vncserver :0' or 'vncserver :1'. It will prompt for server password. Type something safe of about 8 characters and repeat password. Note that this password would be permanently saved for future sessions also. If there is nothing already listening on port 5900 in case of :0 or port 5901 in case of :1 then vncserver will start easily. In case of error try :2, :3, etc.
Now use
ssh -L 5901:127.0.0.1:5901 <username>@<host>
to connect to server assuming vncserver is listening on 5901 (:1). Then on the remote client use 'vncviewer 127.0.0.1:5901' to connect to desktop of remote server
Setup tigervnc-server as service
Instead of using vncserver just once, to setup it as service to always be available as part of system boot using:
- Disable selinux
- Dissble firewall
- Install tigervnc server
- yum install tigervnc-server -y
- If required, add local system OS users
- useradd <useraccount>
- passwd <useraccount>
- Create vnc password for user account
- #Get shell for corresponding user
- su - <useraccount>
- vncpasswd
- Create & modify vnc configuration file '/etc/sysconfig/vncservers' via root
- VNCSERVERS="2:<useraccount>"
- VNCSERVERARGS[2]="-geometry 1280x1024"
- To give vnc access to more users, modify /etc/sysconfig/vncservers in following manner
- VNCSERVERS="2:<useraccount> 3:<useraccount> 4:<useraccount>"
- VNCSERVERARGS[2]="-geometry 1280x1024"
- VNCSERVERARGS[3]="-geometry 1280x1024"
- VNCSERVERARGS[4]="-geometry 1280x1024"
- Start vnc server
- service vncserver start
- chkconfig vncserver on
- VNC server can access from windows machines using realvnc viewer.
- Download link for realvnc viewer https://www.realvnc.com/en/connect/download/viewer/windows/
Refer:
Home > CentOS > CentOS 6.x > Remote administration tools > Vncserver