LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 07-29-2009, 01:57 AM   #1
balajir
LQ Newbie
 
Registered: Jul 2009
Posts: 4

Rep: Reputation: 0
cannot connect to x server


Hi,

I am new to linux and i want to run qt project in linux fedora 9..

Using PuttY software i am accessing the linux machine from my windows.

When i tried to run Qt-x11 project in linux it is showing error

"cannot connect to x server"

i tried to locate that

[root@localhost /]# locate Xserver
/etc/X11/xdm/Xservers
/etc/kde/kdm/Xservers
/usr/share/man/man1/Xserver.1.gz
[root@localhost /]#

and when i tried to start the x server it shows like this..

[root@localhost /]# startX
-bash: startX: command not found
[root@localhost /]# startx
xauth: creating new authority file /root/.serverauth.14699
xauth: creating new authority file /root/.Xauthority
xauth: creating new authority file /root/.Xauthority


Fatal server error:
Server is already active for display 0
If this server is no longer running, remove /tmp/.X0-lock
and start again.

Invalid MIT-MAGIC-COOKIE-1 keygiving up.
xinit: Resource temporarily unavailable (errno 11): unable to connect to X server
xinit: No such process (errno 3): Server error.
[root@localhost /]#

Kindly tell me what is the problem and how to solve this...

Thanks in advance,
Balaji.S.R
 
Old 07-29-2009, 02:05 AM   #2
micxz
Senior Member
 
Registered: Sep 2002
Location: CA
Distribution: openSuSE, Cent OS, Slackware
Posts: 1,131

Rep: Reputation: 75
- First off you should not run X programs as root as much as possible.
- Second off if you are on windows then you need to run an X server the to be able to forward X traffic to.
- Third in putty setting you will see Tunnels window. Click "Enable X11 forwarding". This will forward the X traffic to you local X server.
- Fourth looks like your running a X window session already on the box in question? hence "Server is already active for display 0"

Last edited by micxz; 04-29-2011 at 11:00 PM.
 
Old 07-29-2009, 02:25 AM   #3
balajir
LQ Newbie
 
Registered: Jul 2009
Posts: 4

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by micxz View Post
- Third in putty setting you will see Tunnels window. Click "Enable X11 forwarding". This will forward the X traffic to you local X server.
After enabling that i am getting error as

"sample: cannot connect to X server localhost:10.0"

Quote:
- Fifth this is not a windows forum you may get bumped to another forum section

If this is not the right forum then could you please tell me where i can find solution..

Thanks,
Balaji.S.R
 
Old 07-29-2009, 05:39 AM   #4
Nylex
LQ Addict
 
Registered: Jul 2003
Location: London, UK
Distribution: Slackware
Posts: 7,464

Rep: Reputation: Disabled
Have you installed an X server on the Windows machine? If not, then you need to do so. Xming is an X server for Windows. Start the server before running PuTTY and enable X11 forwarding as described above. You should be good to go after doing all that.
 
Old 07-30-2009, 04:07 AM   #5
balajir
LQ Newbie
 
Registered: Jul 2009
Posts: 4

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by Nylex View Post
Have you installed an X server on the Windows machine? If not, then you need to do so. Xming is an X server for Windows. Start the server before running PuTTY and enable X11 forwarding as described above. You should be good to go after doing all that.
Hi,

I installed xming and used PuttY.. it is working good.. Thanks for that...

Now I want to use in linux machine itself.. not in windows by using PuttY.. when i tried to run the same example, it is showing the same error..

"Cannot connect to Xserver"

Should i download and install xserver for linux also to run the qt examples..?

Kindly reply..
Thanks,
Balaji.S.R
 
Old 07-31-2009, 04:32 PM   #6
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682
Did you start the xserver (xming) on the windows side?
Maybe you don't realize, but a program you run in Linux is the X Windows client. The terminal is the X server. You don't even need X running on the remote server to run programs. Simply run the program without trying startx.

