Skip to content

Commit 4941a6f

Browse files
committed
feat: support VNC_PASSWORD
1 parent 0f153bc commit 4941a6f

File tree

2 files changed

+25
-0
lines changed

2 files changed

+25
-0
lines changed

README.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,24 @@ Browse http://127.0.0.1:6080/
2525
<img src="https://raw.github.com/fcwu/docker-ubuntu-vnc-desktop/master/screenshots/lxde.png" width=400/>
2626

2727

28+
Connect with VNC Viewer and protect by VNC Password
29+
==================
30+
31+
Forward VNC service port 5900 to host by
32+
33+
```
34+
docker run -it --rm -p 6080:80 -p 5900:5900 dorowu/ubuntu-desktop-lxde-vnc
35+
```
36+
37+
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
38+
39+
```
40+
docker run -it --rm -p 6080:80 -p 5900:5900 -e VNC_PASSWORD=mypassword dorowu/ubuntu-desktop-lxde-vnc
41+
```
42+
43+
A prompt will ask password either in the browser or vnc viewer.
44+
45+
2846
Troubleshooting
2947
==================
3048

image/startup.sh

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,13 @@ chown -R ubuntu:ubuntu /home/ubuntu
1212
sudo -u ubuntu -i bash -c "mkdir -p /home/ubuntu/.config/pcmanfm/LXDE/ \
1313
&& cp /usr/share/doro-lxde-wallpapers/desktop-items-0.conf /home/ubuntu/.config/pcmanfm/LXDE/"
1414

15+
if [ -n "$VNC_PASSWORD" ]; then
16+
echo -n "$VNC_PASSWORD" > /.password1
17+
x11vnc -storepasswd $(cat /.password1) /.password2
18+
chmod 400 /.password*
19+
sed -i 's/^command=x11vnc.*/& -rfbauth \/.password2/' /etc/supervisor/conf.d/supervisord.conf
20+
fi
21+
1522
cd /usr/lib/web && ./run.py > /var/log/web.log 2>&1 &
1623
nginx -c /etc/nginx/nginx.conf
1724
exec /bin/tini -- /usr/bin/supervisord -n

0 commit comments

Comments
 (0)