Start lubuntu Desktop in Docker
Learn how to run the Lubuntu Desktop GUI in a Docker container on Windows using an X Server. A perfect, disposable environment for Linux learning and experimenting.
This article is over a year old but was reviewed on July 30, 2026 — the content is still accurate.

This article shows how to run a full Lubuntu Desktop GUI inside a Docker container on Windows: build a Dockerfile-based Lubuntu image, install Windows X Server (VcXsrv) to render the display, then docker run the container to get a disposable, throwaway Linux desktop ideal for experimenting without touching the host.
During my summer holidays, I've watched this video: Full Ubuntu GUI in a Container Displayed on Windows (XServer) and, of course, I wanted to play with it.
The idea is to start a Lubuntu Desktop distribution as a Docker container. Lubuntu is a lightweight Ubuntu distribution designed to be more resource-efficient than the standard Ubuntu.
Using Docker and Windows X Server, we'll be able to play with Lubuntu just like any other container, i.e. play and drop without any impact on our host. Ideal for learning purposes then.
This is the "whole desktop" variant. For a single application, see Docker - Run Graphical User Interfaces - Firefox, Chrome & GIMP; and if you'd rather avoid installing an X Server at all, Docker - Running some GUI interfaces in the browser displays them in a browser tab instead.
Result

A full Lubuntu desktop, running inside a Docker container, displayed on the Windows host — no VM, no dual-boot, no trace left once you throw the container away.
Why it works
- Docker gives us a disposable environment: the whole desktop lives in a container, so nothing touches the host — drop the container and it's gone as if it never existed.
- Windows X Server is what actually renders the display: the container sends its GUI output to the X server running on Windows, which draws it on screen.
I encourage you to watch the video Full Ubuntu GUI in a Container Displayed on Windows (XServer).
Step 1 - Create the Dockerfile
There is just one file to create called Dockerfile and with this content:
FROM ubuntu:latest
RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y lubuntu-desktop lightdm && \ rm -rf /var/lib/apt/lists/*
RUN rm -f /run/reboot-required*RUN echo "/usr/sbin/lightdm" > /etc/X11/default-display-managerRUN printf '%s\n' \ '[LightDM]' \ '[Seat:*]' \ 'type=xremote' \ 'xserver-hostname=host.docker.internal' \ 'xserver-display-number=0' \ 'autologin-user=root' \ 'autologin-user-timeout=0' \ 'autologin-session=Lubuntu' \ > /etc/lightdm/lightdm.conf.d/lightdm.conf
ENV DISPLAY=host.docker.internal:0.0
CMD service dbus start ; service lightdm startThis Dockerfile creates a container that runs a lightweight desktop environment (Lubuntu) with a display manager (LightDM). It configures LightDM to connect to an X server running on the host machine rather than creating one inside the container, and sets everything up to auto-login and display graphically on the host.
Build the image by running docker build --tag cavo789/lubuntu . (remember to replace cavo789 with your own username).
Step 2 - Install Windows X Server
Building the image will take a few minutes (the final image will be around 3 GB).
During the creation of the image, please install Windows X Server. It's just a .exe to install on your Windows machine.
Once installed, run the program. On the first screen, as explained in the video, select One large window; click on Next and keep all default values then click on Finish on the last screen.

By clicking on Finish you'll get a black screen. It's normal.
Step 3 - Start the container
Run your container by starting docker run -t cavo789/lubuntu and wait, wait and wait again. If you got warnings on the console, don't worry and still wait.
You may have to wait a minute before you start to see the Linux Lubuntu desktop, and then you'll still need to wait because the operating system is loading and initializing (since it's the first time you start it) — you'll get the desktop shown at the top of this article.
Multi-screen support does not seem to work with X Server
During my tests, the display wasn't up to scratch and I had to remove the cable from my second screen to get a correct display.
Conclusion
Do you realize that we've installed a Linux distribution and launched its GUI as a container? In fact, it's like installing a new PC.
Of course, we'd have to go further than that, e.g. to keep data persistent (via volumes).





