When I am running some software using sudo
command it showing error like
cannot connect to X server
For example if I run the following command:
$ sudo gedit /etc/profile
I am getting following command
(gedit:6758): WARNING **: Command line `dbus-launch --autolaunch=84b871d735f31ffe014dc9ba00000009 --binary-syntax --close-stderr'
exited with non-zero exit status 1:
Autolaunch error: X11 initialization failed.
Cannot open display:
Run 'gedit --help' to see a full list of available command line options.
Or if I am running super-boot-manager
I am getting following error
buc: cannot connect to X server
Please help.
super-boot-manger
from? – Thor Aug 15 '12 at 09:49super-boot-manager
directly from unity luncher, it did not worked. Then I have tried it from terminal, then I got those error massage. – Apurba Aug 15 '12 at 13:21echo $DISPLAY
say? You should run it withoutsudo
assuper-boot-manager
runssudo
internally. – Thor Aug 15 '12 at 15:23echo $DISPLAY
is giving:0.0
. And I am not runningsuper-boot-manager
assudo
. I am running just using commandsuper-boot-manager
from terminal. – Apurba Aug 16 '12 at 19:36DISPLAY=$DISPLAY
in commandgedit
is not opening usingsudo
– Apurba Aug 16 '12 at 19:40buc
might be running as a different user, try removing the X restrictions withxhost +
. – Thor Aug 16 '12 at 19:51Defaults env_keep="DISPLAY XAUTHORITY"
at the end ofvisudo
. Thanks to all, specially @Thor for kind help. – Apurba Aug 17 '12 at 08:03sudoers
env_keep
. – Thor Aug 17 '12 at 08:09