Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

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

2 Answers 2

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): http://tldp.org/HOWTO/XWindow-Overview-HOWTO/index.html

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:

cat

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
1  
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

 
discard

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.