ITeye博客

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

redstarofsleep · 2013-08-13 14:18 · HTML5 · 开源软件 · Markdown

文章搬至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能够连网的情况下,直接执行

 

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就搭建完成了.

 

转载请注明出处

评论(6)

  1. #6 楼 · yuky1327 · 2014-02-07 16:22

    为什么rdp的连接不能成功?报Internal error,另外guacamole的日志在哪里可以看到? 我已经安装了xfreerdp了,xfreerdp -u administrator -p Root-admin 192.168.7.10都能成功。

  2. #5 楼 · redstarofsleep · 2014-01-17 12:50

    yuky1327 writes:

    一月 17, 2014 1:22:45 上午 org.slf4j.impl.JCLLoggerAdapter error 严重: Server error in tunnel org.glyptodon.guacamole.GuacamoleServerException: End of stream during initial handshake. at org.glyptodon.guacamole.protocol.ConfiguredGuacamoleSocket.(ConfiguredGuacamoleSocket.java:124) at org.glyptodon.guacamole.net.auth.simple.SimpleConnection.connect(SimpleConnection.java:112) at

    请问你在部署的时候有没遇到上面的错误?

    这个错误没有遇到过

  3. #4 楼 · yuky1327 · 2014-01-16 17:49

    一月 17, 2014 1:22:45 上午 org.slf4j.impl.JCLLoggerAdapter error 严重: Server error in tunnel org.glyptodon.guacamole.GuacamoleServerException: End of stream during initial handshake. at org.glyptodon.guacamole.protocol.ConfiguredGuacamoleSocket.(ConfiguredGuacamoleSocket.java:124) at org.glyptodon.guacamole.net.auth.simple.SimpleConnection.connect(SimpleConnection.java:112) at

    请问你在部署的时候有没遇到上面的错误?

  4. #3 楼 · lhx469215044 · 2013-12-30 15:25

    楼主好,我在ubuntu 10 上想搭建guacamole-0.8.3的开发环境,可是没成功。能发一篇这样的教程么?先谢了

  5. #2 楼 · redstarofsleep · 2013-12-16 08:59

    pwijkbije writes:

    你好,我也想用这个软件,我下了最新的版本guacamole-0.8.3,我是在win7的32位系统用的tomcat7.0搭建的,vnc server 也是装在win7上,但是当我登陆http://192.168.2.2:8080/guacamole/ 成功后Recent Connections那一栏 显示“No recent connections”,我用的vnc服务器是realVNC:vnc-E4_6_1-x86_x64_win32。是不是我的这个vnc服务器不支持guacamole,还是有其他的问题?你是用的什么版本的VNC服务器。能把你用的vnc server发给我吗,非常感谢。我的邮箱是:pwijkbije@163.com

    不是VNC的问题,是guacamole的安装问题,你windows上怎么装的guacamole-server?

  6. #1 楼 · pwijkbije · 2013-12-14 19:53

    你好,我也想用这个软件,我下了最新的版本guacamole-0.8.3,我是在win7的32位系统用的tomcat7.0搭建的,vnc server 也是装在win7上,但是当我登陆http://192.168.2.2:8080/guacamole/ 成功后Recent Connections那一栏 显示“No recent connections”,我用的vnc服务器是realVNC:vnc-E4_6_1-x86_x64_win32。是不是我的这个vnc服务器不支持guacamole,还是有其他的问题?你是用的什么版本的VNC服务器。能把你用的vnc server发给我吗,非常感谢。我的邮箱是:pwijkbije@163.com

评论功能维护中,当前仅展示历史评论。