After I “upgraded” to Ubuntu 24.04, I had to install X in order to use xscreensaver, since Wayland is way too immature. This meant I couldn’t use the integrated VNC, so I had to install another one. I found a good starting point at forums.bunselnabs.org. I ended up making a few changes. First, I needed VNC and xscreensaver and needed to add it to the autostart:
$ sudo apt install x11vnc xscreensaver
$ mkdir ~/.x11vnc
$ x11vnc -storepassword mySecretPassword ~/.x11vnc/passwd
$ mkdir ~/.config/autostart
Then I created files much like those from BunsenLabs. I made a few changes to get things to work and to secure them.
[Desktop Entry]
Encoding=UTF-8
Type=Application
Name=X11VNC
Comment=Start the X11 VNC server
Exec=/usr/local/bin/x11vnc-start
StartupNotify=false
Terminal=false
Hidden=false
[Desktop Entry]
Encoding=UTF-8
Type=Application
Name=XSSVR
Comment=Start the X screensaver
Exec=/usr/local/bin/xscreensaver-start
StartupNotify=false
Terminal=false
Hidden=false
#!/bin/bash -
/usr/bin/xscreensaver -no-splash &
#!/bin/bash -
/usr/bin/x11vnc -forever -display "$DISPLAY" -rfbauth /home/"$USER"/.x11vnc/passwd &
Set up some good permissions:
$ sudo chmod 600 ~/.x11vnc/passwd
$ sudo chmod 700 ~/.x11vnc
$ sudo chmod 755 /usr/local/bin/xscreensaver-start
$ sudo chmod 755 /usr/local/bin/x11vnc-start
Disable Automatic Screen Lock in Gnome’s Privacy settings. Configure xscreensaver with xscreensaver-settings
.
Shutdown and restart to make sure it works — that you can VNC in, that VNC requires the right password, and that the screensaver comes on when expected. The autostart commands show up in Startup Applications, which is nice. I can also type capital letters on this VNC — I couldn’t do that on the 22.04 integrated VNC.