I haven't used xming but I have used cygwin/X. You may be able to bring the X root screen to the front. If so look at your DISPLAY variable in putty. If it is ":10.0" or ":11.0" you can start the desktop environment by running the appropriate command, such as "startkde" or "gnome-session". I'd recommend a light weight environment such as XFCE.

Make sure that putty is configured to work with X. Seeing the "display :10.0" message, it probably is.

---

If the Xming server isn't running, you may have the equivalent of "startx" installed on the windows machine to start up the Xming server. For cygwin/X it's called "startxwin.bat".
Run it locally, outside of the putty session.

Last edited by jschiwal; 07-31-2009 at 04:45 PM.
 
Old 08-01-2009, 01:51 AM   #7
Nylex
LQ Addict
 
Registered: Jul 2003
Location: London, UK
Distribution: Slackware
Posts: 7,464

Rep: Reputation: Disabled
Quote:
Originally Posted by balajir View Post
Now I want to use in linux machine itself.. not in windows by using PuttY.. when i tried to run the same example, it is showing the same error..

"Cannot connect to Xserver"

Should i download and install xserver for linux also to run the qt examples..?

Kindly reply..
Thanks,
Balaji.S.R
Yes, you'll need the X server installed on Linux if you want to run Qt programs, or any other graphical programs. It looked like you had X installed already and "startx" seemed to imply that the server was running (i.e. it said "Server is already active for display 0"). If that's still the case, then usually you use Ctrl+Alt+F7 to take you to X.

Also, do you have a regular user account? If not, I suggest you create one and use it for day-to-day stuff. There are many reasons not to use the root account all the time, do a search if you want to know more.
 
Old 08-04-2009, 12:09 AM   #8
balajir
LQ Newbie
 
Registered: Jul 2009
Posts: 4

Original Poster
Rep: Reputation: 0
Hi,

My simple project using phonon compiles and runs properly. The program is when i click the pushbutton a song must play with the seek slider.. when i click the button it is showing the following warning and aborted..

can anyone please tell me what the problem is...

[root@localhost multimedia]# ./multimedia
WARNING: Phonon needs QCoreApplication::applicationName to be set to export audio output names through the DBUS interface
ASSERT: "!name.isEmpty()" in file /builddir/build/BUILD/kdelibs-4.0.3/kdecore/kernel/kcomponentdata.cpp, line 71
Aborted
[root@localhost multimedia]#


also another question when i run musicplayer example from Qt examples it is showing messagebox like this..

"A required codec is missing. You need to install the following codec(s) to play this content: MPEG-1 Layer 3 (MP3)"
how to solve this..? if i need to install something means where to get these codecs for fedora 9..?

Kindly help me...

Thanks
Balaji.S.R

Last edited by balajir; 08-04-2009 at 01:18 AM. Reason: Append some more texts
 
Old 08-04-2009, 12:17 PM   #9
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682
Sound doesn't play on the local computer, it plays on the remote computer. That is where the program runs.

Linux distro's don't include mp3 codecs. You can add the rpmfusion repository for versions of your media programs that are built with mp3 support.
 
Old 04-29-2011, 06:35 PM   #10
darthaxul
Member
 
Registered: Aug 2008
Distribution: Devuan; Gentoo; FreeBSD
Posts: 236

Rep: Reputation: 19
when it says
Phonon needs QCoreApplication::applicationName to be set to export audio output names through the DBUS interface
QCoreApplication::applicationFilePath: Please instantiate the QApplication object first
it could be a variable is being set before main() or you need to set the applicationName in main()
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
realvnc server installed on fed9 attempting to connect to server from windows desktop nataloi Linux - General 1 04-21-2009 09:31 AM
Unix-connect: can't connect to server jrdioko Linux - Software 1 01-08-2006 04:56 PM
Suddenly unable to connect to my web server and my ftp server. HELP! Silly22 Linux - Software 4 05-23-2004 04:42 PM
Is samba required to connect to a Windows Advanced server from RedHat 8.0 server? NemesisStar Linux - Hardware 1 10-20-2003 12:32 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 01:35 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration