LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Ubuntu
User Name
Password
Ubuntu This forum is for the discussion of Ubuntu Linux.

Notices


Reply
  Search this Thread
Old 04-06-2015, 04:14 AM   #1
sridhar_ratna
LQ Newbie
 
Registered: Apr 2015
Posts: 2

Rep: Reputation: Disabled
Gtk-WARNING **: cannot open display


Hi,
I have centos 6 minimal (headless) as a Host and installed ubuntu 14.04 Desktop as a guest and using KVM.
There is a web application deployed inside Guest, and it opens and closes one GTK application (javafx) in background.
I am invoking this web app from my host thru ssh as "curl http://guest/myapp/start"
I observed the logs in Guest OS and see the error message "Gtk-WARNING **: cannot open display"

I didn't understand the reason for this error.
1) This GTK app is not opening any window physically in ssh console on host and moreover it's background.
2) Guest is desktop version.

Can any one help me how to resolve this. I can't enable XWindows due to security requirements by the client.

Thanks,
Sridhar


update 14-Apr-2015
==================
This is solved using xvfb and the following url helped me a lot
http://www.installationpage.com/sele...fox-in-ubuntu/

Last edited by sridhar_ratna; 04-14-2015 at 04:32 AM.
 
Old 04-06-2015, 05:41 PM   #2
Keith Hedger
Senior Member
 
Registered: Jun 2010
Location: Wiltshire, UK
Distribution: Void, Linux From Scratch, Slackware64
Posts: 3,150

Rep: Reputation: 856Reputation: 856Reputation: 856Reputation: 856Reputation: 856Reputation: 856Reputation: 856
All gtk apps have to call gtk_init() before using any gtk functions, gtk_init checks for a sane environmemt and some other stuff, if it can't find a valid display it will error out even before trying to open a window, if you inable x forwading in the ssh config file and use the '-X' option to ssh you should be good to go.
 
1 members found this post helpful.
Old 04-14-2015, 04:45 PM   #3
Keith Hedger
Senior Member
 
Registered: Jun 2010
Location: Wiltshire, UK
Distribution: Void, Linux From Scratch, Slackware64
Posts: 3,150

Rep: Reputation: 856Reputation: 856Reputation: 856Reputation: 856Reputation: 856Reputation: 856Reputation: 856
Thanks Keith, that's the solution.
You're welcome, any time.
Sheesh! What happened to common courtesy!
 
  


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
[SOLVED] Gtk-warning: cannot open display: Vkthor Ubuntu 7 02-04-2011 08:06 PM
export display and Gtk-WARNING **: cannot open display: zimma Linux - Server 0 04-24-2009 02:51 AM
Gtk-WARNING **: cannot open display elfoozo DamnSmallLinux 3 07-12-2007 09:41 PM
Gtk-WARNING **: cannot open display: a_l_a_n Linux - General 5 03-31-2007 03:44 PM
Gtk-WARNING **:Cannot Open Display. Mark_in_Hollywood Linux - Newbie 2 05-09-2006 09:44 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Ubuntu

All times are GMT -5. The time now is 04:30 PM.

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