Is it possible to somehow open an x application on another users display?

Say that i have user A who is logged on to the ubuntu desktop, and user B who is accessing the ubuntu machine via SSH.

I know that it is possible for user B to open an x application locally, but is it possible for user B to open a program (ie firefox) and have it displayed on user A's desktop session?

And if yes, how?


1 Answer 1


Yes, but it will depend on your xhost settings. So, if you have connected as userB to a machine that is running an X session owned by userA, you will need to do two things:

  1. userA must allow you access:

    userA@foo $ xhost +
  2. You need to set your DISPLAY variable to the remote display:

    userB@foo $ export DISPLAY=:0;

Now userB will be able to run graphical programs.

  • And that will make user B's xapp appear on user A's screen? Also, is DISPLAY=:0; the actual value, or do i have to do some reading to find out what to set it for? I would assume i would need to some IP address and user stuff there? Jun 4, 2013 at 14:45
  • @MartinNielsen yup. That's what you asked for isn't it?
    – terdon
    Jun 4, 2013 at 14:46
  • Yes... yes it was:) Jun 4, 2013 at 14:47
  • This questions has been asked already see here. Though in a not so clear fashion. Is it possible to merge? Or must one of them be tagged as duplicater?
    – wottis
    Jun 4, 2013 at 21:29
  • @wottis flag the question for moderator attention and leave them a message with the duplicate's link. They can choose to merge or not.
    – terdon
    Jun 5, 2013 at 1:53

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .