I run Debian Wheezy and have Xfce as my X-Window Manager on virtual console 7, which starts up automatically.

Once I've logged on and I'm using the xfce interface, is it possible for me to press Ctrl+Alt+F2 and move to another virtual console (non-X, console 2), and start an application in my, already running, x-session on console 7?

Also, can I do this remotely: say I have a laptop running Linux with Xfce running at home. Can I start an application on that instance of Xfce over ssh from work?

3 Answers 3


Yes, you can. The program needs the $DISPLAY environment variable. In some more complex linux distributions you also need 2 other variables $XAUTHORITY and $DBUS_SESSION_BUS_ADDRESS.

For example type in the terminal:

DISPLAY=:0 xterm 

If it is still not working export the 2 varibales:

export DBUS_SESSION_BUS_ADDRESS=unix:abstract=/tmp/dbus-LoSJ0EDrKV,guid=d46a103f4e55832818aa23c80000219c
export XAUTHORITY=/var/run/gdm/auth-for-user-6jbaaz/database

To find out the values of those variables, type echo VARIABLE in the graphic session.


On Ubuntu, that is very similar to Debian, you can do

DISPLAY=:0 xterm &

Also, after connecting to the ssh server you can perform the same command.


Yes, but Xfce is red herring. It is all about X11.

Any X11 application needs two things to connect to a display server (which provides keyboard, video and mouse to the application), it needs to know which server and it needs permission.

In the common case of connecting to the local X server it has the name :0 which means local host first display. In most cases you can tell your application the name of the server to use either on the command line (commonly -display or --display, but it may vary) or by setting the DISPLAY environment variable.

Authorization is typically provided in the ~/.Xauthority file, but if it is somewhere else the XAUTHORITY variable will tell you where.

You must log in to answer this question.

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