VNC with/without Display

Hello everyone,

Thanks a lot to @KevinFFF for sharing the dummy virtual display solution. We could be able to access our Jetson without display cable.

For the next step of this implementation, we wanted to modify the xorg.conf files dynamically.

  • When we connected a display cable, the xorg.conf file should be default one.
  • When we removed the cable, the xorg.conf file should use this dummy display config.

Let me explain what we have did:

We copied the default conf file as xorg.conf.bkp (before replacing the dummy one)
sudo cp /etc/X11/xorg.conf /etc/X11/xorg.conf.bkp

Then, we prepared the xorg.conf.dummy file and replaced it to the same folder
sudo mv xorg.conf.dummy /etc/X11/

If we connect a display cable and power up the Jetson, there is a device which located to /dev/fb0. If we remove the cable and reboot it, the device will gone.
To be able to check this device and replace the correct xorg.conf file in system reboot automatically, we added the following lines at the end of the /etc/systemd/nv.sh file (to be able to debug the result, we wrote the messages in /tmp/x11_config_selection.txt file):

#X11 config for VNC usage
if [ -f /etc/X11/xorg.conf.bkp ]; then
	if [ -f /etc/X11/xorg.conf.dummy ]; then
		if [ -c /dev/fb0 ]; then
			cp /etc/X11/xorg.conf.bkp /etc/X11/xorg.conf
			echo "Using default config file" > /tmp/x11_config_selection.txt
		else
			cp /etc/X11/xorg.conf.dummy /etc/X11/xorg.conf
			echo "Using 1080p dummy config file" > /tmp/x11_config_selection.txt
		fi
	else
		echo "/etc/X11/xorg.conf.dummy not found" > /tmp/x11_config_selection.txt
	fi
else
	echo "/etc/X11/xorg.conf.bkp not found" > /tmp/x11_config_selection.txt
fi

Afterwards, the system is configuring itself in each reboot with this implementation.

If you want to take a look at our latest script file, we included them in this archive below:
https://github.com/forecr/forecr_blog_files/raw/refs/heads/master/jetson_setting_up_vnc.zip

Thanks again @KevinFFF for sharing this solution. We are using the same implementation for both JetPack-5 and JetPack-6 versions without any issues.

Best Regards,
Mehmet

2 Likes

Thank you, Mehmet, for sharing your approach to dynamically switching Xorg configurations for those who require it.