ubuntu22配置NoVNC_Linux配置web网页桌面访问

Ubuntu22.04.2LTS配置noVNC

系统版本:

PRETTY_NAME="Ubuntu 22.04.3 LTS"
NAME="Ubuntu"
VERSION_ID="22.04"
VERSION="22.04.3 LTS (Jammy Jellyfish)"
VERSION_CODENAME=jammy
ID=ubuntu
ID_LIKE=debian
HOME_URL="https://www.ubuntu.com/"
SUPPORT_URL="https://help.ubuntu.com/"
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
UBUNTU_CODENAME=jammy

安装并配置tigerVNC:

apt install -y tigervnc-standalone-server
配置VNC_server (希望用哪个用户登录,就su到该用户配置)
vncpasswd #配置VNC密码。(最后一步是否配置仅浏览密码,这里选择否)
  root@master:~# vncpasswd 
  Password:
  Verify:
  Would you like to enter a view-only password (y/n)? n
  A view-only password is not used

vncserver #启动vnc服务
  root@master:~# vncserver
  New Xtigervnc server 'master:1 (root)' on port 5901 for display :1.
  Use xtigervncviewer -SecurityTypes VncAuth -passwd /root/.vnc/passwd :1 to connect to the VNC server.

vncserver -list #查看全部vnc会话
  root@master:~# vncserver -list
  TigerVNC server sessions:
  X DISPLAY #	RFB PORT #	RFB UNIX PATH	PROCESS ID #	SERVER
  1         	5901      	             	2213        	Xtigervnc

vncserver -kill :1 #关闭某个会话
  root@master:~# vncserver -kill :1
  Killing Xtigervnc process ID 2213... success!

noVNC下载&配置

下载地址 https://github.com/novnc/noVNC
下载后解压:
- 启动noVNC
#./noVNC/utils/novnc_proxy --vnc localhost:5901
  root@master:/# ./utils/novnc_proxy --vnc localhost:5901
  Warning: could not find self.pem
  Using local websockify at /opt/noVNC/noVNC/utils/websockify/run
  Starting webserver and WebSockets proxy on port 6080
  /opt/noVNC/noVNC/utils/websockify/websockify/websocket.py:31: UserWarning: no 'numpy' module, HyBi protocol will be slower
    warnings.warn("no 'numpy' module, HyBi protocol will be slower")
  WebSocket server settings:
    - Listen on :6080
    - Web server. Web root: /opt/noVNC/noVNC
    - No SSL/TLS support (no cert file)
    - proxying from :6080 to localhost:5901


  Navigate to this URL:

      http://master:6080/vnc.html?host=master&port=6080

  Press Ctrl-C to exit

访问noVNC
浏览器通过示例地址即可访问noVNC:http://serverIP:6080/vnc.html
http://192.168.106.133:6080/vnc.html

效果展示:


相关简介:

VNC(Virtual Network Computing):是一使用RFB协议的屏幕画面分享及远程操控软件。此软件可借助网络,发送键盘与鼠标的动作及即时到屏幕信息。

noVNC :the open source VNC client - noVNC is both a VNC client JavaScript library as well as an application built on top of that library. noVNC runs well in any modern browser including mobile browsers (iOS and Android).

posted on 2024-01-15 19:08  我,在等待  阅读(1197)  评论(0)    收藏  举报