Configuring the VNC server/viewer in Linux

参考:http://bobpeers.com/linux/vnc.php
1:安装 vnc vnc-server

 yum install vnc vnc-server

2:添加用户 /etc/sysconfig/vncservers
配置文件的最后两行去掉注释:
VNCSERVERS=”1:bobpeers”
VNCSERVERARGS[1]=”-geometry 1024×768 -depth 16″
第一行:
1:Gnome Remote Desktop 已经用了computername:0,这里vnc 用:1 ,告诉vncserver在 5901端口监听。
boobpeer:代表用户名。
第二行:1的参数
3:Setting a password 设置密码:vncpasswd
4:启动vncserver
# vncserver :1
#/etc/init.d/vncserver start
刚开始遇到个错误提示:vncserver: couldn’t find “xauth” on your PATH.
原来是没有安装 xorg-x11-xauth :安装 yum install xorg-x11-xauth
vncserver 的启动提示:

#vncserver :1
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

通过netstat -ntlp 查看vnc已经在 5801,5901,6001端口监听。但是通过vnc客户端连接后是个很简陋的桌面。我们修改:~/.vnc/xstartup,删除这两行的注释:

# Uncomment the following two lines for normal desktop:
 unset SESSION_MANAGER
 exec /etc/X11/xinit/xinitrc

重启vncserver ,/etc/init.d/vncserver restat
5:vnc客户端连接
vnc ip:5901 或者通过web方式 http://ip:5801(客户端需要有java虚拟机支持)

请选择你看完该文章的感受:

不错 超赞 无聊 扯淡 不解 路过

随机文章:

Tags:

发表评论