文章摘要: 解决了不接显示屏时VNC黑屏的问题


硬件平台:Jetson Nano
操作系统:Ubuntu 18.04


安装vino:

sudo apt install vino

配置VNC server:

gsettings set org.gnome.Vino prompt-enabled false
gsettings set org.gnome.Vino require-encryption false

设置enabled参数: /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>

设置为Gnome模式:

sudo glib-compile-schemas /usr/share/glib-2.0/schemas

设置VNC登陆密码: 123456

$ gsettings set org.gnome.Vino authentication-methods "['vnc']"
$ gsettings set org.gnome.Vino vnc-password $(echo -n '123456'|base64)

设置开机自启动VNC

gsettings set org.gnome.Vino enabled true

设置自动启动脚本:
在~/.config/autostart或者/etc//autostart中新建文件vino-server.desktop

[Desktop Entry]
Type=Application
Name=Vino VNC server
Exec=/usr/lib/vino/vino-server
NoDisplay=true

注意事项: 必须在autostart中启动,而不能在systemd中启动。


设置用户自动登陆:
修改/etc/gdm3/custom.conf文件

[daemon]
# Enabling automatic login
AutomaticLoginEnable = true
AutomaticLogin = nvidia