Ubuntu22.04 全程root用户
安装vnc和图形化界面
# 更新
apt update
# 安装桌面环境
sudo apt install xfce4 xfce4-goodies
# 安装vncserver
apt install tightvncserver
安装noVNC
git clone https://github.com/novnc/noVNC
cd ./noVNC/utils/
openssl req -new -x509 -days 365 -nodes -out self.pem -keyout self.pem
vim ~/.vnc/xstartup
#!/bin/sh
export XKL_XMODMAP_DISABLE=1
unset SESSION_MANAGER
unset DBUS_SESSION_BUS_ADDRESS
# Start Xfce desktop:
startxfce4 &
cd ~/.vnc
cd /tmp/
rm -rf X11
vncserver -geometry 1600x900 # vncserver :1
# noVNC/utils/novnc_proxy --vnc localhost:5901
# vncserver -kill :1
nohup noVNC/utils/novnc_proxy --vnc localhost:5902 >> nohup.log 2>&1 & echo $!>run.pid