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? |
I think that is :0.0 not just :0 as in
Code:
export DISPLAY=:0.0 |
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?
|
Thanks for responding!
Quote:
Code:
192.168.1.9:0 MIT-MAGIC-COOKIE-1 c8e9c2816807f3ee235b751fa0cf7886 Code:
slackware/unix:0 MIT-MAGIC-COOKIE-1 ea4dae9ba61da1ee04b397232a19ca41 Code:
qemu-system-x86_64: -net vde,sock=/var/run/kvm0.ctl,vlan=0: Device 'vde' could not be initialized "groups" yields: Code:
users lp floppy audio video cdrom plugdev power netdev scanner Code:
animals/unix:0 MIT-MAGIC-COOKIE-1 ed247fc6d15a3f2537027f35fac4679a Code:
animals/unix:0 MIT-MAGIC-COOKIE-1 ed247fc6d15a3f2537027f35fac4679a |
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. |
Quote:
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.) |
Quote:
[EDIT] as a work around, I did this: Code:
COOKIE=$(su "$USERNAME" -c "xauth list | cut -f 5 -d\" \"") |
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.
|
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 |
All times are GMT -5. The time now is 06:49 AM. |