Table of Contents |
---|
Using noVNC in
...
Abiquo 2.x - 3.6.x
By default Abiquo has an integrated TightVNC applet viewer to provide remote connections to VM consoles. This can be changed to noVNC, an HTML5 VNC viewer, by following the steps below.the steps below.
For Abiquo 3.8+ see Abiquo websockify proxy for noVNC in Abiquo 3.8+
Caveats
- You must add a proxy to forward websockets requests to traditional sockets. This proxy should be installed on a separate machine from any other Abiquo service.
- You must define a password for VMs in ESXi in order to be able to connect.
- At the time of writing, noVNC does not support user specified keyboard mappings, so these will not be taken into account.
- When you upgrade to the next version of Abiquo, the noVNC component will be overwritten. During your upgrade, allow time to copy the noVNC component to the client-premium or UI webapp of the new version and to test the configuration.
...
Code Block |
---|
# gem install "mime-types" -v '1.25'
# gem install rest-client -v '1.6.8'
# gem install nokogiri -v '1.5.10' |
...
Code Block |
---|
# VNC Proxy (set to run every minute in the example) * * * * * root /root/novnc_tokens.rb -a http://10.60.13.4/api -u admin -p xabiquo >-f /opt/websockify/config.vnc |
The script requires 3 4 parameters:
- -a: The API URL to connect to. Should be the same as abiquo.server.api.location property in abiquo.properties file.
- -u: The username that will be used to interact with the API. Requires CLOUD_ADMIN role.a role with next privileges:
- USERS_MANAGE_ENTERPRISE, ENTERPRISE_ADMINISTER_ALL, VDC_ENUMERATE, VAPP_CUSTOMIZE_SETTINGS
- -p: The password for the userthe user.
- -f: The file the results will be written too.
The output is then redirected to a file that will be used as a config file for the websockify daemon. This file will contain one line for each VM with the format "HASH: DST_IP:DST_PORT":
...
Code Block |
---|
# wget https://raw2raw.githubgithubusercontent.com/abiquo/noVNC/master/websockify -O /etc/init.d/websockify --2014-02-18 09:42:07-- https://raw2.github.com/abiquo/noVNC/master/websockify Resolving raw2.github.com... 185.31.16.133 Connecting to raw2.github.com|185.31.16.133|:443... connected. HTTP request sent, awaiting response... 200 OK Length: 1434 (1,4K) [text/plain] Saving to: `/etc/init.d/websockify' 100%[=====================================================================================================================>] 1.434 --.-K/s in 0s 2014-02-18 09:42:11 (5,45 MB/s) - `/etc/init.d/websockify' saved [1434/1434] # chmod +x /etc/init.d/websockify # chkconfig websockify on # service websockify start |
...
Code Block |
---|
# wget https://raw2raw.githubgithubusercontent.com/abiquo/noVNC/master/websockify-ssl -O /etc/init.d/websockify --2014-02-18 09:45:33-- https://raw2.github.com/abiquo/noVNC/master/websockify-ssl Resolving raw2.github.com... 185.31.17.133 Connecting to raw2.github.com|185.31.17.133|:443... connected. HTTP request sent, awaiting response... 200 OK Length: 1554 (1,5K) [text/plain] Saving to: `/etc/init.d/websockify' 100%[=====================================================================================================================>] 1.554 --.-K/s in 0,001s 2014-02-18 09:45:35 (1,12 MB/s) - `/etc/init.d/websockify' saved [1554/1554] |
...
Replacing TightVNC applet with noVNC in the client-premium webapp
Download the noVNC distribution package from: http://kanaka.github.com/noVNC
Note that this is the same package we used for the websockify
...
To replace the tightvnc applet without changing any code in Abiquo, we will need to rename tightvnc to back up this file and replace the tightvnc file with the noVNC one.
Code Block |
---|
Code Block |
ABIQUO 2.6 or below: # cp -r kanaka-noVNC-c2b1409 /opt/abiquo/tomcat/webapps/client-premium/ # cd /opt/abiquo/tomcat/webapps/client-premium/ ABIQUO 3.0: # cp -r kanaka-noVNC-c2b1409 /var/optwww/abiquohtml/tomcatui/webappslib/client-premiumremoteaccess/ # cd /var/optwww/abiquohtml/tomcatui/webappslib/client-premium/remoteaccess/ BOTH VERSIONS: # mv tightvnc tightvnc.old # mv kanaka-noVNC-c2b1409 tightvnc |
...
Note that the name of the extracted directory might change as new versions are released, as can the noVNC files. We will use the vnc_auto.html file from noVNC but with some changes. Place the tightvnc.html file under:
/opt/abiquo/tomcat/webapps/client-premium/tightvnc/ in Abiquo 2.6 and below
or
/var/www/html/ui/lib/remoteaccess/tightvnc/ in Abiquo 3.0
Now you will need to edit this file to suit your environment. Edit the file and change the following values to contain the websockify public IP and port the proxy will be listening on:
host = "8.8.8.100";
port = 41337;
...
Tip |
---|
Note that if you use a balancer for your websockify proxies, you need to edit the tightvnc.html file in client-premium webappto point to the IP and port of the balancer. |
...