Discussion:
Where can I find doc to explain how xorg deals with hostname and DISPLAY?
Alexander Franca Fernandes
2018-10-31 13:46:36 UTC
Permalink
Hi.

I don't want a solution, only to understand what's happening, and where to
find the explanation.

I'm using CentOS 7, despite I was an Slackware and Gentoo user (for more
than 10 years).

After I connect into a VPN I get the message (when I'm trying to open X
apps):

*Invalid MIT-MAGIC-COOKIE-1 key*
*(geeqie:12853): Gtk-WARNING **: cannot open display: :0*

That's a very ordinary and common message for Linux users, I know.

Merging Xauthorit or exporting DISPLAY variable, using all hostnames/IP as
possible, doesn't fix the problem.

Even doing a SSH to localhost (with X11 forward enabled) doesn't work.

If I execute xhost + I still get the error:

*Invalid MIT-MAGIC-COOKIE-1 keyxhost: unable to open display ":0"*

So, I only want to understand how Xorg treat the relation among hostname,
IP, DISPLAY, users etc.

For now, the only way I can solve the problem is to exit X and start again,
what is a kind of nightmare in my daily work.

Best regards
Alexander
Adam Jackson
2018-10-31 14:12:51 UTC
Permalink
Hi.
I don't want a solution, only to understand what's happening, and where to find the explanation.
I'm using CentOS 7, despite I was an Slackware and Gentoo user (for more than 10 years).
Invalid MIT-MAGIC-COOKIE-1 key
(geeqie:12853): Gtk-WARNING **: cannot open display: :0
I suspect connecting to the VPN is changing your hostname? It probably
shouldn't, but that also shouldn't be an error. What does 'hostname'
and 'xauth list' print before and after you connect?

I'm still very confused by that though. The normal authentication path
on Fedora derivatives is xhost +si:localuser:$(id -u), you shouldn't
need a magic cookie at all.

- ajax

_______________________________________________
***@lists.x.org: X.Org support
Archives: http://lists.freedesktop.org/archives/xorg
Info: https://lists.x.org/mailman/listinfo/xorg
Your subscription addres
Alexander Franca Fernandes
2018-10-31 14:28:25 UTC
Permalink
Yep.

VPN connection (FortiClient) is changing my hostname.

But it shouldn't mess with DISPLAY management. I've tried export to the new
hostname etc, but nothing changes.

Here's the result of 'xauth list' (I've changed the hostnames but kept the
name's consistency):

