Noureddine RAMDI / Dock-Droid: running Android in Docker with QEMU/KVM and full hardware passthrough

Created Mon, 06 Jul 2026 15:15:52 +0000 Modified Mon, 06 Jul 2026 15:16:10 +0000

sickcodes/dock-droid

Running Android inside a Docker container with hardware passthrough isn’t something you see every day. Dock-Droid combines QEMU/KVM virtualization with Docker containers to deliver a practical Android emulation platform that supports GPU, webcam, audio, and USB passthrough alongside standard Android tooling like ADB and SCRCPY. This makes it a solid option for security research, app testing, and CI/CD pipelines where a virtualized Android environment is needed but managing full VMs feels heavyweight.

What Dock-Droid does and how it works

Dock-Droid is essentially a Docker wrapper around QEMU/KVM that runs Android x86 and ARM emulation images inside containers. The default supported image is BlissOS, an Android fork for x86 platforms. But you can also use custom qcow2 disk images or boot arbitrary ISOs using the “naked” variant.

Under the hood, Dock-Droid requires a Linux host with KVM virtualization enabled. It exposes the KVM device (/dev/kvm) into the container so QEMU can run the Android VM with hardware acceleration. This approach lets the container itself act like a lightweight Android VM, combining container isolation with near-native virtualization performance.

The container also exposes several key interfaces for interacting with the Android instance:

  • ADB (Android Debug Bridge) on port 5555
  • SSH on port 50922 for shell access to the container
  • SCRCPY integration to mirror the Android screen to the host

For GUI access, Dock-Droid supports X11 forwarding by mounting the host’s X11 socket into the container, or VNC forwarding for headless setups. GPU acceleration is enabled via /dev/dri passthrough, webcam forwarding is possible either through USB passthrough or USB redirection over the network, and audio devices can be forwarded via /dev/snd.

The project builds upon patterns established by Docker-OSX, which runs macOS VMs inside containers on KVM-capable Linux hosts. There is a fallback mode to run without KVM but it’s currently a work-in-progress and doesn’t function reliably yet.

Technical strengths and design tradeoffs

Dock-Droid’s main technical strength is how it combines a full hardware-accelerated Android VM inside a Docker container, making the VM portable and easier to manage. The Docker container encapsulates the QEMU/KVM VM and exposes familiar Android interfaces, making it easy to integrate into CI/CD pipelines or remote testing environments.

The project supports GPU acceleration by forwarding the host’s /dev/dri devices, which provides better graphics performance than pure software rendering. Webcam forwarding options include USB passthrough for direct device access or USB redirection over the network using usbredir, which adds flexibility depending on your setup.

Audio forwarding is handled through /dev/snd, allowing Android apps in the container to access the host audio hardware.

Exposing ADB on port 5555 and SSH on 50922 provides multiple ways to interact with the Android instance programmatically or for debugging.

The use of X11 forwarding with mounting /tmp/.X11-unix and setting the DISPLAY environment variable enables seamless GUI integration on Linux desktops. For headless servers, VNC forwarding is supported with password protection.

One tradeoff is the requirement for a KVM-capable Linux host with virtualization enabled in BIOS. While there is a non-KVM fallback, it’s not production-ready. This limits deployment options primarily to Linux servers or desktops with hardware virtualization.

Another subtle complexity is managing device passthrough and forwarding, which requires some familiarity with Linux device nodes, USB bus enumeration, and networking for VNC and SCRCPY.

The code quality appears solid for a specialized project, with a focus on practical usage rather than polish or broad cross-platform support. It reuses proven Docker-OSX patterns and the Dockerfile is straightforward, reflecting a pragmatic approach.

Quick start with Dock-Droid

Here are the exact commands from the README to get started with Dock-Droid. Note the environment variables and port mappings are critical for GUI and device forwarding.

Requirements

  • 4GB disk space minimum
  • Hardware virtualization enabled in BIOS
  • A KVM-capable Linux host (not required but otherwise slow)

BlissOS x86 image

Run with GUI forwarding to your host display:

docker run -it \
    --device /dev/kvm \
    -v /tmp/.X11-unix:/tmp/.X11-unix \
    -e "DISPLAY=${DISPLAY:-:0.0}" \
    -p 5555:5555 \
    sickcodes/dock-droid:latest

Run headlessly with VNC forwarding and password protection:

docker run -it \
    --device /dev/kvm \
    -e EXTRA="-display none -vnc 0.0.0.0:99,password=on" \
    -p 5555:5555 \
    -p 5999:5999 \
    sickcodes/dock-droid:latest

In the QEMU console, set the VNC password by typing:

change vnc password user

Then connect your VNC client to localhost:5999 or the appropriate IP.

Naked variant (bringing your own qcow2 image)

docker run -it \
    --device /dev/kvm \
    -v /tmp/.X11-unix:/tmp/.X11-unix \
    -e "DISPLAY=${DISPLAY:-:0.0}" \
    -v "${PWD}/android.qcow2:/home/arch/dock-droid/android.qcow2" \
    -p 5555:5555 \
    sickcodes/dock-droid:naked

Running without KVM (work in progress)

The README notes this is not fully functional. It requires manual changes to CPU and KVM acceleration flags inside the container.

verdict

Dock-Droid fills a niche for developers and researchers needing a portable, containerized Android VM with hardware acceleration and device passthrough. This is especially useful for automated app testing, security research requiring device interaction, or integrating Android emulation into CI/CD pipelines.

The requirement for Linux hosts with KVM and BIOS virtualization enabled narrows its use cases somewhat, and the non-KVM fallback is not yet usable. The setup for device forwarding and GUI access requires some Linux familiarity.

The project’s codebase is pragmatic and aligned with Docker-OSX patterns, making it approachable for those comfortable with Docker and QEMU. If you need a flexible Android VM that runs inside Docker with access to GPU, webcam, audio, and ADB interfaces, Dock-Droid is worth trying.

For casual Android users or those on non-Linux platforms, this might be overkill or too complex. But for devs running Linux servers or desktops looking for a versatile Android VM in a container, Dock-Droid offers a solid balance of performance and convenience.


→ GitHub Repo: sickcodes/dock-droid ⭐ 1,354 · Dockerfile