问题
can you help me in finding a vncserver that supports UNIX domain socket or any other tweak
tightvnc creates a socket file under /tmp/.X11-unix/X${display_number} but i'm not sure that this would work
thanks in advance
回答1:
You can do it with Tigervnc or X2go:
Tigervnc
Tigervnc added Unix domain socket with -rfbunixpath.
You can obtain Tigervnc in two ways at less, using the official build or your OS packages system, and they differ a little bit (for Debian at less, maybe other OS's too):
official build (preferred):
you can build it from source or use the binaries from here like that:
curl -sSfL -o tigervnc-1.10.0.x86_64.tar.gz https://bintray.com/tigervnc/stable/download_file?file_path=tigervnc-1.10.0.x86_64.tar.gz
tar xz -f tigervnc-1.10.0.x86_64.tar.gz
then copy it to /usr/local
or where ever you like.
create a password to protect the vnc server with: vncpasswd
run the server:
vncserver :1 -geometry 1600x1000 -rfbunixpath /tmp/vnc_myunixSocket -nolisten tcp
you can now for example connect with ssh remotely with:
ssh -fx -e none -o ExitOnForwardFailure=yes -L 4321:/tmp/vnc_myunixSocket user@IP &
vncviewer localhost:4321
using the package manager (Debian apt)
Tigervnc of Debian (buster) is different than the official build and have a problem in their vncserver (a perl script), you cannot use the Unix socket because they check for an open port and if not found then the script consider that vncserver got a problem and close it. to solve this you can remove the check from that script or use xtigervnc directly without using the vncserver script like that:
Xtigervnc :1 -auth ~/.Xauthority -geometry 1600x1000 -depth 24 -rfbwait 30000 -rfbauth ~/.vnc/passwd -pn -localhost -SecurityTypes VncAuth -nolisten tcp -rfbunixpath /tmp/vnc_myunixSocket
as you see it is not nice but it works, that is why I prefer the official build.
x2go
x2go uses Unix domain socket too, and do not need any open port in the server. I always used the official site to install it, but now I see it was added to Debian repository too. it works fine too, this is better for low resource servers because it use an X server in your client PC (VNC uses the X of the server so consumes more resources)
来源:https://stackoverflow.com/questions/11314866/vncserver-supports-unix-domain-sockets