Running GUI apps w sudo is allowed on Wayland?

To my knowledge I thought that Wayland specifications don’t allow running multiple privileges windows, till I tested on Ubuntu QEMU (since I can’t use Wayland on host --see NVIDIA) and these are my observations

On Silverblue 31 w Wayland (QEMU)

1. Running “sudo nautilus” will fail with:

 Error on getting connection: Failed to load SPARQL backend: Cannot autolaunch D-Bus without X11 $DISPLAY

Unable to init server: Could not connect: Connection refused

2. Running “nautilus admin://” will fail with:

 Error on getting connection: Failed to load SPARQL backend: Cannot autolaunch D-Bus without X11 $DISPLAY

Unable to init server: Could not connect: Connection refused

3. Opening “admin://” from location bar: It just works!

On Ubuntu 20.04 w Wayland (QEMU)

1. Running “sudo nautilus” will work:
but the window will use the XWayland backend, instead of native Wayland

Why?

Can someone please explain, whats the correct behavior?

  1. Can we open different user windows on Wayland?
  2. Why “sudo gui_app” works in Ubuntu but not in SIlverblue?
  3. Why “sudo gui_app” uses XWayland and not Wayland?

Oof, I think this was an unintended side effect of making running them as sudo work for X11 apps.

1 Like

@refi64 @alex285 sudo -E gui_app
Using sudo is not recommended. (I know, I know) Use admin:// whenever possible.

1 Like