We are using docker to provide parity for a group development project. We are using VcXsrv to display the GUI but we have to disable access control to make it work. When running the container we set the DISPLAY environment variable to our IPs and it works fine.
I read that disabling access control is a bad idea so I was experimenting with doing this properly using xauth, but I don't understand exactly what I need to do.
I tried running xauth on my windows machine
xauth add localhost:0.0 12345678123456781234567812345678
In the docker file, I included
xauth add [My IP]:0.0 12345678123456781234657812345678
The .Xauthority files under my windows user directory and the root docker directory appear to be created correctly but when I run the container I still receive the error message
Authorization required, but no authorization protocol specified
I tried to use xhost to only allow localhost connections but the only way I can run xhost is from the VcXsrv directory via ./xhost.exe and I can't appear to pass any parameters
How do I tell VcXsrv to only allow connections from my machine?
I had forgot I asked this question. I just received another upvote so here is what I did to make this work on Windows.
In the docker file I added
COPY .Xauthority ../../root/.XauthorityIt appeared adding the IP address to the x0.hosts file is the determining factor in allowing access to the Xserver without disabling access control.
Adding the .Xauthority file was enough to make the errors go away.
I don't know if this is near the right way to get this done, but it did work. I also presume the xauth paramater would be better to not be all 0s.