Linux vnc服务器操作(启动/停止/重起/自启动)

8.启动和停止VNC服务
1)启动VNC服务命令
[root@testdb ~]# /etc/init.d/vncserver start
Starting VNC server: 1:root
New 'testdb:1 (root)' desktop is testdb:1

Starting applications specified in /root/.vnc/xstartup
Log file is /root/.vnc/testdb:1.log

2:oracle
New 'testdb:2 (oracle)' desktop is testdb:2

Starting applications specified in /home/oracle/.vnc/xstartup
Log file is /home/oracle/.vnc/testdb:2.log

                                                           [  OK  ]
2)停止VNC服务命令
[root@testdb ~]# /etc/init.d/vncserver stop
Shutting down VNC server: 1:root 2:oracle                  [  OK  ]

3)重新启动VNC服务命令

[root@testdb ~]# /etc/init.d/vncserver restart
Shutting down VNC server: 1:root 2:oracle                  [  OK  ]
Starting VNC server: 1:root
New 'testdb:1 (root)' desktop is testdb:1

Starting applications specified in /root/.vnc/xstartup
Log file is /root/.vnc/testdb:1.log

2:oracle
New 'testdb:2 (oracle)' desktop is testdb:2

Starting applications specified in /home/oracle/.vnc/xstartup
Log file is /home/oracle/.vnc/testdb:2.log

                                                           [  OK  ]

4)设置VNC服务随系统启动自动加载

第一种方法:使用“ntsysv”命令启动图形化服务配置程序,在vncserver服务前加上星号,点击确定,配置完成。
第二种方法:使用“chkconfig”在命令行模式下进行操作,命令使用如下(预知chkconfig详细使用方法请自助式man一下)
[root@testdb ~]# chkconfig vncserver on
[root@testdb ~]# chkconfig --list vncserver
vncserver       0:off   1:off   2:on    3:on    4:on    5:on    6:off

9.小结
  VNC的详细配置方法到此已经写完,希望能对大家有帮助。
VNC对于远程调用图形化界面来说非常的轻巧和便捷,善用之!

Good luck.

原文地址:https://www.cnblogs.com/jifeng/p/3379906.html