LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   "Cannot open display" error when trying to start X Server Applications (https://www.linuxquestions.org/questions/linux-newbie-8/cannot-open-display-error-when-trying-to-start-x-server-applications-694547/)

Endoro 01-02-2009 02:31 PM

"Cannot open display" error when trying to start X Server Applications
 
Hi

I'm using slackware (12.2). I've been using linux before but only with a graphical interface, and I now want to "switch" to using only the terminal. I have a graphical interface installed (KDE) but I don't want to use it more than necessary (just now when I'm learning to use the terminal).

The problem is that I can't start graphical applications from the shell. When I for example tries to start firefox or XTerm I get the error "cannot open display :0".

First I got the message "no display specified" but after reading the man-pages I set DISPLAY to ":0". I've also tried setting it to ":0.0", "localhost:0" and "localhost:0.0" but nothing works.

Any ideas?

Thanks // Endoro

edit: sorry for the title... I mean X Window System ofcourse. I dunno where I got "server" from

Endoro 01-02-2009 03:20 PM

I solved it by running xinit first... Is that the "right" way to do?

Didier Spaier 01-02-2009 03:24 PM

The problem is, Firefox as well as Xterm need an X server to work.

But when you are at runlevel 3 you don't use an X server.

So yo will have to start X before you launch one of theses apps. There are at least two ways to do that, second one being easier:
1) as root type:
telinit 4
You'll go to runlevel 4 (graphical mode).
When you are finished you could issue (still as root):
telinit 3
to go back to runlevel 3 (text mode).

2) as a regular user type:
startx
That will launch the windows manager or desktop that user did choose with xwmconfig.
To go back to runlevel 3 (text mode) use the shortcut: Ctrl+Alt+Backspace


All times are GMT -5. The time now is 10:52 PM.