guacamole搭建,一个基于HTML5的VNC远程桌面

文章搬至CSDN, 最新内容请访问: http://blog.csdn.net/redstarofsleep/article/details/45092123

Guacamole是一个远程桌面的代理,它本身并没有实现VNC Server的功能.

个人理解它更像是一个VNC Viewer,或者说VNC Client的代理.

基本原理是这样的,看下面这个图:


Guacamole在VNC Server和浏览器之间建立了一个代理,Guacamole与VNC Server进行通信,就像VNC Viewer和Server之间的同信一样,然后Guacamole再将需要显示的数据传给浏览器进行显示,它和浏览器之间的通信用的是HTML5的WebSocket,然后浏览器再用Canvas将画面画出来.

我是在Ubunut12.04上搭建的Guacamole环境,Guacamole对VNC Server没有要求,我连接的是Windows上的VNC Server.

在Ubuntu上安装Guacamole是比较简单的,在保证Ubuntu能够连网的情况下,直接执行

扫描二维码关注公众号,回复: 706408 查看本文章
apt-get install guacamole-tomcat

 待这个执行完,其实Guacamole就已经算装完了,然后进行一些简单的配置:

# ln -s /var/lib/guacamole/guacamole.war /var/lib/tomcat6/webapps
# ln -s /etc/guacamole/guacamole.properties /usr/share/tomcat6/.guacamole/

 这里要注意下,".guacamole"这个目录是没有的,需要自己建一下.

然后打开/etc/guacamole目录下的user-mapping.xml,把注释中的下面这段打开

<authorize username="USERNAME" password="PASSWORD">
        <protocol>vnc</protocol>
        <param name="hostname">localhost</param>
        <param name="port">5900</param>
        <param name="password">VNCPASS</param>
</authorize>

 这里的几个参数:

username和password是登录guacamole用的,

protocol是远程连接的协议,连接VNC Server默认就是vnc,不需要修改,

<param name="hostname">localhost</param>是VNC Server的IP地址

<param name="port">5900</param>是VNC的端口,如果VNC Server上没有修改过的话也不需要修改

<param name="password">VNCPASS</param>是连接VNC Server的密码,guacamote自动去连接,不需要用户输入的.

最后重启Tomcat

/etc/init.d/tomcat6 restart

然后浏览器中访问:http://ip:8080/guacamole/  (这里的IP是安装Guacamole的机器的IP)



 

好,至此一个最基本的Guacamole就搭建完成了.

转载请注明出处

猜你喜欢

转载自redstarofsleep.iteye.com/blog/1923949