Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

recently I had deactivated lightdm since I don't want the Desktop Environment running and consuming RAM.

To accomplish that I had override the lightdm by creating the file:

#echo "manual" >/etc/init/lightdm.override

I would like to open some applications like firefox... and writter and other!.. But it keeps giving an error:

Error: can't open display: localhost:0.0

can anyone help? tkx in advance

share|improve this question
If i connect trhough ssh with X11 forwarding active it can export the windows! Why can't I open an application in tty? – b00ster Sep 24 '12 at 13:17

The applications you want to open depend on having an X Window System server active to handle graphics drawing and user input, and passing it to the application. X applications can NOT work standalone which seems to be what you want to do.

To understand a bit more about this you should read up on the X window system's architecture. One possible place to do it is this howto (it's somewhat outdated but the architectural principle is still the same):

If you don't want to start the graphical environment when you boot up, disabling lightdm is the way to go, but you will still need to start it if you want a graphical application to run. You can do so manually by using the startx command.

If your concern is about the graphical environment consuming too many resources, what you should do instead is install a more lightweight environment (like xfce) and select xfce session on lightdm.

share|improve this answer

You can edit your .xinitrc. Instead of putting in the lightDM executable, just put:


so that it does not try to run LightDM, nor terminate due to reaching end-of-file.

You can also tweak it to prompt whether you waht to run lightDM or not, but that is beyond the scope of this.

Save the file as .xinitrc in your home folder. Then, run startx, and switch back to a TTY. Run:

export DISPLAY=:0&&firefox

Now, it will both use X, but not lightDM, and will run.

share|improve this answer
returns the same error. echo $$ # return:1403 ps -ef |grep 1403 # return: myusername 1403 1200 0 12:30 tty1 00:00:04 -bash – b00ster Sep 24 '12 at 12:56
This will not work if the X server is not running as there is no X server to connect to, despite setting the DISPLAY variable. – roadmr Sep 24 '12 at 16:02
@roadmr Total rework of answer. – hexafraction Sep 24 '12 at 19:38

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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