What is Novnc
NoVNC is a HTML5 VNC client with HTML 5 WebSockets, Canvas and JavaScript implementations, and NoVNC is commonly used in cloud computing, virtual machine control panels such as OpenStack Dashboard and Op Ennebula Sunstone all used NoVNC.
NoVNC is implemented with WebSockets, but most VNC servers currently do not support WebSockets, so NoVNC is not directly connected to the VNC server and requires an agent to convert between WebSockets and TCP sockets. This agent is in the NoVNC directory, called Websockify.
Experimental environment
- VMware Workstations
- CentOS7 Virtual machine with desktop
- Windows 10 host + Google Chrome browser
Shutting down the firewall
setenforce 0systemctl stop firewalldsystemctl disable firewalld
Installing NOVNC
Installing dependent Packages
yum install -y epel*yum install -y gityum install -y tigervnc-server
Execute the following command and enter the password to start the service
vncserver :1
Installing NOVNC
git clone git://github.com/kanaka/noVNC
Create a secure connection (go all the way down ...) )
cd ./noVNC/utils/openssl req -new -x509 -days 365 -nodes -out self.pem -keyout self.pem
Note: The default session of VNC is not secure and requires creating a secure VNC connection. The created certificate self.pem
needs to be placed in the noVNC/utils
directory, and Websockify will automatically load the certificate when NoVNC is started.
Run Novnc
# 在noVNC目录下,执行./utils/launch.sh --vnc localhost:5901
Test connection
In browser access (note Replace with your own IP address) http://192.168.204.10:6080/vnc.html
Enter the password, the connection is successful!
When there is a request to access VNC, the console displays the log
Installation script for CentOS 6
#!/bin/bash# stop selinux and iptablessetenforce 0service iptables stop# install vncserver and gityum install tigervnc-server git -yvncserver :1# 此时会提示输入密码# download noVNCgit clone git://github.com/kanaka/noVNC# create secure connectioncd ./noVNC/utils/openssl req -new -x509 -days 365 -nodes -out self.pem -keyout self.pem# run noVNCcd .././utils/launch.sh --vnc localhost:5901# running
Installation script for CentOS 7
#!/bin/bash# stop selinux and iptablessetenforce 0systemctl stop firewalldsystemctl disable firewalld# install vncserver and gityum install -y epel*yum install tigervnc-server git -yvncserver :1# 此时会提示输入密码# download noVNCgit clone git://github.com/kanaka/noVNC# create secure connectioncd ./noVNC/utils/openssl req -new -x509 -days 365 -nodes -out self.pem -keyout self.pem# run noVNCcd .././utils/launch.sh --vnc localhost:5901# running
CentOS installation Novnc, web-delivered VNC remote connection