GithubHelp home page GithubHelp logo

scottyhardy / docker-remote-desktop Goto Github PK

View Code? Open in Web Editor NEW
224.0 8.0 113.0 2.66 MB

Docker image for Remote Desktop server with audio support

License: MIT License

Dockerfile 49.27% Shell 50.73%
dockerfile rdp ubuntu remote-desktop xfce xrdp pulseaudio arm64 amd64

docker-remote-desktop's Introduction

docker-remote-desktop

build

Docker image with RDP server using xrdp on Ubuntu with XFCE.

Images are built weekly using the Ubuntu Docker image with the 'latest' tag.

Running manually with docker commands

Download the latest version of the image:

docker pull scottyhardy/docker-remote-desktop

To run with an interactive bash session:

docker run -it \
    --rm \
    --hostname="$(hostname)" \
    --publish="3389:3389/tcp" \
    --name="remote-desktop" \
    scottyhardy/docker-remote-desktop:latest /bin/bash

To start as a detached daemon:

docker run --detach \
    --rm \
    --hostname="$(hostname)" \
    --publish="3389:3389/tcp" \
    --name="remote-desktop" \
    scottyhardy/docker-remote-desktop:latest

To stop the detached container:

docker kill remote-desktop

Connecting with an RDP client

All Windows desktops and servers come with Remote Desktop pre-installed and macOS users can download the Microsoft Remote Desktop application for free from the App Store. For Linux users, I'd suggest using the Remmina Remote Desktop client.

For the hostname, use localhost if the container is hosted on the same machine you're running your Remote Desktop client on and for remote connections just use the name or IP address of the machine you are connecting to. NOTE: To connect to a remote machine, it will require TCP port 3389 to be exposed through the firewall.

To log in, use the following default user account details:

Username: ubuntu
Password: ubuntu

Screenshot of login prompt

Screenshot of XFCE desktop

Building docker-remote-desktop on your own machine

First, clone the GitHub repository:

git clone https://github.com/scottyhardy/docker-remote-desktop.git

cd docker-remote-desktop

You can then build the image with the supplied script:

./build

Or run the following docker command:

docker build -t docker-remote-desktop .

Running local images with scripts

I've created some simple scripts that give the minimum requirements for either running the container interactively or running as a detached daemon.

To run with an interactive bash session:

./run

To start as a detached daemon:

./start

To stop the detached container:

./stop

docker-remote-desktop's People

Contributors

scottyhardy 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  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  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  avatar  avatar  avatar  avatar  avatar

docker-remote-desktop's Issues

Custom user/password

Is your feature request related to a problem? Please describe.
None at all!

Describe the solution you'd like
Hi Scotty! your image works like a breeze. So much that I am considering using it as a permanent solution for a disposable bastion machine. However I would like to know if There is an easy way to set up a custom user/pass, for added security.

Describe alternatives you've considered
Create a persistent volume on the hosts (currently running on a swarm) and change the password. Not tried yet, will likely do.

Multiple User Connection

Currently, I am trying to connect with multiple users but not working.
Please help me out.
Thank you.

Build fails at step 4

Describe The Bug
The build process does not complete, and fails when it tries to access the /pulseaudio directory.

Here is the response to the build command. A cached result is used, but the same happens when building from scratch:

$ sudo docker build -t docker-remote-desktop .
Sending build context to Docker daemon  3.254MB
Step 1/12 : ARG TAG=rolling
Step 2/12 : FROM ubuntu:$TAG as builder
 ---> 2dc51e04d744
