Skip to content

Commit

Permalink
feat: support VNC_PASSWORD
Browse files Browse the repository at this point in the history
  • Loading branch information
dorowu-qnap committed May 2, 2017
1 parent 0f153bc commit 4941a6f
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 0 deletions.
18 changes: 18 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,24 @@ Browse http://127.0.0.1:6080/
<img src="https://raw.github.com/fcwu/docker-ubuntu-vnc-desktop/master/screenshots/lxde.png" width=400/>


Connect with VNC Viewer and protect by VNC Password
==================

Forward VNC service port 5900 to host by

```
docker run -it --rm -p 6080:80 -p 5900:5900 dorowu/ubuntu-desktop-lxde-vnc
```

Now, open the vnc viewer and connect to port 5900. If you would like to protect vnc service by password, set environment variable `VNC_PASSWORD`, for example

```
docker run -it --rm -p 6080:80 -p 5900:5900 -e VNC_PASSWORD=mypassword dorowu/ubuntu-desktop-lxde-vnc
```

A prompt will ask password either in the browser or vnc viewer.


Troubleshooting
==================

Expand Down
7 changes: 7 additions & 0 deletions image/startup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,13 @@ chown -R ubuntu:ubuntu /home/ubuntu
sudo -u ubuntu -i bash -c "mkdir -p /home/ubuntu/.config/pcmanfm/LXDE/ \
&& cp /usr/share/doro-lxde-wallpapers/desktop-items-0.conf /home/ubuntu/.config/pcmanfm/LXDE/"

if [ -n "$VNC_PASSWORD" ]; then
echo -n "$VNC_PASSWORD" > /.password1
x11vnc -storepasswd $(cat /.password1) /.password2
chmod 400 /.password*
sed -i 's/^command=x11vnc.*/& -rfbauth \/.password2/' /etc/supervisor/conf.d/supervisord.conf
fi

cd /usr/lib/web && ./run.py > /var/log/web.log 2>&1 &
nginx -c /etc/nginx/nginx.conf
exec /bin/tini -- /usr/bin/supervisord -n

0 comments on commit 4941a6f

Please sign in to comment.