1、安装xfce4
$ sudo apt update
$ sudo apt install xfce4 xfce4-goodies
安装完毕后会弹出Display Manager配置有以下两种选项:lightdm
和 gdm3,选择gdm3
2、安装TigerVNC
$ sudo apt install tigervnc-standalone-server
3、配置vnc
$ vncpasswd
使用vncpasswd配置用户密码
Password:
Verify:
Would you like to enter a view-only password (y/n)? n
密码及相关配置文件会存储于~/.vnc中
在~/.vnc中添加xstartup配置文件 并为其添加可执行权限
$ vim ~/.vnc/xstartup
#!/bin/sh
unset SESSION_MANAGER
unset DBUS_SESSION_BUS_ADDRESS
exec startxfce4
$ chmod u+x ~/.vnc/xstartup
4、启动停止vnc
可使用