I want to reset my Ubuntu 22.04 desktop settings over a vnc terminal (Uubntu 22.04 is running TigerVNC.) I followed instructions at https://linuxhint.com/ubuntu_dock_settings/ and backed up the current desktop settings using
$ dconf dump / > backup.txt
However, when I try to reset the desktop settings using
dconf reset -f /
I get the following error.
error: Error spawning command line “dbus-launch --autolaunch=c7014a22ae9647b69f20ea2bbc28bec4 --binary-syntax --close-stderr”: Child process exited with code 1
I noticed that my ~/.vnc/xstartup file included unset DBUS_SESSION_BUS_ADDRESS
(I copied the xstartup file from https://bytexd.com/how-to-install-configure-vnc-server-on-ubuntu/). Here are the contents of the xstarup file.
#!/bin/sh
unset SESSION_MANAGER
unset DBUS_SESSION_BUS_ADDRESS
[ -x /etc/vnc/xstartup ] && exec /etc/vnc/xstartup
[ -r $HOME/.Xresources ] && xrdb $HOME/.Xresources
gnome-session
I commented out the unset DBUS_SESSION_BUS_ADDRESS
, restarted the vncserver, and reconnected from a vnc client. But DBUS_SESSION_BUS_ADDRESS is still unset / undefined. I still get the same error when running dconf reset-f /
.
Next, I commented out the unset DBUS_SESSION_BUS_ADDRESS
line and added the following to the xstartup file just before the gnome-shell invocation and restarted the vncserver.
if test -z "$DBUS_SESSION_BUS_ADDRESS" ; then
eval `dbus-launch --sh-syntax --exit-with-session`
echo "D-BUS per-session daemon address is: \
$DBUS_SESSION_BUS_ADDRESS"
fi
However, DBUS_SESSION_BUS_ADDRESS is still unset. Still the same error from the dconf reset -f /
command.
At this point, I entered the following command in a terminal over vnc.
dbus-launch --sh-syntax --exit-with-session
This command responded with the following.
DBUS_SESSION_BUS_ADDRESS='unix:abstract=/tmp/dbus-wSUKXx6r0W,guid=3d557317b8f0a468242814d8636956e6';
export DBUS_SESSION_BUS_ADDRESS;
DBUS_SESSION_BUS_PID=4709;
However, DBUS_SESSION_BUS_ADDRESS is still unset / undefined in the terminal. And I still can't reset Ubuntu desktop settings.
Any ideas?