localhost.localdomain/unix:7 MIT-MAGIC-COOKIE-1
b041fcc208015379e6d5730442fe90af
localhost.localdomain/unix:9 MIT-MAGIC-COOKIE-1
001ba5c73ea1b6267eea5ed63bac9b5e
10.0.0.52:0 MIT-MAGIC-COOKIE-1 578b951f3295fc6ab2fd5de329f88c27
sala407.wined.g12.br/unix:0 MIT-MAGIC-COOKIE-1
ba2b4723c7c6b265cf3e42acae51d524
10.0.0.57:0 MIT-MAGIC-COOKIE-1 ba2b4723c7c6b265cf3e42acae51d524
sala407.wined.g12.br/unix:1 MIT-MAGIC-COOKIE-1
1c2e97af293ded2301e0d368a284ede2
dc0013-bkp-int.br:2 MIT-MAGIC-COOKIE-1 f981e18cb3ca1b3a25e2cbe39f47323d
[2804:14d:5c56:8652::1]:2 MIT-MAGIC-COOKIE-1
f981e18cb3ca1b3a25e2cbe39f47323d
dc0013-bkp-int.br:2 MIT-MAGIC-COOKIE-1 f981e18cb3ca1b3a25e2cbe39f47323d
dc0013-bkp-int.br:2 MIT-MAGIC-COOKIE-1 f981e18cb3ca1b3a25e2cbe39f47323d
dc0013-bkp-int.br:2 MIT-MAGIC-COOKIE-1 f981e18cb3ca1b3a25e2cbe39f47323d
dc0013-bkp-int.br:2 MIT-MAGIC-COOKIE-1 f981e18cb3ca1b3a25e2cbe39f47323d
localhost.localdomain/unix:1 MIT-MAGIC-COOKIE-1
6d9c1a51ad440c641733c2ec7f8afc23
dc0013-bkp-int.br:0 MIT-MAGIC-COOKIE-1 88767ebfa1236adc6c8f6cd694b507d9
[2804:14d:5c56:8652::2]:0 MIT-MAGIC-COOKIE-1
88767ebfa1236adc6c8f6cd694b507d9
dc0013-bkp-int.br:0 MIT-MAGIC-COOKIE-1 88767ebfa1236adc6c8f6cd694b507d9
dc0013-bkp-int.br:0 MIT-MAGIC-COOKIE-1 88767ebfa1236adc6c8f6cd694b507d9
dc0013-bkp-int.br:0 MIT-MAGIC-COOKIE-1 88767ebfa1236adc6c8f6cd694b507d9
dc0013-bkp-int.br:0 MIT-MAGIC-COOKIE-1 88767ebfa1236adc6c8f6cd694b507d9
localhost.localdomain/unix:2 MIT-MAGIC-COOKIE-1
1b56fdcede3895ce212016d6759efcc4
localhost.localdomain/unix:3 MIT-MAGIC-COOKIE-1
acd4fdf5e97c15319cf882e97eab5007
dc0013-bkp-int.br/unix:4 MIT-MAGIC-COOKIE-1
b6cb36449a059f0845335b4736e19a8b
dc0013-bkp-int.br:4 MIT-MAGIC-COOKIE-1 b6cb36449a059f0845335b4736e19a8b
dc0013-bkp-int.br:4 MIT-MAGIC-COOKIE-1 b6cb36449a059f0845335b4736e19a8b
dc0013-bkp-int.br:4 MIT-MAGIC-COOKIE-1 b6cb36449a059f0845335b4736e19a8b
dc0013-bkp-int.br:4 MIT-MAGIC-COOKIE-1 b6cb36449a059f0845335b4736e19a8b
dc0013-bkp-int.br:4 MIT-MAGIC-COOKIE-1 b6cb36449a059f0845335b4736e19a8b
dc0013-bkp-int.br:4 MIT-MAGIC-COOKIE-1 b6cb36449a059f0845335b4736e19a8b
dc0013-bkp-int.br/unix:0 MIT-MAGIC-COOKIE-1
db26335cf73aa73afeff0d9ab52007a8
localhost.localdomain/unix:0 MIT-MAGIC-COOKIE-1
7d68c73b490008d0dee0c2a518c47e15
dc0013-bkp-int.br/unix:10 MIT-MAGIC-COOKIE-1
d09326c5ca2a53cfba3822899b6b9af8

The command 'xhost +si:alexander:$(id -u)' give me:

Invalid MIT-MAGIC-COOKIE-1 keyxhost: unable to open display ":0"

Any clue?
Post by Alexander Franca Fernandes
Hi.
I don't want a solution, only to understand what's happening, and where
to find the explanation.
Post by Alexander Franca Fernandes
I'm using CentOS 7, despite I was an Slackware and Gentoo user (for more
than 10 years).
Post by Alexander Franca Fernandes
After I connect into a VPN I get the message (when I'm trying to open X
Invalid MIT-MAGIC-COOKIE-1 key
(geeqie:12853): Gtk-WARNING **: cannot open display: :0
I suspect connecting to the VPN is changing your hostname? It probably
shouldn't, but that also shouldn't be an error. What does 'hostname'
and 'xauth list' print before and after you connect?
I'm still very confused by that though. The normal authentication path
on Fedora derivatives is xhost +si:localuser:$(id -u), you shouldn't
need a magic cookie at all.
- ajax
Loading...