Step 3/12 : RUN sed -i -E 's/^# deb-src /deb-src /g' /etc/apt/sources.list     && 
apt-get update     && DEBIAN_FRONTEND="noninteractive" apt-get install -y -- 
no-install-recommends         build-essential         dpkg-dev         git         libpulse- 
dev         pulseaudio     && apt-get build-dep -y pulseaudio     && apt-get source 
pulseaudio     && rm -rf /var/lib/apt/lists/*
---> Using cache
---> 3116b743e0a6
Step 4/12 : RUN cd /pulseaudio-$(pulseaudio --version | awk '{print $2}')     && 
./configure
---> Running in c301e4493532
/bin/sh: 1: cd: can't cd to /pulseaudio-15.0
The command '/bin/sh -c cd /pulseaudio-$(pulseaudio --version | awk '{print $2}')     
&& ./configure' returned a non-zero code: 2

The docker works properly if pulled and run directly. The build succeeds if the pulseaudio related lines are commented out from the Dockerfile, but, after successful login, the screen remains black.

To Reproduce
Steps to reproduce the behavior:

  1. Using Ubuntu 20.04 with docker v20.10.10
  2. git clone https://github.com/scottyhardy/docker-remote-desktop.git
  3. cd docker-remote-desktop/
  4. sudo docker build -t docker-remote-desktop .

Expected behavior
Produce a new running image.

Desktop (please complete the following information):

  • OS: Ubuntu 20.04
  • Version: docker 20.10.10

Not able to connect

RDP client always tells me this:

Your computer could not connect to another console session on the remote computer because you already have a console session in progress.

[Expanded Information]
Error code: 0x708
Extended error code: 0x0

The Docker image is running okay. I'm on Windows 11 [Version 10.0.22000.978].

arm64 build fails

[+] Building 23.8s (7/12)                                                                                                                                                                                                                                                                  
 => [internal] load build definition from Dockerfile                                                                                                                                                                                                                                  0.0s
 => => transferring dockerfile: 37B                                                                                                                                                                                                                                                   0.0s
 => [internal] load .dockerignore                                                                                                                                                                                                                                                     0.0s
 => => transferring context: 2B                                                                                                                                                                                                                                                       0.0s
 => [internal] load metadata for docker.io/library/ubuntu:latest                                                                                                                                                                                                                      0.3s
 => [internal] load build context                                                                                                                                                                                                                                                     0.0s
 => => transferring context: 35B                                                                                                                                                                                                                                                      0.0s
 => CACHED [builder 1/4] FROM docker.io/library/ubuntu:latest@sha256:b6b83d3c331794420340093eb706a6f152d9c1fa51b262d9bf34594887c2c7ac                                                                                                                                                 0.0s
 => CANCELED [stage-1 2/5] RUN apt-get update     && DEBIAN_FRONTEND="noninteractive" apt-get install -y --no-install-recommends         dbus-x11         firefox         git         locales         pavucontrol         pulseaudio         pulseaudio-utils         sudo           23.4s
 => ERROR [builder 2/4] RUN sed -i -E 's/^# deb-src /deb-src /g' /etc/apt/sources.list     && apt-get update     && DEBIAN_FRONTEND="noninteractive" apt-get install -y --no-install-recommends         build-essential         dpkg-dev         git         libpulse-dev         p  23.2s
------                                                                                                                                                                                                                                                                                     
 > [builder 2/4] RUN sed -i -E 's/^# deb-src /deb-src /g' /etc/apt/sources.list     && apt-get update     && DEBIAN_FRONTEND="noninteractive" apt-get install -y --no-install-recommends         build-essential         dpkg-dev         git         libpulse-dev         pulseaudio     && apt-get build-dep -y pulseaudio     && apt-get source pulseaudio     && rm -rf /var/lib/apt/lists/*:      
...
#7 22.70 Building dependency tree...
#7 22.79 Reading state information...
#7 22.83 Some packages could not be installed. This may mean that you have
#7 22.83 requested an impossible situation or if you are using the unstable
#7 22.83 distribution that some required packages have not yet been created
#7 22.83 or been moved out of Incoming.
#7 22.83 The following information may help to resolve the situation:
#7 22.83 
#7 22.83 The following packages have unmet dependencies:
#7 22.89  libssl-dev : Depends: libssl3 (= 3.0.2-0ubuntu1.1) but 3.0.2-0ubuntu1.2 is to be installed
#7 22.89 E: Unable to correct problems, you have held broken packages.
------
executor failed running [/bin/sh -c sed -i -E 's/^# deb-src /deb-src /g' /etc/apt/sources.list     && apt-get update     && DEBIAN_FRONTEND="noninteractive" apt-get install -y --no-install-recommends         build-essential         dpkg-dev         git         libpulse-dev         pulseaudio     && apt-get build-dep -y pulseaudio     && apt-get source pulseaudio     && rm -rf /var/lib/apt/lists/*]: exit code: 100

Anyone else feel like taking over this repo?

I haven't really had the time nor the want to continue contributing to this project. I can see a lot of people still use it even though some builds are currently failing.

If you're interested, please get in contact with me.

Thanks,

Scott

linux/arm/v8

Describe the bug
A clear and concise description of what the bug is.
cant install due to linux/arm/v8

To Reproduce
Steps to reproduce the behavior:

sudo docker pull scottyhardy/docker-remote-desktop
Rasberry pi

you need to give support for linux/arm/v8

After reconnecting the container with RDP, then sound and clipboard not working anymore!

Everything works fine on first connect with RDP.
When I close the lid of my laptop the remote desktop connection is closed.
I can then just reconnect the RDP connection, however then everything works fine except that the clipboard and sound are not working anymore.

I investigated the problem, and pulseaudio seems to work fine. The sound controls shows the xrdp output working just fine with the sound meters fluctuating.
After deep investigation it seems that the 'xrdp-chansrv' process gets in a 'defunct' mode if the remote desktop connection gets broken.

 # ps -ef | grep defunc
 ubuntu        42      38  0 12:42 pts/0    00:00:00 [xrdp-chansrv] <defunct>

The documentation says:

      src: https://manpages.ubuntu.com/manpages/bionic/man8/xrdp-chansrv.8.html

       xrdp-chansrv  is  the  xrdp  channel  server, which manages the Remote Desktop Protocol
       (RDP) sub-channels.  This program is only forked internally by xrdp-sesman.
       Currently xrdp-chansrv knows about the following channels:

       cliprdr
              Clipboard Redirection

       rdpsnd Remote Desktop Protocol Sound

       rdpdr  Remote Desktop Protocol Device Redirection

       rail   Remote Applications Integrated Locally

       drdynvc
              Dynamic Virtual Channel

Because both sound and the clipboard are not working seems to be caused that "xrdp-chansrv" is defunct.

I tried several ways to recover "xrdp-chansrv" but nothing helped. This process seems to be launched internally by xrdp and you have no control over it. Killing it also doesn't solve the problem, because it just gets relaunched 'defunct' again.

I tried to get more info about why "xrdp-chansrv" gets defunct, maybe I could remove the cause to fix the problem.
I found in the log:

   /home/ubuntu/.local/share/xrdp/xrdp-chansrv.10.log
    [20230511-11:01:54] [CORE ] main: app started pid 42(0x0000002a)
    [20230511-11:01:54] [INFO ] main: DISPLAY env var set to :10.0
    [20230511-11:01:54] [INFO ] main: using DISPLAY 10
    [20230511-11:01:54] [INFO ] channel_thread_loop: thread start
    [20230511-11:01:54] [INFO ] Socket 12: AF_UNIX connection received

 <reconnect rdp>

    [20230511-11:08:51] [INFO ] Socket 15: AF_UNIX connection received
    [20230511-11:12:36] [INFO ] channel_thread_loop: trans_check_wait_objs error resetting

Seems that he tries to open a different socket...15 instead of 12 .. would that be the cause?
However, I have no way to configure 'xrdp-chansrv' to point it to the right socket?
Online I already found a request to let end-users relaunch the 'xrdp-chansrv' process themselves, but nothing implemented yet.
See: neutrinolabs/xrdp#1259

The only workaround is after reconnect to logout from the XFCE session and let it remember which programs you had open. Then the remote desktop connection gets closed. Then reopen the remote desktop connection, and you get a full new session with the XFCE desktop restarted and 'xrdp-chansrv' restarted and working again. This way you do not have to restart the container.

So It seems to be a problem with 'xrdp-chansrv' which people of the xrdp project could maybe fix in the future...
I google around and say more people struggling with the same kind of problem, however no fix found.

Do you have an idea?

At least I have a small workaround to continue working in the container with sound and clipboard restarted.

technical note: I'm using a Macbook pro with M1 processor, and using the latest version of the "Microsoft Remote Desktop" application.

Pulseaudio only gets loaded after connecting 1 time to the rdp

Describe the bug
A clear and concise description of what the bug is.

To Reproduce
Steps to reproduce the behavior:

  1. Create the container and add any script that uses AUDIO. Start the Container and DONT connect via RDP.

Expected behavior
Virtual Audio device is loaded and usable WITHOUT the need to connecting one time via rdp

Additional context
I need to connect always 1 time via rdp, that the virtual dummy device gets created and then I can start my script that uses sound. If I don't connect via rdp, there is no dummy virtual sound available that can be used but I don't want to be forced to connect every time first.
Can we change that somehow that the container creates the dummy device from beginning even when not connecting to the container via rdp?

What is root password?

Hello, I need a root password to install my required programs. You didn't share the root password, Can you please share it?

ARM64 support

Is your feature request related to a problem? Please describe.
It would be great to run this image on ARM64 based systems like Raspberries or Apple devices

Describe the solution you'd like
Run it on ARM.

Describe alternatives you've considered
Build image on own.

sudo / su - upgrade

I'm running docker-wine which is built on top of this and I need to sudo once I'm inside the image. Weird, I know. I don't see the default root password listed anywhere and I don't see sudo installed. Any chance you could come up with a solution for this? I'm kind of using docker-remote-desktop as a wannabe traditional VirtualBox installation.

Audio module not required without audio module coming blank screen.

Describe the bug
A clear and concise description of what the bug is.

I was deploying this docker image without audio module (https://github.com/neutrinolabs/pulseaudio-module-xrdp.gi)
Once the images running as container without pulseaudio .. am able to rdp but its giving blank screen.

  • in my case audio not required.

To Reproduce
Steps to reproduce the behavior:

  1. Go to '...' build image without pulseaudio module and run as container but
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

Expected behavior
A clear and concise description of what you expected to happen.

Screenshots
If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

  • OS: [e.g. iOS]
  • Browser [e.g. chrome, safari]
  • Version [e.g. 22]

Smartphone (please complete the following information):

  • Device: [e.g. iPhone6]
  • OS: [e.g. iOS8.1]
  • Browser [e.g. stock browser, safari]
  • Version [e.g. 22]

Additional context
Add any other context about the problem here.

Add more language support

I want to add more language/locale support to Firefox or the Ubuntu. Should I build an image myself and add the 2nd run statement. or Should I add it later to Container, which mean I need to run locale command each time I restart container?

When using Ubuntu:impish pulseaudio does not seem to compile

Is your feature request related to a problem? Please describe.
The problem is if I wish to use impish rather than 20.04 the pulseaudio segment of the build fails.

Describe the solution you'd like
I would like instructions on how to fix that.

Describe alternatives you've considered
none

Additional context
Errors encountered:
W: Download is performed unsandboxed as root as file 'pulseaudio_15.0+dfsg1-1ubuntu2.2.dsc' couldn't be accessed by user '_apt'. - pkgAcquire::Run (13: Permission denied)
Removing intermediate container 7843783bd2d6
---> 757028cb365c
Step 4/13 : RUN cd /pulseaudio-$(pulseaudio --version | awk '{print $2}') && ./configure
---> Running in 3ddac9643d42
/bin/sh: 1: cd: can't cd to /pulseaudio-15.0

【bug】build docker iamges erro pulseaudio configure error

error message:

[root@VM-0-18-centos docker-remote-desktop]# docker build -t desktop:v1 .
Sending build context to Docker daemon 3.268MB
Step 1/13 : ARG TAG=latest
Step 2/13 : FROM ubuntu:$TAG as builder
---> d2e4e1f51132
Step 3/13 : RUN sed -i -E 's/^# deb-src /deb-src /g' /etc/apt/sources.list && apt-get update && DEBIAN_FRONTEND="noninteractive" apt-get install -y --no-install-recommends build-essential dpkg-dev git libpulse-dev pulseaudio && apt-get build-dep -y pulseaudio && apt-get source pulseaudio && rm -rf /var/lib/apt/lists/*
---> Using cache
---> 60286c02d699
Step 4/13 : RUN cd /pulseaudio-$(pulseaudio --version | awk '{print $2}') && ./configure
---> Running in 9138f19009c5
/bin/sh: 1: cd: can't cd to /pulseaudio-15.99.1
The command '/bin/sh -c cd /pulseaudio-$(pulseaudio --version | awk '{print $2}') && ./configure' returned a non-zero code: 2

=========================
docker file is new
Dockerfile:

RUN sed -i -E 's/^# deb-src /deb-src /g' /etc/apt/sources.list
&& apt-get update
&& DEBIAN_FRONTEND="noninteractive" apt-get install -y --no-install-recommends
build-essential
dpkg-dev
git
libpulse-dev
pulseaudio
&& apt-get build-dep -y pulseaudio
&& apt-get source pulseaudio
&& rm -rf /var/lib/apt/lists/*

RUN cd /pulseaudio-$(pulseaudio --version | awk '{print $2}')
&& ./configure

thanks your project ,it's greate!

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.