環境:ubuntu 18.04.4
1.安裝vncserver
sudo apt install -y vnc4server
2.啓動vncserver
vncserver
輸入2次密碼
3.修改配置文件,紅色部分爲添加和修改內容
#!/bin/sh
# Uncomment the following two lines for normal desktop:
# unset SESSION_MANAGER
# exec /etc/X11/xinit/xinitrc
unset SESSION_MANAGER
unset DBUS_SESSION_BUS_ADDRESS
startxfce4 &
[ -x /etc/vnc/xstartup ] && exec /etc/vnc/xstartup
[ -r $HOME/.Xresources ] && xrdb $HOME/.Xresources
xsetroot -solid grey
#vncconfig -iconic &
x-terminal-emulator -geometry 80x24+10+10 -ls -title "$VNCDESKTOP Desktop" &
#x-window-manager &
至此可以遠程連接了
客戶端安裝好後直接連接就好了
參考鏈接地址: https://blog.csdn.net/fxb163/article/details/84193098