vncserver基于redhat安装
VNC(Virtual Network Computing)是一种远程桌面协议,它允许用户通过网络连接到远程计算机的图形界面
env
- redhat5.5
- vncserver
step
1.install vncserver
yum install -y vncserver
2.start vnc service
vncserver命令启动VNC服务,命令格式: vncserver :桌面号,其中'桌面号'用'数字'的方式表示,每个用户连个需要占用1个桌面
vncserver :1
[root@testdb ~]# vncserver :1
You will require a password to access your desktops.
Password:
Verify:
xauth: creating new authority file /root/.Xauthority
New 'testdb:1 (root)' desktop is testdb:1 # 存储认证密码
Creating default startup script. /root/.vnc/xstartup # 图形化配置
Starting applications specified in /root/.vnc/xstartup
Log file is /root/.vnc/testdb:1.log
3.vncserver服务配置
1.重启单个桌面:
[root@testdb ~]# vncserver -kill :1
[root@testdb ~]# vncserver :1
2.重启整个服务:
service vncserver start/stop/restart
3.配置修改
备注:在部署VNCSERVER时,必须要修改以下文件
打开配置文件/etc/sysconfig/vncservers,原始文件为:
# VNCSERVERS="2:myusername"
# VNCSERVERARGS[2]="-geometry 800x600 -nolisten tcp -nohttpd -localhost"
#修改后的
VNCSERVERS="1:root"
VNCSERVERARGS[1]="-geometry 800×600"
1表示VNC以桌面1运行,这样可以启动root的桌面
远程访问时,格式为IP:1(链接窗口1)
必须要删除-nolisten tcp -nohttpd -localhost,否则无法访问
4.修改vnc密码
vncpasswd
5.vnc端口和桌面号关系
VNC使用TCP端口从5900开始
桌面号为1 ---- 端口号为5901
桌面号为2 ---- 端口号为5902
桌面号为3 ---- 端口号为5903
VNC客户程序Web服务TCP端口从5800开始
桌面号为1 ---- 端口号为5801
桌面号为2 ---- 端口号为5802
桌面号为3 ---- 端口号为5803
6.vnc-viewer
1.
启动VNC Viewer软件 --> Server输入“144.194.192.183:1” --> 点击“OK” --> Password输入登陆密码 --> 点击“OK”登陆到X-Window图形桌面环境 --> 测试成功
2.
Web浏览器(如Firefox,IE,Safari)登陆测试,操作流程如下
地 址栏输入http://144.194.192.183:5801/ --> 出现VNC viewer for Java(此工具是使用Java编写的VNC客户端程序)界面,同时跳出VNC viewer对话框,在Server处输入“144.194.192.183:1”点击“OK” --> Password输入登陆密码 --> 点击“OK”登陆到X-Window图形桌面环境 --> 测试成功
注:VNC viewer for Java需要JRE支持,如果页面无法显示,表示没有安装JRE
vnc-view
- http://soft.laozuo.org/tools/vncviewer.zip
- https://files.cnblogs.com/files/xiaochina/vncviewer.zip
- https://files.cnblogs.com/files/xiaochina/vnc-server-4.1.2-14.el5_6.6.x86_64.zip