oldpride
oldpride

Reputation: 975

VcXsrv host-based access control not working

All VcXsrv examples on internet is to run it with disabled access control, with '-ac' switch. But I'd actually like to turn on the host-based access control, so far not working.

First I launch VcXsrv from my windows 10 PC (latest build/patch) named pc1, with the -auth switch.

> "C:\Program Files\VcXsrv\vcxsrv.exe" :0 -multiwindow -clipboard -wgl -auth "C:\users\myname\hosts.txt"

In hosts.txt, I have the following, where linux1 is the remote host name

localhost
inet6:localhost
linux1
inet6:linux1
192.168.1.191
inet6:192.168.1.191

The ip addresses are linux1's.

However, when I launch xterm from linux1, I got this error

linux1$ /usr/bin/xterm -display pc1:0
Authorization required, but no authorization protocol specified
/usr/bin/xterm: Xt error: Can't open display: pc1:0

From pc1 loacally, when I run xhost, there is no mentioning of my remote host or its ip.

C:\Program Files\VcXsrv>xhost
access control enabled, only authorized clients can connect
INET:pc1.mshome.net
LOCAL:
INET:pc1
INET6:pc1

Therefore, looks like '-auth' didn't load the hosts.txt file

Can anyone share some ideas?

Upvotes: 3

Views: 4050

Answers (3)

gurf2
gurf2

Reputation: 1

try with root user, to become root user : sudo -i

Upvotes: 0

Changming Sun
Changming Sun

Reputation: 935

Go to your vcxsrv installation dir, like C:\Program Files\VcXsrv. Find a file named "X0.hosts" Open it with notepad.exe. Add the things you want!

Upvotes: 0

Stephen G Tuggy
Stephen G Tuggy

Reputation: 1141

So -auth is for a different authentication/access control mechanism. To use host-based access control, run commands similar to the following, on your Windows 10 PC:

xhost +inet:localhost
xhost +inet6:localhost
xhost +inet:linux1
xhost +inet6:linux1
xhost +inet:192.168.1.191

(But no need to explicitly repeat the last line with inet6:, since that is specifically an IPv4 address.)

Then run xhost by itself again. The new hostname(s) and IP address(es) should now appear. And connecting from any of them to VcXsrv should now work.

Upvotes: 1

Related Questions