You are not logged in.
Hi, I have a problem whenever I try to run X applications in root (gedit etc. that kinda thing), they run fine as a normal user, but whenever i run them with sudo or in a root terminal, I get:
No protocol specified
(gedit:4769): Gtk-WARNING **: cannot open display: :0
This happens regardless of whether I am in KDE or GNOME. Can anyone help me? thanks.
Offline
Use gksu or kdesu as user
pacman -S gksu
pacman -S kdebase-runtime
Last edited by SS4 (2011-04-05 15:07:53)
Rauchen verboten
Offline
Use gksu or kdesu as user
pacman -S gksu
pacman -S kdebase-runtime
Its not working, i've tried it with gedit and i get this:
(gedit:5881): GLib-GObject-WARNING **: invalid (NULL) pointer instance
(gedit:5881): GLib-GObject-CRITICAL **: g_signal_connect_data: assertion `G_TYPE_CHECK_INSTANCE (instance)' failed
(gedit:5881): Gdk-CRITICAL **: IA__gdk_screen_get_default_colormap: assertion `GDK_IS_SCREEN (screen)' failed
(gedit:5881): Gdk-CRITICAL **: IA__gdk_colormap_get_visual: assertion `GDK_IS_COLORMAP (colormap)' failed
(gedit:5881): Gdk-CRITICAL **: IA__gdk_screen_get_default_colormap: assertion `GDK_IS_SCREEN (screen)' failed
(gedit:5881): Gdk-CRITICAL **: IA__gdk_screen_get_root_window: assertion `GDK_IS_SCREEN (screen)' failed
(gedit:5881): Gdk-CRITICAL **: IA__gdk_screen_get_root_window: assertion `GDK_IS_SCREEN (screen)' failed
(gedit:5881): Gdk-CRITICAL **: IA__gdk_window_new: assertion `GDK_IS_WINDOW (parent)' failed
Last edited by bergqvistjl (2011-04-05 15:33:08)
Offline
your ~/.Xauthority file might have been deleted. Try rebooting and it should auto-generate the file I think.
There's no such thing as a stupid question, but there sure are a lot of inquisitive idiots !
Offline
your ~/.Xauthority file might have been deleted. Try rebooting and it should auto-generate the file I think.
OK well there wasn't an .Xauthority file for the root user, but there was for my normal user, which I deleted, i rebooted, it recreated the one for the normal user, didn't create anything for the root user, and I still get the same error. I've also tried it with other X programs and I get the same errors
Last edited by bergqvistjl (2011-04-05 15:44:57)
Offline
Have you read https://wiki.archlinux.org/index.php/Ru … ps_as_root ?
Offline
Have you read https://wiki.archlinux.org/index.php/Ru … ps_as_root ?
Yes. It was working fine before I installed KDE.
Offline
Anyone else got any ideas?
Last edited by bergqvistjl (2011-04-06 01:11:57)
Offline
Have you tried simply copying the regular user's .Xauthority file to root's home dir then running the app?
A temporary file is just a pipe with an attitude and a will to live.
Offline
You may probably want to try the "xauth" utility as well. It allows to edit and display the authorization information in the .xauthority file.
Have a look at "man xauth".
To know or not to know ...
... the questions remain forever.
Offline
Found again among my notes: Gtk-WARNING **: cannot open display. Maybe it helps.
Edit: and one more:
Run visudo
Add
env_keep+="DISPLAY XAUTHORITY"
to the Defaults line so it may look like:
Defaults !lecture,tty_tickets,!fqdn,env_keep+="DISPLAY XAUTHORITY"
Then sudo and gksudo won't mess up with 'Gtk-WARNING **: cannot open display:'
Last edited by bohoomil (2011-04-06 21:26:22)
:: Registered Linux User No. 223384
:: github
:: infinality-bundle+fonts: good looking fonts made easy
Offline