├── centos7-xfce └── Dockerfile ├── centos7-mate └── Dockerfile ├── amazon-xfce └── Dockerfile ├── centos8-xfce └── Dockerfile ├── amazon-mate └── Dockerfile ├── centos8-mate └── Dockerfile ├── fedora-xfce └── Dockerfile ├── ubuntu-xfce └── Dockerfile ├── fedora-mate └── Dockerfile ├── LICENSE ├── .github └── workflows │ ├── ubuntu-build-push.yml │ └── fedora-build-push.yml └── README.md /centos7-xfce/Dockerfile: -------------------------------------------------------------------------------- 1 | # https://github.com/danchitnis/container-xrdp 2 | 3 | FROM centos:7 4 | 5 | RUN yum -y update 6 | 7 | RUN yum -y install epel-release 8 | 9 | RUN yum -y groupinstall xfce 10 | 11 | RUN bash -c 'echo PREFERRED=/usr/bin/xfce4-session > /etc/sysconfig/desktop' 12 | 13 | RUN yum install -y xrdp xorgxrdp 14 | 15 | RUN yum -y install sudo nload passwd nano 16 | 17 | COPY ./build/xrdp.ini /etc/xrdp/ 18 | COPY ./build/startwm-xfce.sh /etc/xrdp/ 19 | 20 | RUN mv /etc/xrdp/startwm-xfce.sh /etc/xrdp/startwm.sh 21 | 22 | RUN chmod a+x /etc/xrdp/startwm.sh 23 | 24 | COPY ./build/run.sh / 25 | RUN chmod +x /run.sh 26 | 27 | EXPOSE 3389 28 | 29 | ENTRYPOINT ["/run.sh"] 30 | 31 | -------------------------------------------------------------------------------- /centos7-mate/Dockerfile: -------------------------------------------------------------------------------- 1 | # https://github.com/danchitnis/container-xrdp 2 | 3 | FROM centos:7 4 | 5 | RUN yum -y update 6 | 7 | RUN yum install -y epel-release 8 | 9 | RUN yum -y groups install "MATE Desktop" 10 | 11 | RUN bash -c 'echo PREFERRED=/usr/bin/mate-session > /etc/sysconfig/desktop' 12 | 13 | RUN yum install -y xrdp xorgxrdp 14 | 15 | RUN yum -y install sudo nload passwd nano 16 | 17 | RUN yum -y install pluma caja-open-terminal 18 | 19 | COPY ./build/xrdp.ini /etc/xrdp/ 20 | COPY ./build/startwm-mate.sh /etc/xrdp/ 21 | 22 | RUN mv /etc/xrdp/startwm-mate.sh /etc/xrdp/startwm.sh 23 | 24 | COPY ./build/run.sh / 25 | RUN chmod +x /run.sh 26 | 27 | EXPOSE 3389 28 | 29 | ENTRYPOINT ["/run.sh"] 30 | 31 | -------------------------------------------------------------------------------- /amazon-xfce/Dockerfile: -------------------------------------------------------------------------------- 1 | # https://github.com/danchitnis/container-xrdp 2 | 3 | FROM amazonlinux:latest 4 | 5 | RUN yum -y update 6 | 7 | RUN amazon-linux-extras enable epel 8 | 9 | RUN amazon-linux-extras install epel 10 | 11 | RUN yum -y groupinstall xfce 12 | 13 | RUN bash -c 'echo PREFERRED=/usr/bin/xfce4-session > /etc/sysconfig/desktop' 14 | 15 | RUN yum install -y xrdp xorgxrdp 16 | 17 | RUN yum -y install sudo nload passwd nano gedit 18 | 19 | COPY ./build/xrdp.ini /etc/xrdp/ 20 | COPY ./build/startwm-xfce.sh /etc/xrdp/ 21 | 22 | RUN mv /etc/xrdp/startwm-xfce.sh /etc/xrdp/startwm.sh 23 | 24 | RUN chmod a+x /etc/xrdp/startwm.sh 25 | 26 | COPY ./build/run.sh / 27 | RUN chmod +x /run.sh 28 | 29 | EXPOSE 3389 30 | 31 | ENTRYPOINT ["/run.sh"] 32 | 33 | -------------------------------------------------------------------------------- /centos8-xfce/Dockerfile: -------------------------------------------------------------------------------- 1 | # https://github.com/danchitnis/container-xrdp 2 | 3 | FROM centos:8 4 | 5 | RUN yum -y update 6 | 7 | RUN yum -y install epel-release 8 | 9 | RUN yum -y groupinstall xfce base-x 10 | 11 | RUN bash -c 'echo PREFERRED=/usr/bin/xfce4-session > /etc/sysconfig/desktop' 12 | 13 | RUN yum install -y xrdp xorgxrdp 14 | 15 | RUN yum -y install sudo nload passwd nano gedit 16 | 17 | COPY ./build/xrdp.ini /etc/xrdp/ 18 | 19 | COPY ./build/centos8-sesman.ini /etc/xrdp/ 20 | RUN mv /etc/xrdp/centos8-sesman.ini /etc/xrdp/sesman.ini 21 | 22 | COPY ./build/startwm-xfce.sh /etc/xrdp/ 23 | RUN mv /etc/xrdp/startwm-xfce.sh /etc/xrdp/startwm.sh 24 | 25 | RUN chmod a+x /etc/xrdp/startwm.sh 26 | 27 | COPY ./build/run.sh / 28 | RUN chmod +x /run.sh 29 | 30 | EXPOSE 3389 31 | 32 | ENTRYPOINT ["/run.sh"] 33 | 34 | -------------------------------------------------------------------------------- /amazon-mate/Dockerfile: -------------------------------------------------------------------------------- 1 | # https://github.com/danchitnis/container-xrdp 2 | 3 | FROM amazonlinux:latest 4 | 5 | RUN yum -y update 6 | 7 | RUN amazon-linux-extras install mate-desktop1.x 8 | 9 | RUN bash -c 'echo PREFERRED=/usr/bin/mate-session > /etc/sysconfig/desktop' 10 | 11 | RUN amazon-linux-extras enable epel 12 | 13 | RUN amazon-linux-extras install epel 14 | 15 | RUN yum install -y xrdp xorgxrdp 16 | 17 | RUN yum -y install sudo nload passwd nano 18 | 19 | RUN yum -y install pluma caja-open-terminal 20 | 21 | COPY ./build/xrdp.ini /etc/xrdp/ 22 | COPY ./build/startwm-mate.sh /etc/xrdp/ 23 | 24 | RUN mv /etc/xrdp/startwm-mate.sh /etc/xrdp/startwm.sh 25 | 26 | RUN chmod a+x /etc/xrdp/startwm.sh 27 | 28 | COPY ./build/run.sh / 29 | RUN chmod +x /run.sh 30 | 31 | EXPOSE 3389 32 | 33 | ENTRYPOINT ["/run.sh"] 34 | 35 | -------------------------------------------------------------------------------- /centos8-mate/Dockerfile: -------------------------------------------------------------------------------- 1 | # https://github.com/danchitnis/container-xrdp 2 | 3 | FROM centos:8 4 | 5 | RUN yum -y update 6 | 7 | RUN yum install -y epel-release 8 | 9 | RUN yum -y groups install "MATE Desktop" 10 | 11 | RUN bash -c 'echo PREFERRED=/usr/bin/mate-session > /etc/sysconfig/desktop' 12 | 13 | RUN yum install -y xrdp xorgxrdp 14 | 15 | RUN yum -y install sudo nload passwd nano 16 | 17 | RUN yum -y install pluma caja-open-terminal 18 | 19 | COPY ./build/xrdp.ini /etc/xrdp/ 20 | 21 | COPY ./build/centos8-sesman.ini /etc/xrdp/ 22 | RUN mv /etc/xrdp/centos8-sesman.ini /etc/xrdp/sesman.ini 23 | 24 | COPY ./build/startwm-mate.sh /etc/xrdp/ 25 | RUN mv /etc/xrdp/startwm-mate.sh /etc/xrdp/startwm.sh 26 | 27 | COPY ./build/run.sh / 28 | RUN chmod +x /run.sh 29 | 30 | EXPOSE 3389 31 | 32 | ENTRYPOINT ["/run.sh"] 33 | 34 | -------------------------------------------------------------------------------- /fedora-xfce/Dockerfile: -------------------------------------------------------------------------------- 1 | # https://github.com/danchitnis/container-xrdp 2 | 3 | FROM fedora:latest 4 | 5 | RUN dnf -y update 6 | 7 | RUN dnf -y groupinstall xfce 8 | 9 | RUN bash -c 'echo PREFERRED=/usr/bin/xfce4-session > /etc/sysconfig/desktop' 10 | 11 | RUN dnf install -y xrdp xorgxrdp 12 | 13 | RUN dnf -y install sudo nload passwd nano gedit 14 | 15 | RUN dnf clean all 16 | 17 | ##### END of installations 18 | 19 | COPY ./build/xrdp.ini /etc/xrdp/ 20 | 21 | COPY ./build/centos8-sesman.ini /etc/xrdp/ 22 | RUN mv /etc/xrdp/centos8-sesman.ini /etc/xrdp/sesman.ini 23 | 24 | COPY ./build/startwm-xfce.sh /etc/xrdp/ 25 | RUN mv /etc/xrdp/startwm-xfce.sh /etc/xrdp/startwm.sh 26 | 27 | RUN chmod a+x /etc/xrdp/startwm.sh 28 | 29 | COPY ./build/run.sh / 30 | RUN chmod +x /run.sh 31 | 32 | EXPOSE 3389 33 | 34 | ENTRYPOINT ["/run.sh"] 35 | 36 | -------------------------------------------------------------------------------- /ubuntu-xfce/Dockerfile: -------------------------------------------------------------------------------- 1 | # https://github.com/danchitnis/container-xrdp 2 | 3 | FROM ubuntu:latest 4 | 5 | ENV DEBIAN_FRONTEND=noninteractive 6 | 7 | RUN apt-get -y update 8 | RUN apt-get -y upgrade 9 | 10 | RUN apt-get install -y \ 11 | xfce4 \ 12 | xfce4-clipman-plugin \ 13 | xfce4-cpugraph-plugin \ 14 | xfce4-netload-plugin \ 15 | xfce4-screenshooter \ 16 | xfce4-taskmanager \ 17 | xfce4-terminal \ 18 | xfce4-xkb-plugin 19 | 20 | RUN apt-get install -y \ 21 | dbus-x11 22 | 23 | RUN apt-get install -y \ 24 | sudo \ 25 | wget \ 26 | xorgxrdp \ 27 | xrdp && \ 28 | apt remove -y light-locker xscreensaver && \ 29 | apt autoremove -y && \ 30 | rm -rf /var/cache/apt /var/lib/apt/lists 31 | 32 | COPY ./build/ubuntu-run.sh /usr/bin/ 33 | RUN mv /usr/bin/ubuntu-run.sh /usr/bin/run.sh 34 | RUN chmod +x /usr/bin/run.sh 35 | 36 | 37 | # Docker config 38 | EXPOSE 3389 39 | ENTRYPOINT ["/usr/bin/run.sh"] 40 | 41 | -------------------------------------------------------------------------------- /fedora-mate/Dockerfile: -------------------------------------------------------------------------------- 1 | # https://github.com/danchitnis/container-xrdp 2 | 3 | FROM fedora:latest 4 | 5 | RUN dnf -y update 6 | 7 | #RUN dnf -y install fedora-release --allowerasing 8 | 9 | RUN dnf -y install fedora-release-matecompiz --allowerasing 10 | 11 | #RUN dnf -y install compiz compiz-manager libcompizconfig 12 | 13 | RUN bash -c 'echo PREFERRED=/usr/bin/mate-session > /etc/sysconfig/desktop' 14 | 15 | RUN dnf install -y xrdp xorgxrdp openssh 16 | 17 | RUN dnf -y install sudo nload passwd nano pluma 18 | 19 | RUN dnf clean all 20 | 21 | ##### END of installations 22 | 23 | COPY ./build/xrdp.ini /etc/xrdp/ 24 | 25 | COPY ./build/centos8-sesman.ini /etc/xrdp/ 26 | RUN mv /etc/xrdp/centos8-sesman.ini /etc/xrdp/sesman.ini 27 | 28 | COPY ./build/startwm-mate.sh /etc/xrdp/ 29 | RUN mv /etc/xrdp/startwm-mate.sh /etc/xrdp/startwm.sh 30 | 31 | RUN chmod a+x /etc/xrdp/startwm.sh 32 | 33 | COPY ./build/run.sh / 34 | RUN chmod +x /run.sh 35 | 36 | EXPOSE 3389 37 | 38 | ENTRYPOINT ["/run.sh"] 39 | 40 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2020 Danial Chitnis 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /.github/workflows/ubuntu-build-push.yml: -------------------------------------------------------------------------------- 1 | name: Ubuntu Build and Push 2 | 3 | # Run this workflow daily and on-demand 4 | on: 5 | schedule: 6 | - cron: "10 3 * * 1" # At 03:10 on Monday. 7 | workflow_dispatch: 8 | 9 | jobs: 10 | build-and-push: 11 | runs-on: ubuntu-latest 12 | 13 | steps: 14 | - name: Checkout Repository 15 | uses: actions/checkout@v4 16 | 17 | - name: Set up QEMU 18 | uses: docker/setup-qemu-action@v3 19 | 20 | - name: Set up Docker Buildx 21 | uses: docker/setup-buildx-action@v3 22 | 23 | - name: Login to Docker Registry 24 | uses: docker/login-action@v3 25 | with: 26 | username: ${{ secrets.DOCKER_USERNAME }} 27 | password: ${{ secrets.DOCKER_PASSWORD }} 28 | 29 | - name: Build and Push Docker Image 30 | uses: docker/build-push-action@v5 31 | with: 32 | context: . 33 | file: ./ubuntu-xfce/Dockerfile 34 | push: true 35 | tags: danchitnis/xrdp:ubuntu-xfce-next # Replace with your image tag 36 | platforms: linux/amd64,linux/arm64 # Specify multiple platforms 37 | 38 | - name: Log out from Docker Hub 39 | run: docker logout 40 | -------------------------------------------------------------------------------- /.github/workflows/fedora-build-push.yml: -------------------------------------------------------------------------------- 1 | name: Fedora Build and Push 2 | 3 | # Run this workflow daily and on-demand 4 | on: 5 | schedule: 6 | - cron: "0 0 * * *" # Runs at 00:00 UTC every day 7 | workflow_dispatch: 8 | 9 | jobs: 10 | build-and-push: 11 | runs-on: ubuntu-latest 12 | 13 | steps: 14 | - name: Checkout Repository 15 | uses: actions/checkout@v4 16 | 17 | - name: Set up QEMU 18 | uses: docker/setup-qemu-action@v3 19 | 20 | - name: Set up Docker Buildx 21 | uses: docker/setup-buildx-action@v3 22 | 23 | - name: Login to Docker Registry 24 | uses: docker/login-action@v3 25 | with: 26 | username: ${{ secrets.DOCKER_USERNAME }} 27 | password: ${{ secrets.DOCKER_PASSWORD }} 28 | 29 | - name: Build and Push Docker Image 30 | uses: docker/build-push-action@v5 31 | with: 32 | context: . 33 | file: ./fedora-xfce/Dockerfile 34 | push: true 35 | tags: danchitnis/xrdp:fedora-xfce-next # Replace with your image tag 36 | platforms: linux/amd64,linux/arm64 # Specify multiple platforms 37 | 38 | - name: Log out from Docker Hub 39 | run: docker logout 40 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # container-xrdp 2 | 3 | Docker container for [xrdp](http://xrdp.org/) (both [Xorg](https://github.com/neutrinolabs/xorgxrdp) and [Xvnc](https://tigervnc.org/)) currently based on [Fedora](https://getfedora.org/), and [Ubuntu](https://ubuntu.com/). Full desktop environment [Xfce](https://www.xfce.org/) is supported on both amd64 and arm64 hardware. No privilege or sys_cap is required on the host system. These containers are lightweight and ideal for rapid development and testing purposes. Notice that the state of the container is not persisted between runs. In order to persist the state of the container, see [this guide](https://stackoverflow.com/questions/44480740/how-to-save-a-docker-container-state). 4 | 5 | ## How to use 6 | 7 | First pull the container with the appropriate tag. the following tag combinations are available: 8 | 9 | - danchitnis/xrdp:ubuntu-xfce 10 | - danchitnis/xrdp:fedora-xfce 11 | - danchitnis/xrdp:amazon-mate (no longer supported) 12 | - danchitnis/xrdp:amazon-xfce (no longer supported) 13 | - danchitnis/xrdp:centos7-mate (no longer supported) 14 | - danchitnis/xrdp:centos7-xfce (no longer supported) 15 | - danchitnis/xrdp:centos8-xfce (no longer supported) 16 | 17 | Example: 18 | 19 | ```bash 20 | docker pull danchitnis/xrdp:ubuntu-xfce 21 | ``` 22 | 23 | You have to give username, password, and sudo ability as input arguments to the docker run command. Hence, each user has three parameters. The process will exit if the input arguments are incorrect. Please run as interactive mode at first instance. 24 | 25 | Example when username is _foo_, password is _bar_ and sudo ability is _no_: 26 | 27 | ```bash 28 | docker run -it -p 33890:3389 danchitnis/xrdp:ubuntu-xfce foo bar no 29 | ``` 30 | 31 | Similarly for detached mode 32 | 33 | ```bash 34 | docker run -d -p 33890:3389 danchitnis/xrdp:ubuntu-xfce foo bar no 35 | ``` 36 | 37 | Once running, open Remote Desktop Connection. Enter "localhost:33890" as the address. 38 | 39 | In this example username is _foo_ and the password is _bar_. 40 | 41 | ## Weekly builds 42 | 43 | Weekly builds are available for the following tags: 44 | 45 | - danchitnis/xrdp:ubuntu-xfce-next 46 | - danchitnis/xrdp:fedora-xfce-next (temporarily disabled) 47 | 48 | simply replace the tag with the nightly tag to pull and run the nightly build. 49 | 50 | Example: 51 | 52 | ```bash 53 | docker run -it -p 33890:3389 danchitnis/xrdp:ubuntu-xfce-next foo bar no 54 | ``` 55 | 56 | Please note that these nightly builds are built automatically and have not been tested. As a result, they may not work as expected. If the login fails, please try using the main tag. 57 | 58 | ## Adding more users 59 | 60 | You can add more users as a list of arguments and 3 inputs per user as described above 61 | 62 | Example: 63 | | User | Pass | Sudo | 64 | |---|:---:|---:| 65 | | foo | bar | yes | 66 | | baz | cox | no | 67 | 68 | ```bash 69 | docker run -it -p 33890:3389 danchitnis/xrdp:ubuntu-xfce foo bar yes baz qux no 70 | ``` 71 | 72 | ## Sudo users 73 | 74 | Adding a sudo user will give that user sudo ability so that you can run privileged command _inside_ the container 75 | 76 | For example start docker container with 77 | 78 | ```bash 79 | docker run -d -p 33890:3389 danchitnis/xrdp:ubuntu-xfce foo bar yes 80 | ``` 81 | 82 | Once _inside_ the container user _foo_ can do this 83 | 84 | ```bash 85 | sudo yum update 86 | ``` 87 | 88 | Notice that to give sudo ability, the third input parameter for each user should be explicitly _yes_, otherwise any other input will be ignored. 89 | 90 | ## Build 91 | 92 | Check the following [guide](https://github.com/danchitnis/container-xrdp/blob/master/build.md) for building your own containers. 93 | 94 | ## Contributions 95 | 96 | Inspired by [frxyt/docker-xrdp](https://github.com/frxyt/docker-xrdp) 97 | 98 | Ubuntu commands by [danielguerra69/ubuntu-xrdp](https://github.com/danielguerra69/ubuntu-xrdp/) 99 | 100 | xrdp service restrat by [timwa0669](https://github.com/timwa0669) 101 | --------------------------------------------------------------------------------