NoVNC client + VNC server packed into a Docker image. Access your host's desktop over the network using a web browser.
-
make sure that
DISPLAYenvironment variable is set:echo $DISPLAYIf the output is empty (eg. you are on remote SSH session), find all available displays:
echo $(cd /tmp/.X11-unix && for x in X*; do echo ":${x#X}"; break; done) :0From the output log above we have
:0display available. Let's > save it in~/.profilefile (to persist between boot)echo "DISPLAY=:0" >> ~/.profile -
setup a password for a VNC session
export PASSWORD="husarion" -
adjust the permissions for the X server host
xhost +local:dockerTo persist the setting between boots, add the new line to
~/.profilefileecho "xhost +local:docker" >> ~/.profile -
run the container in a detached mode
docker run -d \ -v /tmp/.X11-unix:/tmp/.X11-unix:rw \ -p 8080:8080 \ -e DISPLAY \ -e PASSWORD \ --ipc=host \ --restart=always \ --name=remote-desktop \ donowak/remote-desktop -
Open the following URL in your web browser (of course replace
IP_ADDRwith you own IP/ Husarnet hostname):http://IP_ADDR:8080/vnc_auto.html -
Stopping the remote desktop
docker stop remote-desktop