0

I have a laptop running Windows with a Cygwin X server. On this machine I have a virtual Linux box running under VMWare.

I set export DISPLAY=xserver:0 on the VM and do xhost +xclient on the cygwin shell. I can use either the hostname or the IPv4 address. I can now run my X programs (mostly emacs/xterm) by redirecting the display. So far so good.

I also need to use the AWS VPN client to connect to AWS (horrible client but it works). This runs on the Windows laptop but also gets picked up by the virtual machine. I can now talk to AWS on either machine. So far so good.

However, if I try to start any X programs on the linux machine, it refuses to authenticate it. I just get the error "Authorization required, but no authorization protocol specified". If I add the IP address or the server name, it doesn't matter - same error. Neither IP address has changed (I've verified this with Wireshark).

If I do xhost + to disable the authentication, then I can connect but this is obviously hideously insecure and I don't want to do it.

I've tried going down the xauth rabbit hole but that just replaces the above errors with Invalid MIT-MAGIC-COOKIE-1 errors.

Any idea what's going on?

2 Answers 2

0

Answer appears to be to run

xhost +IP-Address

with the IP of the external interface of the machine hosting the X11 server. It appears like the VPN client is causing some sort of redirection of X11 requests to itself. This is very bizarre but seems to work.

0

hmmm.

However, if I try to start any X programs on the linux machine, it refuses to authenticate it

Presumably this is after running "DISPLAY=xserver:0" on the linux machine (=VM). In which case any xclient will try to open a new connection to xserver:6000. It also implies that, at this point, you have an ssh session on the linux machine. Ssh has machinery built in to deal with X.

How this works in your environment I don't know - I don't have a Cygwin build to play with / you didn't say what you were using a ssh client. Its possible that somewhere in this mix there's something missing. First, read the documentation for your ssh client - IIRC with putty you need to explicitly set a flag in the config before connecting. If you're unable to resolve this, then you might try downloading a copy of Mobaxterm and try running an xclient via an ssh session through that (again, without setting DISPLAY).

4
  • Interesting idea but SSH is not a factor - the X programs can be started from the terminal of the VM directly. Commented Mar 4, 2023 at 10:06
  • And yes, it is after running DISPLAY=xserver:0 Commented Mar 4, 2023 at 10:31
  • "from the terminal of the VM directly" - what does this mean? If you want to run X across a network, then ssh tunnelling is the right way to do it.
    – symcbean
    Commented Mar 7, 2023 at 13:33
  • Doesn't have to be tunneled - it just implies it will go in cleartext over the network which is generally bad. In this case however, it's on the same physical hardware so it's a non-issue. Commented Mar 7, 2023 at 15:18

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .