Jetson Nano: Enabling headless VNC connection on JetPack 4.4 (Incl. installing Xfce and TigerVNC Server)

Problem: GNOME and VNC don’t seem to like each other on Jetpack OS. I only get the nVidia logo when connecting and can’t do anything.

Solution: Use the alternative desktop environment Xfce for use with VNC.

Required:

  • Access to a terminal (e.g. via SSH) on the Jetson
  • sudo permissions
  • internet connection on Jetson Nano (for installing packets)
  • a VNC Client on a device that is on the same network as the Jetson Nano for testing

Disadvantage: 2 desktop environments running at the same time -> Both consume some memory.

Note: After following this guide, when connecting an HDMI monitor, it will still display the normal (Gnome?) desktop (The one with the „electric/neuron green“ nVidia wallpaper).

Disclaimer: This guide is mostly a copy of klicker100’s post here: https://forums.developer.nvidia.com/t/ubuntu-internal-error-when-selecting-desktop-sharing-in-settings/72163/2

  1. Install TigerVNC server:
$ sudo apt install tigervnc-standalone-server tigervnc-xorg-extension -y
  1. Set a password for the VNC server:
$ vncpasswd
  1. Create the file “$HOME/.vnc/xstartup” with the following content: I changed this part, because I got only a grey screen and an X as a cursor and nothing else. This version, which works for me, is from here: https://www.raspberrypi.org/forums/viewtopic.php?t=216725 (2nd post)
#!/bin/sh
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 &
  1. Create the empty file “.Xresources” in your user’s home directory:
    Replace the word „jetson“ with your user
$ touch /home/jetson/.Xresources
  1. Create the file “/etc/systemd/system/vncserver@.service” with the following content:
    Replace the word „jetson“ with your user
[Unit]
Description=Start TightVNC server at startup
After=syslog.target network.target

[Service]
Type=forking
User=nvidia
Group=nvidia
WorkingDirectory=/home/jetson
PIDFile=/home/jetson/.vnc/%H:%i.pid
ExecStartPre=-/usr/bin/vncserver -kill :%i > /dev/null 2>&1
ExecStart=/usr/bin/vncserver -localhost no -depth 24 -geometry 1280x720 :%i
ExecStop=/usr/bin/vncserver -kill :%i

[Install]
WantedBy=multi-user.target
  1. Make sure the VNC server starts after system boot:
$ sudo systemctl daemon-reload
$ sudo systemctl enable vncserver@1
  1. Configure auto-login with GDM3. Open “/etc/gdm3/custom.conf” and uncomment or change the following lines:
AutomaticLoginEnable=true
AutomaticLogin=nvidia
  1. Reboot the system and try to reach the VNC server at port 5901.

Schreibe einen Kommentar

Deine E-Mail-Adresse wird nicht veröffentlicht. Erforderliche Felder sind mit * markiert