Coder Social home page Coder Social logo

dmotte / desktainer Goto Github PK

View Code? Open in Web Editor NEW
36.0 3.0 9.0 819 KB

๐Ÿ–ฅ Remote desktop in a container

Home Page: https://hub.docker.com/r/dmotte/desktainer

License: MIT License

Dockerfile 9.94% Shell 90.06%
remote-desktop desktop remote vnc novnc debian lxde websockify docker docker-compose x11 browser http webapp supervisor supervisord x11vnc arm container desktainer

desktainer's Introduction

desktainer

icon

GitHub main workflow Docker Pulls

๐Ÿ’ป Remote desktop in a container.

๐Ÿ“ฆ This image is also on Docker Hub as dmotte/desktainer and runs on several architectures (e.g. amd64, arm64, ...). To see the full list of supported platforms, please refer to the .github/workflows/main.yml file. If you need an architecture which is currently unsupported, feel free to open an issue.

Thanks to fcwu/docker-ubuntu-vnc-desktop and soffchen/tiny-remote-desktop for the inspiration.

Simple usage

The simplest way to try this image is:

docker run -it --rm -p6901:6901 dmotte/desktainer

Note: since some GUI applications may have issues with Docker's default seccomp profile, you may need to use --security-opt seccomp=unconfined

Then head over to http://localhost:6901/ to access the remote desktop.

Screenshot

Standard usage

The docker-compose.yml file contains a complete usage example for this image. Feel free to simplify it and adapt it to your needs. Unless you want to build the image from scratch, comment out the build: build line to use the pre-built one from Docker Hub instead.

To start the Docker-Compose stack in daemon (detached) mode:

docker-compose up -d

Then you can view the logs using this command:

docker-compose logs -ft

Tips

  • ๐Ÿ’ก If you want to change the resolution while the container is running, you can use the xrandr --fb 1024x768 command. The new resolution cannot be larger than the one specified in the RESOLUTION environment variable though
  • ๐Ÿ’ก If you need to, you can extend this project by making your own Dockerfile starting from this image (i.e. FROM dmotte/desktainer) and/or mount custom supervisor configuration files. See the example folder for an example of how to do it
  • ๐Ÿ’ก This image is not meant to be run with the --user Docker option, because the startup.sh script needs to run as root in the initial phase. Moreover, the user created via the MAINUSER_NAME environment variable (see below) will be a sudoer, so running the container as root is useful in any case. If you want a rootless version of this image, check out dmotte/desktainer-rootless

Running commands at container startup

If you need to run commands at container startup, you can create Bash scripts in the following locations:

  • /opt/startup-early/*.sh: these scripts will be included in alphabetical order before the main container initialization process
  • /opt/startup-late/*.sh: these scripts will be included in alphabetical order after the main container initialization process

See the startup.sh script for more details.

Moreover, if you need to run commands after the LXDE startup, you can create launcher files in the /etc/xdg/autostart or the ~/.config/autostart directory.

Environment variables

List of supported environment variables:

Variable Required Description
RESOLUTION No (default: 1920x1080) Screen resolution
MAINUSER_NAME No (default: mainuser) Name of the main user. If set to root, no user will be created and the main user will be root
MAINUSER_PASS No (default: mainuser) Password of the main user (if MAINUSER_NAME != root)
VNC_PASS No (default: none) Password for the VNC server
VNC_PORT No (default: 5901) TCP port of the VNC server
NOVNC_PORT No (default: 6901) TCP port of the noVNC webserver

Development

If you want to contribute to this project, you can use the following one-liner to rebuild the image and bring up the Docker-Compose stack every time you make a change to the code:

docker-compose down && docker-compose up --build

Note: I know that this Docker image has many layers, but this shouldn't be a problem in most cases. If you want to reduce its number of layers, there are several techniques out there, e.g. see this

desktainer's People

Contributors

dependabot[bot] avatar dmotte avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

desktainer's Issues

No icons on Raspberry Pi

If I run this command on a Raspberry Pi 3 (arm/v7)

docker run -it --rm -p 6901:6901 dmotte/desktainer

this is the result:

image

... don't know why!

NOTE: if you build the image manually on the device it works! This means that there's a problem with the automated ARM build process on GitHub Actions, but I cannot figure out what goes wrong. Anyway, to build and run the image manually on Raspberry Pi:

git clone https://github.com/dmotte/desktainer.git
docker build desktainer/docker-build/ -t manual-desktainer
docker run -it --rm -p 6901:6901 manual-desktainer

Segmentation fault on qnap

this is log:

Enabling custom user: mainuser
Creating custom user mainuser
Setting custom user's password
VNC port set to 5901
noVNC port set to 6901
Resolution set to 1920x1080
VNC password disabled
Starting supervisord
2023-04-05 14:09:44,842 WARN No file matches via include "/etc/supervisor/conf.d/*.conf"
2023-04-05 14:09:44,843 INFO Set uid to user 0 succeeded
2023-04-05 14:09:44,849 INFO supervisord started with pid 1
2023-04-05 14:09:45,853 INFO spawned: 'Xvfb' with pid 25
2023-04-05 14:09:45,856 INFO spawned: 'LXDE' with pid 26
2023-04-05 14:09:45,861 INFO spawned: 'x11vnc' with pid 27
2023-04-05 14:09:45,865 INFO spawned: 'noVNC' with pid 28
2023-04-05 14:09:46,121 INFO exited: Xvfb (terminated by SIGABRT; not expected)
2023-04-05 14:09:46,121 INFO reaped unknown pid 39 (exit status 0)
2023-04-05 14:09:46,127 INFO exited: LXDE (exit status 1; not expected)
2023-04-05 14:09:46,144 INFO exited: x11vnc (exit status 1; not expected)
2023-04-05 14:09:47,343 INFO spawned: 'Xvfb' with pid 40
2023-04-05 14:09:47,347 INFO spawned: 'LXDE' with pid 41
2023-04-05 14:09:47,351 INFO spawned: 'x11vnc' with pid 42
2023-04-05 14:09:47,352 INFO success: noVNC entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2023-04-05 14:09:47,388 INFO exited: Xvfb (terminated by SIGABRT; not expected)
2023-04-05 14:09:47,391 INFO exited: x11vnc (exit status 1; not expected)
2023-04-05 14:09:47,414 INFO reaped unknown pid 51 (exit status 0)
2023-04-05 14:09:48,424 INFO success: LXDE entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2023-04-05 14:09:48,424 INFO exited: LXDE (exit status 1; not expected)
2023-04-05 14:09:49,427 INFO spawned: 'Xvfb' with pid 52
2023-04-05 14:09:49,432 INFO spawned: 'LXDE' with pid 53
2023-04-05 14:09:49,437 INFO spawned: 'x11vnc' with pid 54
2023-04-05 14:09:49,438 INFO reaped unknown pid 38 (exit status 1)
2023-04-05 14:09:49,473 INFO exited: Xvfb (terminated by SIGABRT; not expected)
2023-04-05 14:09:49,478 INFO exited: x11vnc (exit status 1; not expected)
2023-04-05 14:09:49,485 INFO reaped unknown pid 63 (exit status 0)
2023-04-05 14:09:49,490 INFO exited: LXDE (exit status 1; not expected)
2023-04-05 14:09:50,494 INFO spawned: 'LXDE' with pid 64
2023-04-05 14:09:50,494 INFO reaped unknown pid 50 (exit status 1)
2023-04-05 14:09:50,545 INFO reaped unknown pid 73 (exit status 0)
2023-04-05 14:09:50,550 INFO exited: LXDE (exit status 1; not expected)
2023-04-05 14:09:52,555 INFO spawned: 'Xvfb' with pid 74
2023-04-05 14:09:52,559 INFO spawned: 'LXDE' with pid 75
2023-04-05 14:09:52,564 INFO spawned: 'x11vnc' with pid 76
2023-04-05 14:09:52,565 INFO reaped unknown pid 62 (exit status 1)
2023-04-05 14:09:52,579 INFO exited: Xvfb (terminated by SIGABRT; not expected)
2023-04-05 14:09:52,600 INFO gave up: Xvfb entered FATAL state, too many start retries too quickly
2023-04-05 14:09:52,603 INFO reaped unknown pid 85 (exit status 0)
2023-04-05 14:09:52,605 INFO exited: x11vnc (exit status 1; not expected)
2023-04-05 14:09:52,617 INFO gave up: x11vnc entered FATAL state, too many start retries too quickly
2023-04-05 14:09:52,622 INFO exited: LXDE (exit status 1; not expected)
2023-04-05 14:09:53,623 INFO reaped unknown pid 72 (exit status 1)
2023-04-05 14:09:55,628 INFO spawned: 'LXDE' with pid 86
2023-04-05 14:09:55,630 INFO reaped unknown pid 84 (exit status 1)
2023-04-05 14:09:55,677 INFO reaped unknown pid 95 (exit status 0)
2023-04-05 14:09:55,682 INFO exited: LXDE (exit status 1; not expected)
2023-04-05 14:09:56,684 INFO gave up: LXDE entered FATAL state, too many start retries too quickly
2023-04-05 14:09:58,686 INFO reaped unknown pid 94 (exit status 1)
2023-04-05 14:16:11,115 WARN received SIGTERM indicating exit request
2023-04-05 14:16:11,123 INFO waiting for noVNC to die
2023-04-05 14:16:11,193 INFO stopped: noVNC (exit status 0)
Enabling custom user: mainuser
The custom user mainuser already exists
Setting custom user's password
VNC port set to 5901
noVNC port set to 6901
Resolution set to 1920x1080
VNC password disabled
Starting supervisord
2023-04-05 14:16:13,945 WARN No file matches via include "/etc/supervisor/conf.d/*.conf"
2023-04-05 14:16:13,945 INFO Set uid to user 0 succeeded
2023-04-05 14:16:13,953 INFO supervisord started with pid 1
2023-04-05 14:16:14,957 INFO spawned: 'Xvfb' with pid 18
2023-04-05 14:16:14,960 INFO spawned: 'LXDE' with pid 19
2023-04-05 14:16:14,965 INFO spawned: 'x11vnc' with pid 20
2023-04-05 14:16:14,969 INFO spawned: 'noVNC' with pid 21
2023-04-05 14:16:14,984 INFO exited: Xvfb (terminated by SIGABRT; not expected)
2023-04-05 14:16:15,001 INFO exited: x11vnc (exit status 1; not expected)
2023-04-05 14:16:15,022 INFO reaped unknown pid 30 (terminated by SIGTERM)
2023-04-05 14:16:15,028 INFO exited: LXDE (exit status 1; not expected)
2023-04-05 14:16:16,434 INFO spawned: 'Xvfb' with pid 31
2023-04-05 14:16:16,439 INFO spawned: 'LXDE' with pid 32
2023-04-05 14:16:16,443 INFO spawned: 'x11vnc' with pid 33
2023-04-05 14:16:16,445 INFO success: noVNC entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2023-04-05 14:16:16,497 INFO exited: Xvfb (terminated by SIGABRT; not expected)
2023-04-05 14:16:16,501 INFO exited: x11vnc (exit status 1; not expected)
2023-04-05 14:16:16,502 INFO reaped unknown pid 42 (exit status 0)
2023-04-05 14:16:17,517 INFO success: LXDE entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2023-04-05 14:16:17,517 INFO exited: LXDE (exit status 1; not expected)
2023-04-05 14:16:18,522 INFO spawned: 'Xvfb' with pid 43
2023-04-05 14:16:18,526 INFO spawned: 'LXDE' with pid 44
2023-04-05 14:16:18,531 INFO spawned: 'x11vnc' with pid 45
2023-04-05 14:16:18,532 INFO reaped unknown pid 29 (exit status 1)
2023-04-05 14:16:18,553 INFO exited: Xvfb (terminated by SIGABRT; not expected)
2023-04-05 14:16:18,565 INFO exited: x11vnc (exit status 1; not expected)
2023-04-05 14:16:18,591 INFO reaped unknown pid 54 (exit status 0)
2023-04-05 14:16:18,597 INFO exited: LXDE (exit status 1; not expected)
2023-04-05 14:16:19,600 INFO spawned: 'LXDE' with pid 55
2023-04-05 14:16:19,601 INFO reaped unknown pid 41 (exit status 1)
2023-04-05 14:16:19,649 INFO reaped unknown pid 64 (exit status 0)
2023-04-05 14:16:19,655 INFO exited: LXDE (exit status 1; not expected)
2023-04-05 14:16:21,660 INFO spawned: 'Xvfb' with pid 65
2023-04-05 14:16:21,664 INFO spawned: 'LXDE' with pid 66
2023-04-05 14:16:21,670 INFO spawned: 'x11vnc' with pid 67
2023-04-05 14:16:21,672 INFO reaped unknown pid 53 (exit status 1)
2023-04-05 14:16:21,706 INFO exited: Xvfb (terminated by SIGABRT; not expected)
2023-04-05 14:16:21,707 INFO reaped unknown pid 76 (exit status 0)
2023-04-05 14:16:21,708 INFO gave up: Xvfb entered FATAL state, too many start retries too quickly
2023-04-05 14:16:21,711 INFO exited: x11vnc (exit status 1; not expected)
2023-04-05 14:16:21,726 INFO gave up: x11vnc entered FATAL state, too many start retries too quickly
2023-04-05 14:16:22,735 INFO success: LXDE entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2023-04-05 14:16:22,735 INFO reaped unknown pid 63 (exit status 1)
2023-04-05 14:16:22,735 INFO exited: LXDE (exit status 1; not expected)
2023-04-05 14:16:23,739 INFO spawned: 'LXDE' with pid 77
2023-04-05 14:16:23,789 INFO reaped unknown pid 86 (exit status 0)
2023-04-05 14:16:23,795 INFO exited: LXDE (exit status 1; not expected)
2023-04-05 14:16:24,799 INFO spawned: 'LXDE' with pid 87
2023-04-05 14:16:24,800 INFO reaped unknown pid 75 (exit status 1)
2023-04-05 14:16:24,850 INFO reaped unknown pid 96 (exit status 0)
2023-04-05 14:16:24,856 INFO exited: LXDE (exit status 1; not expected)
2023-04-05 14:16:26,861 INFO spawned: 'LXDE' with pid 97
2023-04-05 14:16:26,862 INFO reaped unknown pid 85 (exit status 1)
2023-04-05 14:16:26,912 INFO reaped unknown pid 106 (exit status 0)
2023-04-05 14:16:27,920 INFO success: LXDE entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2023-04-05 14:16:27,920 INFO reaped unknown pid 95 (exit status 1)
2023-04-05 14:16:27,920 INFO exited: LXDE (exit status 1; not expected)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.