Skip to content

Instantly share code, notes, and snippets.

@bliotti
Created February 6, 2025 12:14
Show Gist options
  • Save bliotti/2ddddf777512aadf12da6f1dd21eca2d to your computer and use it in GitHub Desktop.
Save bliotti/2ddddf777512aadf12da6f1dd21eca2d to your computer and use it in GitHub Desktop.
unning-ubuntu-os-with-gui-in-a-docker-container
https://medium.com/cloud-for-all/running-ubuntu-os-with-gui-in-a-docker-container-rdp-dbecb0880893
FROM ubuntu:22.04
# Install dependencies, Lubuntu desktop, and XRDP
RUN apt update && \
DEBIAN_FRONTEND=noninteractive apt install -y \
lubuntu-desktop xrdp sudo && \
apt clean && rm -rf /var/lib/apt/lists/*
# Create a user and add to sudo group
RUN useradd -m -s /bin/bash testuser && \
echo "testuser:1234" | chpasswd && \
usermod -aG sudo testuser
# Configure XRDP
RUN adduser xrdp ssl-cert && \
echo "testuser" > /etc/xrdp/xrdp.ini
# Expose XRDP port
EXPOSE 3389
# Start XRDP service
CMD ["/usr/sbin/xrdp", "-ns"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment