LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices

Reply
 
Search this Thread
Old 12-25-2013, 01:51 PM   #1
mostlyharmless
Senior Member
 
Registered: Jan 2008
Distribution: Slackware 14.1 (multilib) with kernel 3.15.5
Posts: 1,528
Blog Entries: 12

Rep: Reputation: 171Reputation: 171
GTK warning with init 4 but not with startx


Merry Xmas!

I have been running init 3 and then running startx. Recently I changed to init 4, which works fine, but when I run qemu, I get the following:

(qemu-system-x86_64:2075): Gtk-WARNING **: cannot open display: :0

typing this:
export DISPLAY=:0

doesn't help
Of course typing init 3, then startx fixes the problem. What exactly is different between startx and init 4, or at least how do I address this issue?
 
Old 12-25-2013, 04:09 PM   #2
saivinoba
Member
 
Registered: Oct 2007
Distribution: Gentoo, Gentoo ~amd64, Linux Mint 17
Posts: 42

Rep: Reputation: 8
I think that is :0.0 not just :0 as in
Code:
export DISPLAY=:0.0
 
Old 12-25-2013, 07:14 PM   #3
ljb643
Member
 
Registered: Nov 2003
Posts: 269

Rep: Reputation: Disabled
The error message shows that DISPLAY is correctly set (:0 is the same as :0.0), so the problem is likely the process does not have permission to connect to the X server to display a window. Assuming you are trying to run qemu as the same user who logged in with xdm, something probably went wrong with the session setup. What happens if you type "xauth list" at a shell prompt?
 
Old 12-26-2013, 07:56 AM   #4
mostlyharmless
Senior Member
 
Registered: Jan 2008
Distribution: Slackware 14.1 (multilib) with kernel 3.15.5
Posts: 1,528
Blog Entries: 12

Original Poster
Rep: Reputation: 171Reputation: 171
Thanks for responding!

Quote:
What happens if you type "xauth list" at a shell prompt?
As the user under init 4:

Code:
192.168.1.9:0  MIT-MAGIC-COOKIE-1  c8e9c2816807f3ee235b751fa0cf7886
[fe80::76d0:2bff:fe2a:817f]:0  MIT-MAGIC-COOKIE-1  c8e9c2816807f3ee235b751fa0cf7886
[fe80::76d0:2bff:fe2a:817f]:0  MIT-MAGIC-COOKIE-1  c8e9c2816807f3ee235b751fa0cf7886
[fe80::74bf:11ff:fe38:bb2c]:0  MIT-MAGIC-COOKIE-1  c8e9c2816807f3ee235b751fa0cf7886
animals/unix:0  MIT-MAGIC-COOKIE-1  c8e9c2816807f3ee235b751fa0cf7886
As root (after su -) under init 4:

Code:
slackware/unix:0  MIT-MAGIC-COOKIE-1  ea4dae9ba61da1ee04b397232a19ca41
I typically start qemu after su - as root because (1) I started that way (2) I get the following error as the mortal user:

Code:
qemu-system-x86_64: -net vde,sock=/var/run/kvm0.ctl,vlan=0: Device 'vde' could not be initialized
which presumably indicates I have to add the user to a group that allows me to initiate networking somewhere... currently
"groups" yields:

Code:
users lp floppy audio video cdrom plugdev power netdev scanner
As the user under init 3, xauth list is:

Code:
animals/unix:0  MIT-MAGIC-COOKIE-1  ed247fc6d15a3f2537027f35fac4679a
whereas root under init 3 is

Code:
animals/unix:0  MIT-MAGIC-COOKIE-1  ed247fc6d15a3f2537027f35fac4679a
So it looks like under init 4, the root user thinks the machine name is "slackware" instead of "animals", and I presume that is the problem. I haven't a clue how to fix that. Of course the immediate problem *might* also be solved if I knew why the mortal user can't start qemu.

Last edited by mostlyharmless; 12-26-2013 at 08:03 AM.
 
