Windows access noVNC (web-based remote desktop) through a browser

Table of contents

1. What are VNC and noVNC?

2. Install and configure noVNC on Windows 10

2.0, Notes

2.1. Download UltraVNC

2.2. Download Node.js

2.3. Download and install git

2.4. Create a folder to store files

2.5. Install ws, optimist, mime-types modules (required to execute the websockify.js file)

2.6, download noVNC, download websockify-js

2.7. Modify the websockify.js file

 2.8. Check the host IP of your computer

2.9, execute websockify.js

3. Results display


1. What are VNC and noVNC?

VNC (Virtual Network Console) is the abbreviation of virtual network console. It is divided into two parts: server and client. After the deployment is completed, it can be used with simple configuration on the server, based on TCP communication. The noVNC project achieves client webization by canceling the installation of the VNC Client, directly accessing noVNC through a browser, and then indirectly accessing the VNC server through noVNC. The VNC server always handles TCP traffic, but the browser and noVNC use WebSocket to interact on the basis of http. Since the VNC server cannot handle websocket traffic, websockify, a sister project of noVNC, is introduced to convert WebSocket traffic into ordinary TCP streams so that the VNC server can work  normally  . noVNC is actually an APP in HTML form, and websockify acts as a mini web server. When accessed by a browser, it will load and run noVNC through the network.

2. Install and configure noVNC on Windows 10

2.0, Notes

I will upload the UltraVNC and Node.js installation packages of the same version as mine, which can be downloaded for free, and the required credits are 0.

UltraVNC installation package download:

UltraVNC installation package resource - CSDN library https://download.csdn.net/download/weixin_58448088/87626312?spm=1001.2014.3001.5503 Node.js installation package download:

node.js (v16.16.0) installation package resource - CSDN library https://download.csdn.net/download/weixin_58448088/87626324?spm=1001.2014.3001.5503

2.1. Download UltraVNC

Home - UltraVNC VNC OFFICIAL SITE, Remote Desktop Free Opensource (uvnc.com)https://uvnc.com/

Select the version you want to download, select the download path, and install it in a fool-like way, just keep going to next.

After installation, find the installation folder, find the right mouse button of uvnc_settings.exe, click to run as an administrator, and the following page will pop up, the first one is the default port number, the second one sets the remote access VNC password, and sets the remote only view password.

2.2. Download Node.js

Download node.js to execute websockify.js

Configuring Node.js environment variables

2.3. Download and install git

Git installation and use_git installation and use_Wang Zhaowujun's blog-CSDN blog introduces how to install git tools in detail, and teaches you step by step how to create remote warehouses and remote warehouse branches, how to resolve code conflicts, how to rollback versions, and how to clone code https://blog.csdn.net/weixin_58448088/article/details/123187457?spm=1001.2014.3001.5501

2.4. Create a folder to store files

Create a new VNC folder on the D drive to store the files required by noVNC

2.5. Install ws, optimist, mime-types modules (required to execute the websockify.js file)

Open cmd, and enter the VNC folder under the D drive, execute the following command

npm install ws
npm install optimist
npm install mime-types

After installing these modules, the following files will be automatically generated in the VNC file

2.6, download noVNC, download websockify-js

Enter the node_modules folder in the VNC file, right mouse button and select Git Bash Here

 Enter the following window and download noVNC and websockify-js through git

git clone https://github.com/novnc/noVNC

git clone https://github.com/novnc/websockify-js.git

2.7. Modify the websockify.js file

Modify websockify.js in D:\VNC\node_modules\websockify-js\websockify, will

filename += '/index.html';

changed to

filename += '/vnc.html';

 2.8. Check the host IP of your computer

Open cmd and enter the following command line, as shown in the figure, the red circle is the host IP

ipconfig

2.9, execute websockify.js

Explain the whole process. I install UltraVNC (provide VNC Server), and then execute websockify.js through node in VNC Server: forward the http link of port 9000 to port 5900, and noVNC can run normally.

Open cmd and enter the following command to start the proxy service:

node D:\VNC\node_modules\websockify-js\websockify\websockify.js --web D:\VNC\node_modules\noVNC 8000 localhost:5900

 Command line explanation:

node  // 使用node执行websockify.js
D:\VNC\node_modules\websockify-js\websockify\websockify.js // websockify.js文件路径
 --web D:\VNC\node_modules\noVNC // noVNCD文件路径
8000 // 启动端口为8000,这个可以自己设,不一定就是8000
localhost:5900 // 转发的VNC地址和端口

3. Results display

3.1. Enter http://host ip:start port/vnc.html in the browser

Example:

http://172.16.8.107:8000/vnc.html

3.2. After entering the URL, enter the following page and click the link

3.3. Click the connection to jump to the following page, enter the remote access VNC password set before, and press Enter

 3.4. Successfully connected to the machine

3.5. After connecting, do not close the cmd, but keep the web server proxy service open all the time

 

 3.6, close the proxy service, ctrl+c

Guess you like

Origin blog.csdn.net/weixin_58448088/article/details/129834143