install noVNC on ubuntu
- User
install noVNC on ubuntu
- Assistant
install noVNC on ubuntu
To install noVNC, which is a JavaScript-based VNC (Virtual Network Computing) client running in a web browser, on an Ubuntu system, follow these steps:
First, open your terminal and make sure your system is updated:
sudo apt update && sudo apt upgrade -y
Install the necessary package dependencies such as tightvncserver, and other utilities:
sudo apt install -y tightvncserver x11-xserver-utils xfonts-base
Start the VNC server to create an initial configuration file:
vncserver
You might need to set a password and possibly create a view-only password.
Download and set up noVNC. There is no official Ubuntu package for noVNC, so we'll get it from the source:
# Create a directory for noVNC
sudo mkdir /opt/noVNC
# Download noVNC using git
sudo apt install git
cd /opt
sudo git clone https://github.com/novnc/noVNC.git noVNC
sudo git clone https://github.com/novnc/websockify noVNC/utils/websockify
The noVNC uses websockets to connect to the VNC server. Luckily, websockify is included as part of the noVNC utilities.
Start the websockify proxy to allow connections from noVNC to the VNC server:
cd /opt/noVNC/utils/
./launch.sh --listen 6080 --vnc localhost:5901
This command will start the proxy, listening on port 6080 and connect it to VNC server running on localhost:5901.
Open up a web browser and go to:
http://<your-ubuntu-server-ip>:6080/vnc.html
Replace <your-ubuntu-server-ip> with your actual server IP address or localhost if you're doing this locally.
On the noVNC login page, enter your VNC server credentials like the IP address localhost:5901 and the password you set up during the VNC server installation process.
For ease of use, you may want to configure systemd service for both vncserver and websockify so that they start automatically on boot.
Here is a basic systemd service template for websockify:
sudo nano /etc/systemd/system/websockify.service
[Unit]
Description=Start Websockify at startup
After=multi-user.target
[Service]
Type=simple
User=<username>
ExecStart=/usr/bin/python /opt/noVNC/utils/websockify/run --web /opt/noVNC --target localhost:5901 6080
[Install]
WantedBy=multi-user.target
Replace <username> with your username.
sudo systemctl daemon-reload
sudo systemctl enable websockify.service
sudo systemctl start websockify.service
That sets up noVNC on an Ubuntu system. This allows you to access your VNC server from a web browser without needing to install traditional VNC client software.
Not yet included in a published release.