Old 12-26-2013, 07:24 PM   #5
ljb643
Member
 
Registered: Nov 2003
Posts: 269

Rep: Reputation: Disabled
Sorry... I probably should not have asked for that - I think posting the xauth list output reveals the 'cookies' that lets anyone connect to your X server. Hopefully you have logged out and back in since then and have new cookies.

Yes if you run something after "su" you will typically get a failure to connect to the X server due to permissions. The permissions setup is different when using runlevel 4 (xdm) versus startx, so I'm not surprised it behaves differently. There are ways around it (with xhost, or xauth extract/xauth merge) but as you said, the right answer is to try to get the program working without needing to run it as root.
 
Old 12-26-2013, 10:25 PM   #6
jtsn
Member
 
Registered: Sep 2011
Location: Europe
Distribution: Slackware
Posts: 803

Rep: Reputation: 354Reputation: 354Reputation: 354Reputation: 354
Quote:
Originally Posted by ljb643 View Post
Sorry... I probably should not have asked for that - I think posting the xauth list output reveals the 'cookies' that lets anyone connect to your X server. Hopefully you have logged out and back in since then and have new cookies.
The listing only contains RFC 1918 and IPv6 link-local addresses, so in reality nobody can connect to his X server (without being directly connected to the machine). And the "/unix" entry describes the Unix Domain Socket for which you to be logged in on the machine itself.

For the hostname, I would check the content of /etc/HOSTNAME and /etc/hosts and execute the hostname utility. (Don't change the 127.0.0.1 entry to anything other than localhost.)
 
Old 12-29-2013, 08:31 AM   #7
mostlyharmless
Senior Member
 
Registered: Jan 2008
Distribution: Slackware 14.1 (multilib) with kernel 3.15.5
Posts: 1,528
Blog Entries: 12

Original Poster
Rep: Reputation: 171Reputation: 171
Quote:
For the hostname, I would check the content of /etc/HOSTNAME and /etc/hosts and execute the hostname utility.
Both of those files say "animals". Clearly, "xauth list" under init 4 gives "slackware" based on something else, but what?

[EDIT] as a work around, I did this:

Code:
COOKIE=$(su "$USERNAME" -c "xauth list | cut -f 5 -d\" \"")
xauth add "animals/unix:0" MIT-MAGIC-COOKIE-1 $COOKIE
but I'd rather not do that every time.

Last edited by mostlyharmless; 12-29-2013 at 03:42 PM.
 
Old 12-29-2013, 02:34 PM   #8
ljb643
Member
 
Registered: Nov 2003
Posts: 269

Rep: Reputation: Disabled
The "slackware" hostname entry seems to be from root's authorization file (~root/.Xauthority), not your user account's file. Assuming you normally log in as a user then "su" to root once running X, that entry could be left over from a long time ago.
 
Old 12-29-2013, 03:44 PM   #9
mostlyharmless
Senior Member
 
Registered: Jan 2008
Distribution: Slackware 14.1 (multilib) with kernel 3.15.5
Posts: 1,528
Blog Entries: 12

Original Poster
Rep: Reputation: 171Reputation: 171
So, if I login as root, would that automatically change my /root/.Xauthority? I don't run X as root, and the installation is recent without any hostname changes.

[EDIT] Post #7 seems to have permanently SOLVED the issue

Last edited by mostlyharmless; 12-29-2013 at 05:31 PM.
 
  


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
Init 4 wont startx after upgrade... Alexvader Slackware 2 01-28-2010 11:51 AM
different between init 5 and startx from init 3 davidhk Linux - Newbie 8 03-05-2009 09:15 PM
startx or init 4 in Slackware errorsunknownp Linux - Newbie 18 02-20-2009 05:48 AM
problems with startx and init 6 einstien Slackware - Installation 1 11-30-2004 09:25 AM
Does init 5 call startx? linuxlah Linux - General 4 03-04-2003 11:48 PM


All times are GMT -5. The time now is 05:53 AM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration