mirror of
https://github.com/fcwu/docker-ubuntu-vnc-desktop
synced 2025-12-07 17:06:15 +01:00
commit
653aa4680f
8 changed files with 27 additions and 29 deletions
32
README.md
32
README.md
|
|
@ -29,36 +29,26 @@ docker-ubuntu-vnc-desktop is a Docker image to provide web VNC interface to acce
|
|||
Run the docker container and access with port `6080`
|
||||
|
||||
```shell
|
||||
docker run -p 6080:80 -v /dev/shm:/dev/shm dorowu/ubuntu-desktop-lxde-vnc
|
||||
docker run -p 6080:80 -v /dev/shm:/dev/shm devindice/cloud9-ide-vdi
|
||||
```
|
||||
|
||||
Browse http://127.0.0.1:6080/
|
||||
|
||||
<img src="https://raw.github.com/fcwu/docker-ubuntu-vnc-desktop/master/screenshots/lxde.png?v1" width=700/>
|
||||
|
||||
### Ubuntu Flavors
|
||||
|
||||
Choose your favorite Ubuntu version with [tags](https://hub.docker.com/r/dorowu/ubuntu-desktop-lxde-vnc/tags/)
|
||||
|
||||
- focal: Ubuntu 20.04 (latest)
|
||||
- focal-lxqt: Ubuntu 20.04 LXQt
|
||||
- bionic: Ubuntu 18.04
|
||||
- bionic-lxqt: Ubuntu 18.04 LXQt
|
||||
- xenial: Ubuntu 16.04 (deprecated)
|
||||
- trusty: Ubuntu 14.04 (deprecated)
|
||||
<img src="https://raw.github.com/devindice/cloud9-ide-vdi/master/screenshots/IDE.png?v1" width=700/>
|
||||
<img src="https://raw.github.com/devindice/cloud9-ide-vdi/master/screenshots/VDI.png?v1" width=700/>
|
||||
|
||||
## VNC Viewer
|
||||
|
||||
Forward VNC service port 5900 to host by
|
||||
|
||||
```shell
|
||||
docker run -p 6080:80 -p 5900:5900 -v /dev/shm:/dev/shm dorowu/ubuntu-desktop-lxde-vnc
|
||||
docker run -p 6080:80 -p 5900:5900 -v /dev/shm:/dev/shm devindice/cloud9-ide-vdi
|
||||
```
|
||||
|
||||
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
|
||||
|
||||
```shell
|
||||
docker run -p 6080:80 -p 5900:5900 -e VNC_PASSWORD=mypassword -v /dev/shm:/dev/shm dorowu/ubuntu-desktop-lxde-vnc
|
||||
docker run -p 6080:80 -p 5900:5900 -e VNC_PASSWORD=mypassword -v /dev/shm:/dev/shm devindice/cloud9-ide-vdi
|
||||
```
|
||||
|
||||
A prompt will ask password either in the browser or vnc viewer.
|
||||
|
|
@ -68,7 +58,7 @@ A prompt will ask password either in the browser or vnc viewer.
|
|||
This image provides base access authentication of HTTP via `HTTP_PASSWORD`
|
||||
|
||||
```shell
|
||||
docker run -p 6080:80 -e HTTP_PASSWORD=mypassword -v /dev/shm:/dev/shm dorowu/ubuntu-desktop-lxde-vnc
|
||||
docker run -p 6080:80 -e HTTP_PASSWORD=mypassword -v /dev/shm:/dev/shm devindice/cloud9-ide-vdi
|
||||
```
|
||||
|
||||
## SSL
|
||||
|
|
@ -83,7 +73,7 @@ openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout ssl/nginx.key -out s
|
|||
Specify SSL port by `SSL_PORT`, certificate path to `/etc/nginx/ssl`, and forward it to 6081
|
||||
|
||||
```shell
|
||||
docker run -p 6081:443 -e SSL_PORT=443 -v ${PWD}/ssl:/etc/nginx/ssl -v /dev/shm:/dev/shm dorowu/ubuntu-desktop-lxde-vnc
|
||||
docker run -p 6081:443 -e SSL_PORT=443 -v ${PWD}/ssl:/etc/nginx/ssl -v /dev/shm:/dev/shm devindice/cloud9-ide-vdi
|
||||
```
|
||||
|
||||
## Screen Resolution
|
||||
|
|
@ -91,7 +81,7 @@ docker run -p 6081:443 -e SSL_PORT=443 -v ${PWD}/ssl:/etc/nginx/ssl -v /dev/shm:
|
|||
The Resolution of virtual desktop adapts browser window size when first connecting the server. You may choose a fixed resolution by passing `RESOLUTION` environment variable, for example
|
||||
|
||||
```shell
|
||||
docker run -p 6080:80 -e RESOLUTION=1920x1080 -v /dev/shm:/dev/shm dorowu/ubuntu-desktop-lxde-vnc
|
||||
docker run -p 6080:80 -e RESOLUTION=1920x1080 -v /dev/shm:/dev/shm devindice/cloud9-ide-vdi
|
||||
```
|
||||
|
||||
## Default Desktop User
|
||||
|
|
@ -99,7 +89,7 @@ docker run -p 6080:80 -e RESOLUTION=1920x1080 -v /dev/shm:/dev/shm dorowu/ubuntu
|
|||
The default user is `root`. You may change the user and password respectively by `USER` and `PASSWORD` environment variable, for example,
|
||||
|
||||
```shell
|
||||
docker run -p 6080:80 -e USER=doro -e PASSWORD=password -v /dev/shm:/dev/shm dorowu/ubuntu-desktop-lxde-vnc
|
||||
docker run -p 6080:80 -e USER=doro -e PASSWORD=password -v /dev/shm:/dev/shm devindice/cloud9-ide-vdi
|
||||
```
|
||||
|
||||
## Deploy to a subdirectory (relative url root)
|
||||
|
|
@ -107,7 +97,7 @@ docker run -p 6080:80 -e USER=doro -e PASSWORD=password -v /dev/shm:/dev/shm dor
|
|||
You may deploy this application to a subdirectory, for example `/some-prefix/`. You then can access application by `http://127.0.0.1:6080/some-prefix/`. This can be specified using the `RELATIVE_URL_ROOT` configuration option like this
|
||||
|
||||
```shell
|
||||
docker run -p 6080:80 -e RELATIVE_URL_ROOT=some-prefix dorowu/ubuntu-desktop-lxde-vnc
|
||||
docker run -p 6080:80 -e RELATIVE_URL_ROOT=some-prefix devindice/cloud9-ide-vdi
|
||||
```
|
||||
|
||||
NOTE: this variable should not have any leading and trailing splash (/)
|
||||
|
|
@ -125,7 +115,7 @@ sudo modprobe snd-aloop index=2
|
|||
Start the container
|
||||
|
||||
```shell
|
||||
docker run -it --rm -p 6080:80 --device /dev/snd -e ALSADEV=hw:2,0 dorowu/ubuntu-desktop-lxde-vnc
|
||||
docker run -it --rm -p 6080:80 --device /dev/snd -e ALSADEV=hw:2,0 devindice/cloud9-ide-vdi
|
||||
```
|
||||
|
||||
where `--device /dev/snd -e ALSADEV=hw:2,0` means to grant sound device to container and set basic ASLA config to use card 2.
|
||||
|
|
|
|||
|
|
@ -44,7 +44,7 @@ fi
|
|||
if [ -n "$SHOW_GENERIC_NAMES" ]; then
|
||||
su $USER -c "xfconf-query -c xfce4-panel -np /plugins/plugin-1/show-generic-names -t bool -s '$SHOW_GENERIC_NAMES'"
|
||||
else
|
||||
su $USER -c "xfconf-query -c xfce4-panel -np /plugins/plugin-1/show-generic-names -t bool -s 'true'"
|
||||
su $USER -c "xfconf-query -c xfce4-panel -np /plugins/plugin-1/show-generic-names -t bool -s 'false'"
|
||||
fi
|
||||
|
||||
# Set desktop right click menu
|
||||
|
|
|
|||
10
rootfs/etc/skel/Workspace/.c9/runners/Django.run
Normal file
10
rootfs/etc/skel/Workspace/.c9/runners/Django.run
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
// Create a custom Cloud9 runner - similar to the Sublime build system
|
||||
// For more information see https://docs.c9.io/custom_runners.html
|
||||
{
|
||||
"cmd" : [
|
||||
"$(pwd)/app/virtualEnv/bin/python3",
|
||||
"$(pwd)/app/manage.py",
|
||||
"runserver",
|
||||
"$(if [ '$IP' == '' ]; then echo 0.0.0.0; else echo $IP; fi):$(if [ '$PORT' == '' ]; then echo 8080; else echo $PORT; fi)"
|
||||
]
|
||||
}
|
||||
|
|
@ -33,7 +33,7 @@ HOME=/root
|
|||
if [ "$USER" != "root" ]; then
|
||||
echo "* enable custom user: $USER"
|
||||
#useradd --create-home --shell /bin/bash --user-group --groups adm,sudo,docker -d /workspace/.home/$USER $USER
|
||||
useradd --create-home --shell /bin/bash --user-group --groups adm,sudo,docker $USER
|
||||
useradd --create-home --shell /bin/bash --user-group --groups adm,sudo,docker $(if [ ! $PUID == "" ]; then echo "--uid $PUID"; fi) $(if [ ! $PGID == "" ]; then echo "--gid $PGID"; fi) $USER
|
||||
|
||||
if [ -z "$PASSWORD" ]; then
|
||||
echo " set default password to \"ubuntu\""
|
||||
|
|
@ -43,11 +43,11 @@ if [ "$USER" != "root" ]; then
|
|||
|
||||
PASSWORD=$(cat /proc/sys/kernel/random/uuid | sed 's/[-]//g' | head -c 20)
|
||||
fi
|
||||
|
||||
#HOME=/workspace/.home/$USER
|
||||
HOME=/home/$USER
|
||||
echo "$USER:$PASSWORD" | chpasswd
|
||||
cp -r /root/{.config,.gtkrc-2.0,.asoundrc} ${HOME}
|
||||
chown -R $USER:$USER ${HOME}
|
||||
[ -d "/dev/snd" ] && chgrp -R adm /dev/snd
|
||||
fi
|
||||
sed -i -e "s|%USER%|$USER|" -e "s|%HOME%|$HOME|" /etc/supervisor/conf.d/supervisord.conf
|
||||
|
|
@ -134,6 +134,4 @@ grep "file:///home/$USER/Downloads" /home/$USER/.config/gtk-3.0/bookmarks || ech
|
|||
|
||||
grep "127.0.0.1 archive.linux.duke.edu" /etc/hosts || echo "127.0.0.1 archive.linux.duke.edu" >> /etc/hosts
|
||||
|
||||
chown -R $USER:$USER /home/$USER/
|
||||
|
||||
exec /bin/tini -- supervisord -n -c /etc/supervisor/supervisord.conf
|
||||
|
|
|
|||
|
|
@ -105,7 +105,7 @@ Comment[vi]=Truy cập Internet
|
|||
Comment[zh_CN]=访问互联网
|
||||
Comment[zh_HK]=連線到網際網路
|
||||
Comment[zh_TW]=連線到網際網路
|
||||
Exec=/usr/bin/google-chrome-stable --no-sandbox --disable-dev-shm-usage %U
|
||||
Exec=/usr/bin/google-chrome-stable --disable-dev-shm-usage %U
|
||||
StartupNotify=true
|
||||
Terminal=false
|
||||
Icon=google-chrome
|
||||
|
|
@ -166,7 +166,7 @@ Name[uk]=Нове вікно
|
|||
Name[vi]=Cửa sổ Mới
|
||||
Name[zh_CN]=新建窗口
|
||||
Name[zh_TW]=開新視窗
|
||||
Exec=/usr/bin/google-chrome-stable --no-sandbox --disable-dev-shm-usage
|
||||
Exec=/usr/bin/google-chrome-stable --disable-dev-shm-usage
|
||||
|
||||
[Desktop Action new-private-window]
|
||||
Name=New Incognito Window
|
||||
|
|
@ -218,4 +218,4 @@ Name[uk]=Нове вікно в режимі анонімного перегля
|
|||
Name[vi]=Cửa sổ ẩn danh mới
|
||||
Name[zh_CN]=新建隐身窗口
|
||||
Name[zh_TW]=新增無痕式視窗
|
||||
Exec=/usr/bin/google-chrome-stable --incognito --no-sandbox --disable-dev-shm-usage
|
||||
Exec=/usr/bin/google-chrome-stable --incognito --disable-dev-shm-usage
|
||||
|
|
|
|||
BIN
screenshots/IDE.png
Normal file
BIN
screenshots/IDE.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 692 KiB |
BIN
screenshots/VDI.png
Normal file
BIN
screenshots/VDI.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 2.3 MiB |
Binary file not shown.
|
Before Width: | Height: | Size: 229 KiB |
Loading…
Reference in a new issue