您的位置:首页 > 运维架构 > Linux

CentOS 6.5 安装和配置 VNC!!!

2017-01-15 17:54 537 查看

一,实验环境

Server:CentOS 6.5 x86_64Client: Windows 7

二,安装和配置VNC

1. 安装软件
[root@gxh ~]# yum install tigervnc-server  -y
2. 修改vnc主配置文件
[root@gxh~]# vim /etc/sysconfig/vncservers
找到最后两行,去掉注释,修改为
VNCSERVERS="1:root"  ###第一个远程连接的账户为root
VNCSERVERARGS[1]="-geometry1200x900 "
###root远程登录分辨率为1200x900
3. 启动vnc
[root@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
4. 修改xstartup文件
[root@gxh~]# vim .vnc/xstartup
将最后两行注释掉,在最后一行添加如下:
#xterm-geometry 80x24+10+10 -ls -title "$VNCDESKTOP Desktop" &
#twm&
gnome-session&
5. 设置vncserver开机启动
[root@gxh~]# chkconfig vncserver on
6. 设置防火墙
VNCserver 监听的端口从 5900 开始,display:1 监听 5901,display:2监听 5902,以此类推。
[root@gxh~]# iptables -I INPUT -m state --state NEW -m tcp -p tcp --dport 5901 -j ACCEPT
[root@gxh~]# service iptables save
7. VNC Server配置完成

三,客户端

1. 安装vnc客户端
2. 远程连接vnc服务器


四,扩展命令

1. 添加一个display
[root@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
2. 列出所有display
[root@gxh ~]# vncserver -list
TigerVNC server sessions:
X DISPLAY #  PROCESSID
:1        2403
:2        2998
3. 关闭一个display
[root@gxh ~]# vncserver -kill :2
Killing Xvnc process ID 2998
[root@gxh ~]# vncserver -list
TigerVNC server sessions:
X DISPLAY #  PROCESSID
:1        2403
4. 修改远程登录密码
[root@gxh ~]# vncpasswd
Password:
Verify:

五,VNC客户端软件推荐

VNC Viewer

TightVNC

RealVNC

TigerVNC
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  vnc