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
  • 667

2 Answers2

1

adding NO_AT_BRIDGE=1 to the command worked for me:

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

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
  • 1,739
  • 2
  • 10
  • 20
  • Sorry to ask again, after having created the wrapper script (file is existing: /usr/local/bin/dbus-launch-wrapper) and using the modified sudo command for the display the warning still is in my console. I think I'm using it somehow wrongly – ssssstut Mar 28 '23 at 20:14
  • I meant if I call the wrapper script with my sudo command script as parameter /usr/local/bin/dbus-launch-wrapper ./start-nauth.sh --> Warning in the console – ssssstut Mar 28 '23 at 20:31