- 论坛徽章:
- 0
|
一直都用Xmanager远程连接Linux/AIX,今天兴起感受了一把VNC(那是相当的开不得玩笑:不错
![]()
),以下是我配置VNC的步骤:
配置VNC 远程Windows下访问Linux AS5
1 检查Linux下是否装有VNC组建:如果没有安装就先安装(安装盘找包;
www.realvnc.com
下载)
#rpm -qa |grep vnc
2 启动服务
#service vncserver start
3 在需要远程连接的用户下运行vncserver(如:#vncserver)来分配端口,也可以通过#vncserver :5来分配5这 个端口
#vncserver -kill:2 --关闭访问端口
4 修改文件/root/.vnc/xstartup
修改前:
[root@crmdb .vnc]# more xstartup
#!/bin/sh
# Uncomment the following two lines for normal desktop:
# unset SESSION_MANAGER --修要去掉注释
# exec /etc/X11/xinit/xinitrc --修要去掉注释
[ -x /etc/vnc/xstartup ] && exec /etc/vnc/xstartup --修要添加注释
[ -r $HOME/.Xresources ] && xrdb $HOME/.Xresources --修要添加注释
xsetroot -solid grey --修要添加注释
vncconfig -iconic & --修要添加注释
xterm -geometry 80x24+10+10 -ls -title "$VNCDESKTOP Desktop" & --修要添加注释
twm & --修要添加注释
[root@crmdb .vnc]#
修改后:
[root@crmdb .vnc]# more xstartup
#!/bin/sh
# Uncomment the following two lines for normal desktop:
unset SESSION_MANAGER
exec /etc/X11/xinit/xinitrc
#[ -x /etc/vnc/xstartup ] && exec /etc/vnc/xstartup
#[ -r $HOME/.Xresources ] && xrdb $HOME/.Xresources
#xsetroot -solid grey
#vncconfig -iconic &
#xterm -geometry 80x24+10+10 -ls -title "$VNCDESKTOP Desktop" &
#twm &
[root@crmdb .vnc]#
修改完该文件后需要重启服务
5 客户端连接
在windows上,运行VNC viewer->输入IP&端口(192.168.1.226:5)->输入之前设定的访问密码即可
备注:
如果出现下面错误
[root@localhost ~]# /etc/init.d/vncserver start
启动 VNC 服务器:no displays configured
去掉文件中的注释 /etc/sysconfig/vncserver
本文来自ChinaUnix博客,如果查看原文请点:http://blog.chinaunix.net/u/26381/showart_460883.html |
|