LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Debian
User Name
Password
Debian This forum is for the discussion of Debian Linux.

Notices


Reply
  Search this Thread
Old 05-12-2010, 03:03 PM   #1
toxine
Member
 
Registered: May 2010
Distribution: Ubuntu/CentOs
Posts: 33

Rep: Reputation: 3
Gtk-WARNING **: cannot open display: :0.0


Hello

Im trying to access gparted, i get an error
Quote:
(gpartedbin:4918): Gtk-WARNING **: cannot open display:
I am connect via vnc if this helps.

thanks.

Last edited by toxine; 05-12-2010 at 06:51 PM.
 
Old 05-12-2010, 03:21 PM   #2
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1984Reputation: 1984Reputation: 1984Reputation: 1984Reputation: 1984Reputation: 1984Reputation: 1984Reputation: 1984Reputation: 1984Reputation: 1984Reputation: 1984
not vnc related, it's probably becuase you're su'd to root without having run "xhost +localhost" as the owner of the vnc server itself.
 
Old 05-12-2010, 03:32 PM   #3
toxine
Member
 
Registered: May 2010
Distribution: Ubuntu/CentOs
Posts: 33

Original Poster
Rep: Reputation: 3
thanks for the fast reply, so how can i fix this?
do i log on vnc as user, run "xhost +localhost" in terminal as user then run gparted as a root?
 
Old 05-12-2010, 03:38 PM   #4
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1984Reputation: 1984Reputation: 1984Reputation: 1984Reputation: 1984Reputation: 1984Reputation: 1984Reputation: 1984Reputation: 1984Reputation: 1984Reputation: 1984
yep, that's the one. There are other reasons for this, but this, especially when asked on a forum is 99% this.
 
1 members found this post helpful.
Old 05-12-2010, 03:38 PM   #5
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1984Reputation: 1984Reputation: 1984Reputation: 1984Reputation: 1984Reputation: 1984Reputation: 1984Reputation: 1984Reputation: 1984Reputation: 1984Reputation: 1984
BTW, vnc is awful in every way, I'd *VERY* strongly suggest a decent solution like nx
 
1 members found this post helpful.
Old 05-12-2010, 03:54 PM   #6
toxine
Member
 
Registered: May 2010
Distribution: Ubuntu/CentOs
Posts: 33

Original Poster
Rep: Reputation: 3
Quote:
Originally Posted by acid_kewpie View Post
yep, that's the one. There are other reasons for this, but this, especially when asked on a forum is 99% this.
I actually tried the xhost solution before posting but didn't work , i just wanted to confirm that im doing it correctly.

I tried "export DISPLAY=:0.0" too, doesn't work either

Quote:
user@server:~$ xhost +localhost
localhost being added to access control list
X Error of failed request: BadValue (integer parameter out of range for operation)
Major opcode of failed request: 109 (X_ChangeHosts)
Value in failed request: 0x6
Serial number of failed request: 9
Current serial number in output stream: 13
X Error of failed request: BadValue (integer parameter out of range for operation)
Major opcode of failed request: 109 (X_ChangeHosts)
Value in failed request: 0x6
Serial number of failed request: 10
Current serial number in output stream: 13
X Error of failed request: BadValue (integer parameter out of range for operation)
Major opcode of failed request: 109 (X_ChangeHosts)
Value in failed request: 0x6
Serial number of failed request: 11
Current serial number in output stream: 13
Quote:
user@server:~$ su -
Password:
server:~# gparted

(gpartedbin:3711): Gtk-WARNING **: cannot open display:
Still error.

thank you for your time and suggestion.
 
Old 05-12-2010, 05:57 PM   #7
fruttenboel
Member
 
Registered: Jul 2008
Location: Tilburg NL
Distribution: Slackware 14.2 ciurrent, kernel 3.18.11
Posts: 270

Rep: Reputation: 48
Quote:
Originally Posted by toxine View Post
I actually tried the xhost solution before posting but didn't work , i just wanted to confirm that im doing it correctly.

I tried "export DISPLAY=:0.0" too, doesn't work either

Still error.

thank you for your time and suggestion.
The problem is caused by user 'you' owning the display and then user 'root' wanting to get away with it. Yes, 'root' is the supreme God of your system and is omni potent. But not for X11.

The best thing to do is:

- kill the window system
- log off the terminal
- log on as root
- startx
- do your thing

You will HAVE to start X11 as user 'root'. Period.
 
0 members found this post helpful.
Old 05-12-2010, 06:49 PM   #8
toxine
Member
 
Registered: May 2010
Distribution: Ubuntu/CentOs
Posts: 33

Original Poster
Rep: Reputation: 3
Quote:
Originally Posted by fruttenboel View Post
The problem is caused by user 'you' owning the display and then user 'root' wanting to get away with it. Yes, 'root' is the supreme God of your system and is omni potent. But not for X11.

