实验环境 Server:CentOS 6.5 x86_64 Client: Windows 7 安装和配置VNC- 1. [iyunv@gxh ~]# yum install tigervnc-server -y
- 2. 修改vnc主配置文件
[iyunv@gxh~]# vim /etc/sysconfig/vncservers 找到最后两行,去掉注释,修改为 VNCSERVERS="1:root" ###第一个远程连接的账户为root VNCSERVERARGS[1]="-geometry1200x900 " ###root远程登录分辨率为1200x900 [iyunv@gxh~]# vncserver Youwill require a password to access your desktops. Password: ###这里输入连接远程桌面的密码 Verify: ###再次输入密码 xauth:(stdin):1: bad display name"gxh:1" in "add" command New'gxh:1 (root)' desktop is gxh:1 Creatingdefault startup script /root/.vnc/xstartup Startingapplications specified in /root/.vnc/xstartup Logfile is /root/.vnc/gxh:1.log [iyunv@gxh~]# vim .vnc/xstartup 将最后两行注释掉,在最后一行添加如下: #xterm-geometry 80x24+10+10 -ls -title "$VNCDESKTOP Desktop" & #twm& gnome-session& [iyunv@gxh~]# chkconfig vncserver on VNCserver 监听的端口从 5900 开始,display:1 监听 5901,display:2监听 5902,以此类推。 [iyunv@gxh~]# iptables -I INPUT -m state --state NEW -m tcp -p tcp --dport 5901 -j ACCEPT [iyunv@gxh~]# service iptables save 客户端 1.9. 远程连接vnc服务器
扩展命令[iyunv@gxh ~]# vncserver xauth: (stdin):1: bad display name "gxh:2" in"add" command New 'gxh:2 (root)' desktop is gxh:2 Starting applications specified in/root/.vnc/xstartup Log file is /root/.vnc/gxh:2.log [iyunv@gxh ~]# vncserver -list TigerVNC server sessions: X DISPLAY # PROCESSID :1 2403 :2 2998 [iyunv@gxh ~]# vncserver -kill :2 Killing Xvnc process ID 2998 [iyunv@gxh ~]# vncserver -list TigerVNC server sessions: X DISPLAY # PROCESSID :1 2403 [iyunv@gxh ~]# vncpasswd Password: Verify: VNC客户端软件推荐- VNC Viewer
- TightVNC
- RealVNC
- TigerVNC
|