Can't open GUI programs as root

hi to all,
i can not resolve this problem:

when i try to start a GUI program which requires root privileges like yast, after insert root password, the password windows close and yast don’t start.

untill last udate i resolve this situation with command:

xhost +

now xhost + give me this output: xhost: unable to open display “”

i have search for many hours to understand what is appening and how i can resolve. Someone have some ideas?

thanks

How exactly are you trying to run them?

You cannot use sudo to run GUI programs as root in openSUSE, you need to use xdg-su, kdesu or gnomesu instead. (“su -” should work as well)

Also, are you using a Wayland session?
It doesn’t work in Wayland currently.
See http://bugzilla.opensuse.org/show_bug.cgi?id=955101
(though according to that, running “xhost +LOCAL:” or “xhost +” should make it work…)

PS: as xhost apparently cannot find the display, try to run it like this:

DISPLAY=:0 xhost +

HI wolfi323,
yes i running wayland, I have last version of thumbleweed with gnome.
All bug thath you have linked to me is setted like resolved, but In my case is not true.

i have try whit solution you have send to me and read in some bug that you have linked to me.


DISPLAY=:0 xhost +
access control disabled, clients can connect from any host

it seems is not this the problem, because is not an error messages anymore.

Now i try to explain whith details what i do:
I press windows key, start to write yast and click on yast icon.
after click it opens a GUI asking to me te root password.
After correct insertion, this little windows is close and yast don’t open.

https://ibb.co/dmgygG
https://ibb.co/dmgygG
https://ibb.co/dmgygG

In this window i can open details and inse is write a command, when i try to put in terminal, i found


/sbin/yast2             
Opzione -name sconosciuta
Run '/usr/lib/YaST2/bin/y2controlcenter-gnome --help' to see a full list of available command line options.

and i don’find issues like this in internets.

Well, that is your problem then.

All bug thath you have linked to me is setted like resolved, but In my case is not true.

It is set to RESOLVED FEATURE, which means that it is not really a bug but rather a missing feature that needs to be implemented yet, and a feature request has been opened instead on openFATE. (https://features.opensuse.org/322297)

i have try whit solution you have send to me and read in some bug that you have linked to me.

DISPLAY=:0 xhost +
access control disabled, clients can connect from any host

it seems is not this the problem, because is not an error messages anymore.

This will only help for applications being started from that very same terminal window.

So run xdg-su -c /sbin/yast2 directly afterwards, and it should start.

Note that “su” will not

Now i try to explain whith details what i do:
I press windows key, start to write yast and click on yast icon.

As mentioned, the above will not help if you try to start YaST from the application menu, which I understand you are doing here (I’m not using GNOME so I’m not sure what pressing windows key does there).

In this window i can open details and inse is write a command, when i try to put in terminal, i found

/sbin/yast2
Opzione -name sconosciuta
Run ‘/usr/lib/YaST2/bin/y2controlcenter-gnome --help’ to see a full list of available command line options.

Hm, this may be a different problem.
Try to uninstall yast2-control-center-gnome and install the standard one (yast2-control-center-qt) instead.
The GTK GUI got dropped years ago anyway.

AFAIK yast2-control-center-gnome only still exists to have a YaST icon in GNOME’s control center.