What execution environment does Nautilus have when clicking file?

I’ve noticed that Nautilus has a different execution environment when executing a file (via click) within Nautilus compared to doing so via a click on a desktop file.

E.g. If you click an executable on the desktop and then do the same thing via the Desktop folder within Nautilus there are different results.

It would really help to know what is different as I can’t work it out. There don’t appear to be any significantly different environment variables. Does executing within Nautilus allow the executable to adopt Nautilus’ AppArmor profile or something?

Specifically I’m testing an Electron AppImage which doesn’t work (due to this Ubuntu issue) when clicked on desktop or executed via terminal, but it does strangely work when clicked within Nautilus (within the Desktop folder).

[Ubuntu 24.04, Nautilus version 46.2]

What happens when you right click on nautilus window and select one of

  • Open in Terminal
  • Open in Console

and running it from there ?

It doesn’t work if I do that. It has the same issue in the link above, specfically:

FATAL:setuid_sandbox_host.cc(158)]
The SUID sandbox helper binary was found, but is not configured correctly.
Rather than run without sandboxing I'm aborting now. You need to make sure that /.... is owned by root and has mode 4755.
Trace/breakpoint trap (core dumped)

I know what the error means and what workarounds there are. But at the moment nautilus provides the most convenient work around for novice users, so it would be really useful to know why it works. As I’m developing the app and trying to support users.

Nautilus doesn’t handle desktop icons. If you have icons on your desktop those are provided by some Gnome Shell extension. IDK which extensions Ubuntu install by default.

I think Jon is referring to Click to Run (Right click → Menu → Run etc) feature offered by nautilus via GIO, which seems to work in nautilus, and not elsewhere (like in GNOME Shell launcher) etc.

FWIW, here is the patch list Ubuntu nautilus in 24.04.

"unity_launcher_support.patch" looks relevant. I didn’t check.

If that doesn’t help:

  1. Look into journalctl (as root) when it works vs when it fails, and see if there are any relevant errors (like AppArmor).

  2. If [1] doesn’t help, try in a different distro to check if it offers any clue.

I ran this test program from the desktop and from Nautilus:

#!/bin/bash
pid=$$
echo "PID = $pid" > ${pid}.txt
systemctl status $pid >> ${pid}.txt

From the desktop the pertinent part:

     CGroup: /user.slice/user-1000.slice/user@1000.service
             └─session.slice
               ├─org.gnome.Shell@x11.service
               │ ├─4112 /bin/bash /home/ubuntu/Desktop/test

And from Nautilus:

     CGroup: /user.slice/user-1000.slice/user@1000.service
             ├─app.slice
             │ ├─app-org.gnome.Terminal.slice
             │ │ └─vte-spawn-55004759-250d-4552-9c44-ae98f241ae88.scope
             │ │   └─4148 /bin/bash /home/ubuntu/Desktop/test

Maybe that holds a clue. I don’t know AppArmor. That seems more like a question for Ubuntu support.

This topic was automatically closed 45 days after the last reply. New replies are no longer allowed.