2

Prerequisites, I installed:

sudo apt install dbus-x11
sudo apt-get install samba-common-bin
sudo mkdir /var/lib/samba/usershares

The following commands

xhost +SI:localuser:myOtherUser
sudo --user myOtherUser env DISPLAY=$DISPLAY nautilus
xhost -SI:localuser:myOtherUser

cause the following error:

(org.gnome.Nautilus:3806): dbind-WARNING **: 17:54:12.615: Couldn't connect to accessibility bus: Failed to connect to socket /run/user/1000/at-spi/bus: Permission denied
* Starting Nautilus Terminal

On a previous fresh install I already faced the above mentioned error, now it's there again on another Ubuntu 22.04.4 fresh install, see Failed to execute child process "dbus-launch" on 'Open in Terminal' (Ubuntu 22.04LTS) and Failed to execute child process "net" when entering Nautilus

Any ideas how I can get rid of the Permission denied error? Thanks in advance!

ssssstut
  • 939

2 Answers2

2

adding NO_AT_BRIDGE=1 to the command worked for me:

sudo --user myOtherUser env DISPLAY=$DISPLAY NO_AT_BRIDGE=1 nautilus
ssssstut
  • 939
1

It is just a warning but you can supress it, first create a script to wrap the dbus-launch command:

echo 'export NO_AT_BRIDGE=1' | sudo tee /usr/local/bin/dbus-launch-wrapper
echo '/usr/bin/dbus-launch "$@"' | sudo tee -a /usr/local/bin/dbus-launch-wrapper
sudo chmod +x /usr/local/bin/dbus-launch-wrapper

then modify your sudo command to use this wrapper script:

xhost +SI:localuser:myOtherUser
sudo --user myOtherUser env "DISPLAY=$DISPLAY" "PATH=/usr/local/bin:$PATH" nautilus
xhost -SI:localuser:myOtherUser
Saxtheowl
  • 2,394
  • 2
  • 12
  • 22