标签:
# rpm -ivh tigervnc-server 只要这一个就行
# yum -y install tigervnc-server
[root@vn ~]# vncserver Password: 设置用户的VNC登陆密码 Verify: xauth: (stdin):1: bad display name "vn:1" in "add" command New ‘vn:1 (root)‘ desktop is vn:1 Creating default startup script /root/.vnc/xstartup Starting applications specified in /root/.vnc/xstartup Log file is /root/.vnc/vn:1.log
# ps -ef|grep Xvnc root 2003 1 0 06:16 pts/1 00:00:00 /usr/bin/Xvnc :1 -desktop vn:1 (root) -auth /root/.Xauthority -geometry 1024x768 -rfbwait 30000 -rfbauth /root/.vnc/passwd -rfbport 5901 -fp catalogue:/etc/X11/fontpath.d -pn root 2156 1937 0 06:20 pts/1 00:00:00 grep Xvnc
# cd /root/.vnc/ # ls passwd vn:1.log vn:1.pid xstartup 访问密码文件、访问日志文件、第一个虚拟桌面的PID文件,保存一个进程号、启动脚本文件、 # cat vn\:1.pid 2003 进程号为2003
[root@vn .vnc]# netstat -antu|grep 5901 tcp 0 0 0.0.0.0:5901 0.0.0.0:* LISTEN
[root@vn ~]# vncpasswd
Password:
Verify:
# vncviewer 192.168.121.171:1 两种方式 # vncviewer 192.168.121.171:5901
# vim /etc/sysconfig/vncservers VNCSERVERS="2:tom" VNCSERVERARGS[2]="-geometry 800x600 -nolisten tcp "
[root@vn ~]# su - tom [tom@vn ~]$ vncpasswd Password:
# service vncserver start 正在启动 VNC 服务器:2:tom xauth: creating new authority file /home/tom/.Xauthority xauth: (stdin):1: bad display name "vn:2" in "add" command New ‘vn:2 (tom)‘ desktop is vn:2 Creating default startup script /home/tom/.vnc/xstartup Starting applications specified in /home/tom/.vnc/xstartup Log file is /home/tom/.vnc/vn:2.log
# ps -ef | grep Xvnc root 2003 1 0 06:16 pts/1 00:00:00 /usr/bin/Xvnc :1 -desktop vn:1 (root) -auth /root/.Xauthority -geometry 1024x768 -rfbwait 30000 -rfbauth /root/.vnc/passwd -rfbport 5901 -fp catalogue:/etc/X11/fontpath.d -pn tom 2391 1 1 07:40 ? 00:00:00 /usr/bin/Xvnc :2 -desktop vn:2 (tom) -auth /home/tom/.Xauthority -geometry 800x600 -rfbwait 30000 -rfbauth /home/tom/.vnc/passwd -rfbport 5902 -fp catalogue:/etc/X11/fontpath.d -pn -nolisten tcp root 2786 2353 0 07:41 pts/2 00:00:00 grep X vnc 进程号2391,虚拟桌面号2,端口号5902
# service vncserver start restart启动、重启stop 关闭
#service vncserver status 查看状态
#chkconfig vncserver on 开机启动
#chkconfig --list vncserver
标签:
原文地址:http://www.cnblogs.com/chinas/p/4562533.html