I'm trying to open netbeans as a different user, but isn't working. I'm running a Kubuntu 12.04 LTS with KDE.

And I tried the following: Open a terminal, type su - myotheruser, type the myotheruser password. Then tried to open netbeans: /opt/netbeans/7.3/bin/netbeans (netbeans is installed on /opt/netbeans/7.3).

I got the following:

Erro: Can't connect to X11 window server using ':0' as the value of the DISPLAY variable.

I tried some commands like export DISPLAY=":0.0", xhost +, xhost +local:all and other commands related here and here. None worked.

Is important to me that myother user not be in the sudoers file.

If I end the session with mycurrentuser and logon with the myotheruser I can easily open netbeans.

I need open netbeans as myotheruser because I would like to work on a project that belongs to this user and just to it. If I changes permissions, looks like when I versionnig the project the user will loose the exclusivity.

So, how can I solve this? How can I open netbeans as a different user inside of another user display?


You could always try the following:

ssh -Y otheruser@localhost "/opt/netbeans/7.3/bin/netbeans"


  • Thx a lot, works @tink. – GarouDan May 5 '13 at 23:28

I use gksu:

gksu -u myotheruser /opt/netbeans/7.3/bin/netbeans

Maybe try also kdesu.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.