The best thing to do is:

- kill the window system
- log off the terminal
- log on as root
- startx
- do your thing

You will HAVE to start X11 as user 'root'. Period.
hey thanks, im a newbie couldn't understand your post fully

but this is what i did lol:
went root and created a new vncserver channel (:2), logged off user (:1), and logged to vncserver :2 as a root and ran gparted lol.

worked! now i can use my new 2tb
 
Old 12-09-2011, 10:13 PM   #9
propofol
Member
 
Registered: Nov 2007
Location: Seattle
Distribution: Debian Wheezy & Jessie; Ubuntu
Posts: 334

Rep: Reputation: 60
One other option use:
gksu X_command
 
2 members found this post helpful.
Old 04-03-2012, 09:26 PM   #10
newbiesforever
Senior Member
 
Registered: Apr 2006
Location: Iowa
Distribution: Debian distro family
Posts: 2,372

Rep: Reputation: Disabled
I hope five months isn't too long a time to revisit this post after. I'm not using a vnc, whatever that is, but I have had the same problem in my distro (antiX, with heavy modifications), when trying to sudo synaptic and at least one other thing that required root privileges. After some googling, I tried this command:
Quote:
su - [or sudo]
xauth merge [your user account name]/.Xauthority
Then I rebooted, logged back into my account, and found that I can now sudo synaptic. As fruttenboel stated, the problem is that when you're logged in with your user account, the X display is owned by you, so root is not allowed to perform an X command. By using the above command, I copied root's ownership of the X display to my user account. I worried that this would make my user account unable to run any X commands without sudoing (since root now owns X), but apparently not.

Last edited by newbiesforever; 04-03-2012 at 09:42 PM.
 
Old 04-04-2012, 04:42 AM   #11
anticapitalista
antiX
 
Registered: May 2005
Location: Greece
Distribution: antiX using herbstluftwm, fluxbox, IceWM and jwm.
Posts: 628

Rep: Reputation: 189Reputation: 189
If you have antiX use sux (or install it) to open apps as root in X.
 
1 members found this post helpful.
Old 04-06-2012, 10:14 PM   #12
newbiesforever
Senior Member
 
Registered: Apr 2006
Location: Iowa
Distribution: Debian distro family
Posts: 2,372

Rep: Reputation: Disabled
Quote:
Originally Posted by anticapitalista View Post
If you have antiX use sux (or install it) to open apps as root in X.
Okay, done; but why do I have to this? Why does antiX not let me sudo like I did on MEPIS?
 
Old 04-07-2012, 03:06 AM   #13
anticapitalista
antiX
 
Registered: May 2005
Location: Greece
Distribution: antiX using herbstluftwm, fluxbox, IceWM and jwm.
Posts: 628

Rep: Reputation: 189Reputation: 189
Because sudo is not set up as it is in other distros. su for root access for cli apps annd sux for root access for gui apps works well.
(I think using sudo for gui apps aoemtimes has the issue you have, you should use gksudo)
 
1 members found this post helpful.
Old 11-05-2012, 12:34 PM   #14
masuch
Member
 
Registered: Sep 2011
Location: /dev/null
Distribution: ubuntu 64bits
Posts: 135

Rep: Reputation: 1
Hi,

thanks for this hints.

I had a problem to run any GUI application through gksu or kdesudo as well ( Gtk-WARNING **: cannot open display: )
/as from desktop as from terminal/

I solved it by adding:
Quote:
Defaults env_keep=DISPLAY
into
/etc/sudoers
 
Old 12-25-2012, 07:55 PM   #15
davetesc
LQ Newbie
 
Registered: May 2012
Location: UK
Distribution: Debian testing KDE, Mint 14 XFCE, Ubuntu Studio
Posts: 19
Blog Entries: 4

Rep: Reputation: Disabled
Thanks for this feed. I have just installed Deb testing KDE and found this prob using my usual sudo gparted in a konsole, thanks to trying a few things from this feed I now know that gksu gparted from konsole works fine, and doesn't ask for a password like sudo does, no idea why. Thankyou again davetesc.
 
1 members found this post helpful.
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Gtk-WARNING **: cannot open display: ncsuapex Slackware 7 01-04-2013 05:54 PM
gtk warning cannot open display bosewicht Linux - Newbie 2 03-10-2010 07:53 PM
export display and Gtk-WARNING **: cannot open display: zimma Linux - Server 0 04-24-2009 02:51 AM
Gtk-WARNING **: cannot open display mmisoo Fedora 4 07-24-2006 07:33 PM
Gtk-WARNING **: cannot open display ocset Linux - Software 2 10-18-2004 03:18 PM

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

All times are GMT -5. The time now is 05:22 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