DISPLAY environment variable


can anybody help with this issue. I searched for information but nothing.
Any sudo command I execute, I get:

Error no display name and no $DISPLAY environment variable.

I saw in information center -> server X that the name value is “:0”. Is it correct?
I tried to set the environment variable in the /etc/environment to DISPLAY=localhost:0 but without success.
Any suggestion?

If it could be of some help, I forgot to mention that I run openSUSE with VirtualBox.

Thanks a lot.


You cannot use sudo to run graphical applications in openSUSE (with the default setup at least).

Use kdesu, gnomesu, or xdg-su instead, or “su -”.

Ah ok, I see, good to know.
Thanks a lot.