1、安装VNC服务
输入以下指令进行安装,
sudo apt install vino
sudo ln -s ../vino-server.service /usr/lib/systemd/user/graphical•session.target.wants
gsettings set org.gnome.Vino prompt-enabled false
gsettings set org.gnome.Vino require-encryption false
修改相对应的文件,
sudo vim /usr/share/glib-2.0/schemas/org.gnome.Vino.gschema.xml
把以下内容复制到该文件中,注意格式对应,
<key name='enabled' type='b'>
<summary>Enable remote access to the desktop</summary>
<description>
If true, allows remote access to the desktop via the RFB
protocol. Users on remote machines may then connect to the
desktop using a VNC viewer
</description>
<default>false</default>
</key>
编译一下,
sudo glib-compile-schemas /usr/share/glib-2.0/schemas
输入以下指令查询ip的UUID,
nmcli connection show
将UUID拷贝粘贴到如下命令的单引号[‘ ’]之间,并执行,
dconf write /org/gnome/settings-daemon/plugins/sharing/vino-server/enabled-connections "['e27c8ddd-b660-4e0b-a70d-78a39fd5c9c3 ']" export DISPLAY=:0
设置VCN登陆密码(此处设置密码为‘mima’),
gsettings set org.gnome.Vino authentication-methods "['vnc']"
gsettings set org.gnome.Vino vnc-password $(echo -n 'mima'|base64)
2、启动VNC
2.1、手动开启
终端输入,
/usr/lib/vino/vino-server
2.2、开机启动
终端输入,
gsettings set org.gnome.Vino enabled true
mkdir -p ~/.config/autostart
sudo vim ~/.config/autostart/vino-server.desktop
把以下内容复制到该文件中,
[Desktop Entry]
Type=Application
Name=Vino VNC server
Exec=/usr/lib/vino/vino-server
NoDisplay=true
保存后退出。
3、VNC远程登陆
VCN下载地址:Download the combined RealVNC Connect installer - RealVNC®
在Windows或者Linux下载安装VNC Viewer软件,
PC端与主板需要在同一个局域网下,打开VNC Viewer,
输入主板的ip地址,回车连接,连接成功后会提示输入密码,输入主板的登陆密码即可,成功登陆后,可以远程看到主板的桌面,进行图形化界面操作。