[root@localhost ~]# vncserver You will require a password to access your desktops. Password: Verify: WARNING: The first attempt to start Xvnc failed, possibly because the font catalog is not properly configured. Attempting to determine an appropriate font path for this system and restart Xvnc using that font path ... Could not start Xvnc. /usr/bin/Xvnc: symbol lookup error: /usr/bin/Xvnc: undefined symbol: pixman_composite_trapezoi
出现以上错误的解决办法:
yum install pixman pixman-devel libXfont
-----------------------------------------------------------------------------------------------------------------
vnc远程服务搭建以centos为例:
1.首先查看系统下面有没有安装vnc-server ubuntu下是vnc4server:
[root@localhost ~]# rpm -qa vnc-server #这里输出应该是有一个vnc的客户端。 [root@localhost ~]#yum install vnc-server
2.启动服务:
[root@localhost ~]# vncserver :1 # `:1` 对应端口号5901。(注:这里的:1指的是桌面号。:2就对应5902); Password: Verify: xauth: creating new authority file /root/.Xauthority New 'localhost.localdomain:1 (root)' desktop is localhost.localdomain:1 Creating default startup script /root/.vnc/xstartup Starting applications specified in /root/.vnc/xstartup Log file is /root/.vnc/localhost.localdomain:1.log
3.配置错误的解决办法:
会在生成隐藏目录:.vnc .Xauthority /tmp/.X11-unix/X0 /tmp/.X1-lock 配置错误时,停止服务,删除这些文件。 [root@localhost ~]# cd .vnc/ [root@localhost .vnc]# ls localhost.localdomain:1.log localhost.localdomain:1.pid passwd xstartup [root@localhost .vnc]#
4.停止服务的方法:vncserver -kill :1 # KILL后面对应的是桌面号。如果连接不上考虑iptables和selinux。
在iptables中允许5901,并关闭防火墙,停止服务。 [root@localhost ~]#iptables -I INPUT -p tcp --dport 5901 -j ACCEPT [root@localhost ~]# setenforce 0 [root@localhost ~]#service vncserver stop
如果要启动多个vncserver桌面:vncserver :2
5.配置桌面,在 .vnc/ 有一个文件叫:xstartup:
[root@localhost ~]# cd .vnc/ [root@localhost .vnc]# vi xstartup # unset SESSION_MANAGER # exec /etc/X11/xinit/xinitrc 取消以上两行的注释,即可。
6.重启服务:
[root@localhost ~]#service vncserver start