X applications won't run under sudo
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
sudo (Ubuntu) |
Confirmed
|
Undecided
|
Unassigned |
Bug Description
Binary package hint: sudo
Using the default configuration supplied by ubuntu 9.04 (except changed logfile), X applications do not run correctly under "sudo" or "sudu -E"
whitis@
No protocol specified
Error: couldn't open display :0.0
whitis@
No protocol specified
/var/lib/
warnings.
No protocol specified
Traceback (most recent call last):
File "/usr/bin/
gtk.
RuntimeError: could not open display
whitis@
Error: "/tmp/kde-whitis" is owned by uid 1000 instead of uid 0.
Error: "/tmp/ksocket-
Error: "/tmp/ksocket-
No protocol specified
kdeinit: Can't connect to the X Server.
kdeinit: Might not terminate at end of session.
Error: "/tmp/kde-whitis" is owned by uid 1000 instead of uid 0.
No protocol specified
kded: cannot connect to X server :0.0
DCOP aborting call from 'anonymous-14296' to 'kded'
No protocol specified
k3b: cannot connect to X server :0.0
DCOP aborting call from 'anonymous-14279' to 'k3b'
whitis@
/home/whitis/
whitis@
:0.0
whitis@
:0.0
whitis@
No protocol specified
leafpad: Cannot open display:
whitis@
*works*
whitis@
No protocol specified
xhost: unable to open display ":0.0"
su has the same problem.
/usr/bin/startx is identical to the version on my old debian system which did not have this problem.
changing DISPLAY to unix:0.0 doesn't help. gksudo fails in the same way. emacs falls back on its curses environment when it can't open the display.
xhost +root fails (claims root is an invalid hostname even though manpage says this is valid). xhost +root@ succeeds but doesn't fix problem. xhost +root@localhost succeeds but doesn't fix problem even if you use DISPLAY=
/home/whitis/
Since root has access to ~/.Xauthority, I didn't try the "xauth extract - $DISPLAY | ssh ... " method, and copying ~/.Xauthority to /root/.Xauthority didn't help, anyway.
X is sstarted with -auth /var/lib/
None of the usual fixes seem to work. Except for "xhost +" which is a really bad idea.
xhost +local:root does work. Not that the man page will tell you this.
This may be an X problem, not a sudo problem, but to the average user it will appear to be a sudo problem since ubuntu encourages people to use sudo rather than run as root. And other distributions do whatever setup is required to make this work.
ProblemType: Bug
Architecture: amd64
DistroRelease: Ubuntu 9.04
NonfreeKernelMo
Package: sudo 1.6.9p17-1ubuntu3
ProcEnviron:
LANG=en_US.UTF-8
SHELL=/bin/bash
SourcePackage: sudo
Uname: Linux 2.6.28-11-generic x86_64
Hi,
Hmm - X apps seem to work OK for me under sudo on Jaunty - including KDE apps like konsole and the glxgears you show.
(I'm in a Gnome session).
Dave