1 ## noVNC: HTML5 VNC Client
6 noVNC is a VNC client implemented using HTML5 technologies,
7 specifically Canvas and WebSockets (supports 'wss://' encryption).
8 noVNC is licensed under the
9 [LGPLv3](http://www.gnu.org/licenses/lgpl.html).
11 Special thanks to [Sentry Data Systems](http://www.sentryds.com) for
12 sponsoring ongoing development of this project (and for employing me).
14 Notable commits, announcements and news are posted to
15 @<a href="http://www.twitter.com/noVNC">noVNC</a>
20 Running in Chrome before and after connecting:
22 <img src="http://kanaka.github.com/noVNC/img/noVNC-1.jpg" width=400> <img src="http://kanaka.github.com/noVNC/img/noVNC-2.jpg" width=400>
24 See more screenshots <a href="http://kanaka.github.com/noVNC/screenshots.html">here</a>.
27 ### Projects/Companies using noVNC
29 * [Sentry Data Systems](http://www.sentryds.com): uses noVNC in the
30 [Datanex Cloud Computing Platform](http://www.sentryds.com/products/datanex/).
32 * [Ganeti Web Manager](http://code.osuosl.org/projects/ganeti-webmgr):
33 Feature [#1935](http://code.osuosl.org/issues/1935).
35 * [Archipel](http://archipelproject.org):
36 [Video demo](http://antoinemercadal.fr/archipelblog/wp-content/themes/ArchipelWPTemplate/video_youtube.php?title=VNC%20Demonstration&id=te_bzW574Zo)
38 * [openQRM](http://www.openqrm.com/): VNC plugin available
39 by request. Probably included in [version
40 4.8](http://www.openqrm.com/?q=node/15). [Video
41 demo](http://www.openqrm-enterprise.com/news/details/article/remote-vm-console-plugin-available.html).
44 ### Browser Requirements
46 * HTML5 Canvas: Except for Internet Explorer, most
47 browsers have had Canvas support for quite some time. Internet
48 Explorer 9 will have Canvas support (finally).
50 * HTML5 WebSockets: For browsers that do not have builtin
51 WebSockets support, the project includes
52 <a href="http://github.com/gimite/web-socket-js">web-socket-js</a>,
53 a WebSockets emulator using Adobe Flash.
55 * Fast Javascript Engine: noVNC avoids using new Javascript
56 functionality so it will run on older browsers, but decode and
57 rendering happen in Javascript, so a slow Javascript engine will
58 mean noVNC is painfully slow.
60 * I maintain a more detailed list of browser compatibility <a
61 href="http://github.com/kanaka/noVNC/blob/master/docs/browsers.md">here</a>.
64 ### Server Requirements
66 Unless you are using a VNC server with support for WebSockets
67 connections (only my [fork of libvncserver](http://github.com/kanaka/libvncserver)
68 currently), you need to use a WebSockets to TCP socket proxy. There is
69 a python proxy included ('wsproxy'). One advantage of using the proxy
70 is that it has builtin support for SSL/TLS encryption (i.e. "wss://").
72 There a few reasons why a proxy is required:
74 1. WebSockets is not a pure socket protocol. There is an initial HTTP
75 like handshake to allow easy hand-off by web servers and allow
76 some origin policy exchange. Also, each WebSockets frame begins
77 with 0 ('\x00') and ends with 255 ('\xff').
79 2. Javascript itself does not have the ability to handle pure byte
80 arrays. The python proxy encodes the data as base64 so that the
81 Javascript client can decode the data as an integer array.
86 * Use the launch script to start a mini-webserver and the WebSockets
87 proxy. The `--vnc` option is used to specify the location of
90 `./utils/launch.sh --vnc localhost:5901`
92 * Point your browser to the cut-and-paste URL that is output by the
93 launch script. Enter a password if the VNC server has one
94 configured. Hit the Connect button and enjoy!
99 * To encrypt the traffic using the WebSocket 'wss://' URI scheme you
100 need to generate a certificate for the proxy to load. By default the
101 proxy loads a certificate file name `self.pem` but the `--cert=CERT`
102 option can override the file name. You can generate a self-signed
103 certificate using openssl. When asked for the common name, use the
104 hostname of the server where the proxy will be running:
106 `openssl req -new -x509 -days 365 -nodes -out self.pem -keyout self.pem`
108 * `tightvnc` provide a nice startup script that can be used to run
109 a separate X desktop that is served by VNC. To install and run the
110 server under Ubuntu you would do something like this:
112 `sudo apt-get install tightvncserver`
116 The VNC server will run in the background. The port that it runs
117 on is the display number + 5900 (i.e. 5901 in the case above).
119 * `x11vnc` can be used to share your current X desktop. Note that if
120 you run noVNC on the X desktop you are connecting to via VNC you
121 will get a neat hall of mirrors effect, but the the client and
122 server will fight over the mouse.
124 `sudo apt-get install x11vnc`
126 `x11vnc -forever -display :0`
128 Without the `-forever` option, x11vnc will exit after the first
129 disconnect. The `-display` option indicates the exiting X display to
130 share. The port that it runs on is the display number + 5900 (i.e.
131 5900 in the case above).
133 * To run the python proxy directly without using launch script (to
134 pass additional options for example):
136 `./utils/wsproxy.py -f source_port target_addr:target_port`
138 `./utils/wsproxy.py -f 8787 localhost:5901`
140 * To run a mini python web server without the launch script:
142 `./utils/web.py PORT`
144 `./utils/web.py 8080`
146 * Point your web browser at http://localhost:8080/vnc.html
147 (or whatever port you used above to run the web server). Specify the
148 host and port where the proxy is running and the password that the
149 vnc server is using (if any). Hit the Connect button.
151 * If you are using python 2.3 or 2.4 and you want wsproxy to support
152 'wss://' (TLS) then see the
153 [wsproxy README](http://github.com/kanaka/noVNC/blob/master/utils/README.md)
154 for instructions on building the ssl module.
159 The client is designed to be easily integrated with existing web
162 At a minimum you must include the `vnc.js` and `ui.js` scripts and
163 call UI.load(). For example:
166 <script src='include/vnc.js'></script>
167 <script src="include/ui.js"></script>
170 <div id='vnc'>Loading</div>
173 window.onload = function () {
179 See `vnc.html` and `vnc_auto.html` for examples. The file
180 `include/plain.css` has a list of stylable elements.
182 The `vnc.js` also includes other scripts within the `include`
183 sub-directory. The `VNC_uri_prefix` variable can be use override the
184 URL path to the `include` sub-directory.
189 You will need console logging support in the browser. Recent Chrome
190 and Opera versions have built in support. Firefox has a nice extension
191 called "firebug" that gives console logging support.
193 First, load the noVNC page with `logging=debug` added to the query string.
194 For example `vnc.html?logging=debug`.
196 Then, activate the console logger in your browser. With Chrome it can
197 be activate using Ctrl+Shift+J and then switching to the "Console"
198 tab. With firefox+firebug, it can be activated using Ctrl+F12.
200 Now reproduce the problem. The console log output will give more
201 information about what is going wrong and where in the code the
204 If you file a issue/bug, it is very helpful for me to have the last
205 page of console output leading up the problem in the issue report.
206 Other helpful issue/bug information: browser version, OS version,
207 noVNC git version, and VNC server name/version.