使用noVNC访问虚机控制台

阿里云开年HI购季,爆款云产品低至5折!点此购买html

https://www.aliyun.com/acts/product-section-2019/home?spm=5176.8112568.520614.1.596e9ed5PQtxdH&accounttraceid=ff8cde51-e900-42b8-b536-cec8fe701245&userCode=pdhbtt9jpython


送您一个最高1000元的阿里云大礼包,快来领取吧~git

https://promotion.aliyun.com/ntms/yunparter/invite.html?userCode=pdhbtt9jgithub



---------------------------------------web

1、noVNC是什么浏览器

2、测试系统bash

3、系统安装桌面环境 服务器

4、安装配置tigervncide

5、配置noVNC测试

6、自启动设置

7、访问测试

8、总结

9、问题

附:安装numpy,解决链接速度慢:

---------------------------------------

1、noVNC是什么

  noVNC is a browser based VNC client implemented using HTML5 Canvas and WebSockets. You will either need a VNC server with WebSockets support (such as libvncserver) or you will need to use websockify to bridge between your browser and VNC server. 


2、测试系统

CentOS6.4 64位    系统须要能链接互联网

IP:192.168.175.128


3、系统安装桌面环境   

# yum groupinstall "X Window System" "Desktop" -y


4、安装配置tigervnc

# yum install tigervnc-server
# vncserver                                  //输入vnc登录密码
# service vncserver restart                  //重启服务,出现错误
Starting VNC server: no displays configured          [FAILED]

解决办法:

# vi /etc/sysconfig/vncservers               //在最后添加如下两行
VNCSERVERS="1:root"
VNCSERVERARGS[1]="-geometry 1024x768"


5、配置noVNC

登录https://kanaka.github.io/noVNC/ 下载该包并解压:

# cd kanaka-noVNC-6a90803/utils
# ./launch.sh --vnc localhost:5901    //系统必须联网


6、自启动设置

# cat /etc/rc.local
./root/kanaka-noVNC-6a90803/utils/launch.sh --vnc localhost:5901 &
# chkconfig vncserver on


7、访问测试

http://192.168.175.128:6080/vnc_auto.html

建议使用火狐浏览器(IE和猎豹打不开,提示不支持画布)

wKiom1Yp8KrCHAuUAAN0eBj1KOk826.jpg

8、总结

第一种方式(本文使用,打在模板中使用):

代理和vnc都在虚机自身安装,默认使用6080端口:

./launch.sh --vnc localhost:5901
vnc_auto.html -> 192.168.175.128:6080 -> websockify.py -> localhost:5901

第二种方式:

只部署一台代理服务器,每台虚机只须要安装vnc服务便可;

./websockify.py 8000 192.168.2.21:5901
vnc_auto.html -> 192.168.175.130:8000 -> websockify.py -> 192.168.175.128:5901

9、问题

0.最终仍是经过虚机IP+PORT链接,若是虚机网卡宕掉,没法链接;

1.连入vnc以后不须要root密码直接能够登陆;

2.链接速度太慢,安装numpy可解决,见博客最后;

3.画质很差。



附:安装numpy,解决链接速度慢:

1.在官网上下载该包:http://sourceforge.net/projects/numpy/files/

2.解压

3.cd进入解压后的路径

4.输入命令

python setup.py install

5.安装完成

相关文章
相关标签/搜索