So far I am using various xautomation/xdotool scripts in a KVM virtual machine (linux guest) in order to let them do their work and let me work uninterruptedly. I am using a VirtIO disk, but still the performance of the guest is slow most of the times.

Can I do the same in an LXC container, e.g. using docker?

1 Answer 1


I can't say anything to the performance but in researching this I came across this SO Q&A titled: can you run GUI apps in a docker? that shows 3 methods for accomplishing this.

  1. Running AppX over VNC

    This method shows using the following Dockerfile:

    # Firefox over VNC
    # VERSION               0.1
    # DOCKER-VERSION        0.2
    from    ubuntu:12.04
    # make sure the package repository is up to date
    run     echo "deb http://archive.ubuntu.com/ubuntu precise main universe" > /etc/apt/sources.list
    run     apt-get update
    # Install vnc, xvfb in order to create a 'fake' display and firefox
    run     apt-get install -y x11vnc xvfb firefox
    run     mkdir /.vnc
    # Setup a password
    run     x11vnc -storepasswd 1234 ~/.vnc/passwd
    # Autostart firefox (might not be the best way to do it, but it does the trick)
    run     bash -c 'echo "firefox" >> /.bashrc'

    And then running the Docker instance like so:

    $ docker run -p 5900 creack/firefox-vnc x11vnc -forever -usepw -create
  2. Use Docker + Subuser

    Using Subuser + Docker you can directly launch Docker VMs with just single applications within then, granting them narrow access to specific folders from the physical host.

    Subuser is meant to be easilly installed and in and of itself technically insignificant. It is just a wrapper around docker, nothing more.

    Subuser launches docker containers with volumes shared between the host and the child container. That's all.

    Here's a video showing Subuser in action.

  3. Running X11 over SSH

    This last technique shows how to setup a Docker instance with X11 + SSH services running within. This setup then allows any X11 apps to be tunneled out over SSH.

    The ssh is used to forward X11 and provide you encrypted data communication between the docker container and your local machine.

    This method then goes on to setup Xpra + Xephyr on the local side.

    Xpra + Xephyr allows to display the applications running inside of the container such as Firefox, LibreOffice, xterm, etc. with recovery session capabilities. So, you can open your desktop any where without losing the status of your applications, even if the connection drops.

    Xpra also uses a custom protocol that is self-tuning and relatively latency-insensitive, and thus is usable over worse links than standard X.

    The applications can be rootless, so the client machine manages the windows that are displayed.



Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.