Solved How to launch thunar as root under Wayland...

Hello to everyone.

I'm using wayland / wayfire and I want to launch thunar as root. So,I do :

Code:
marietto@marietto:~ $ echo $DISPLAY
:0

marietto@marietto:~ $ sudo thunar
Password:

thunar: Failed to initialize Xfconf:
Error tryng to execute spawn of the command line
«dbus-launch --autolaunch=133c826168597e33ba6fa82363ab0503 --binary-syntax --close-stderr»
Process child exited with code 1

Invalid MIT-MAGIC-COOKIE-1 key

(thunar:5550): Gtk-WARNING **: 11:37:56.933: cannot open display: :0

A workaround can be :

Code:
marietto@marietto:~ $ xhost +

access control disabled, clients can connect from any host

marietto@marietto:~ $ sudo thunar
DRI3 not available
failed to load driver: zink

like that thunar can be launched as root,but it does not seem a good solution...

Besides,something seems to be broken,looking at these error messages :

Code:
DRI3 not available
failed to load driver: zink
 
Two things, first sudo(8) strips the environment, so your DISPLAY variable is never passed. Second is your Xauthority, other users (including root) are simply not allowed to spawn applications on another user's X session. That would be a serious security risk. See xauth(1) and xhost(1).

One trick is to set DISPLAY yourself and copy the magic cookie from your user to root's Xauthority. Something like $ xauth extract $DISPLAY - | sudo -i xauth merge -
 
Code:
marietto@marietto:~ $ xauth extract $DISPLAY - | sudo -i xauth merge -

xauth: (argv):1:  bad display name "-" in "extract" command
No matches found, authority file ":0" not written
xauth: (argv):1:  unable to read any entries from file "(stdin)"
 
Because with "su" before doing "xauth merge /home/marietto/.Xauthority" I couldn't run any application.
 
No need. I've fixed it with :

Code:
marietto@marietto:~ $ xhost +
marietto@marietto:~ $ sudo su
[root@marietto /usr/home/marietto]==> xauth merge /home/marietto/.Xauthority
 
Back
Top