ravindu644

Droidspaces-OSS

Droidspaces is a container runtime that boots full Linux distributions with their own init on rooted Android phones and Linux PCs, sharing the host kernel for native speed without emulation or virtual machines.

v7.2.0
Published at
19d ago
2,492
Stars
25,299
Download
Synced at
16d ago

Latest release

v7.2.0Nov 7, 2026, 12:43 PM
Downloads slow? Switch the source anytime above

README

Project Overview

Running a full distribution with systemd on a phone is awkward: a virtual machine drags performance down, and a chroot has no process or network isolation. Droidspaces boots containers straight on the host kernel of a rooted Android phone or a Linux PC, and every container starts its own init (systemd, OpenRC or anything else) as PID 1. Nothing is emulated and nothing is virtualized, so programs run at native speed. The whole backend is a single static binary under 400 KB, and the Android app drives it so the first container can be created without a terminal.

Item Value
Platform Android (root required), Linux
Backend size Single static binary, under 400 KB
Network modes NAT, Gateway, Macvlan, Host, None
License GPL-3.0
Architectures aarch64, armhf, x86_64, x86, riscv64

Containers share the host kernel, so boot is fast and reboot plus systemd services work inside the container.

Key Features

  • Real init boot: the first process in a container is the init you pick (default /sbin/init), so systemd services, timers and logs behave as usual
  • Five network modes: --net accepts nat (default), gateway, macvlan, host and none; NAT gives every container an address inside 172.28.0.0/16 with internet access and no setup
  • Port forwarding: --port=8080:80 maps a host port to a container port, including equal-size ranges such as 1000-2000:1000-2000 and explicit TCP or UDP
  • Desktop and audio: a desktop through Termux:X11 or Anland, GPU acceleration via VirGL or Turnip, and sound through PulseAudio, each behind an in-app toggle
  • Hardware passthrough: --hw-access hands the host /dev to a container, while --gpu mirrors only the GPU render nodes, with USB, sensors and block devices exposed on demand
  • Resource limits: --memory, --cpus and --pids-limit cap memory (minimum 4M), CPU quota and process count (minimum 16)
  • Boot-time start: on Android a container can start before unlock and keeps running after the app is closed or even uninstalled
  • Scriptable output: show, info and check return structured data with --json, which scripts can read to track container state and kernel probes

CLI and Configuration

  • One binary on both sides: Linux and Android share the same droidspaces; on Android it lives at /data/local/Droidspaces/bin/droidspaces
  • Common subcommands: start, stop, restart, enter, run, show, info, pid, scan, check, daemon and mode
  • Config lookup order: the file named by --config first, then container.config next to the rootfs, then Containers/NAME/container.config in the workspace
  • Workspace paths: /var/lib/Droidspaces on Linux and /data/local/Droidspaces on Android
  • No sudo needed: when the daemon answers, commands are handed to it, so members of the droidspaces group can work without sudo; set DS_NO_PROXY=1 to let the binary handle it directly
  • Read-only runtime copy: the config a container booted with is visible inside it at /run/droidspaces/container.config, for scripts only

Target Audience

  • Power users running full Linux on a phone
  • People turning an old phone into a home server
  • Developers who need an isolated test environment
  • Kernel maintainers porting support on Android
  • Ops engineers experimenting with light containers

Quick Start

Android App

  1. Install the APK and grant root (KernelSU recommended, Magisk and APatch also work), then open it, tap Get Started and run Check Root Access
  2. The app installs droidspaces and a static BusyBox into /data/local/Droidspaces/bin; reboot when asked so the SELinux rules and the boot daemon take effect
  3. Open the Containers tab, tap +, choose Repository, pick a distribution, tap Download and then Install
  4. Tap Start, then switch to the Panel tab and tap Terminal for a shell

Linux CLI

  1. Run sudo ./droidspaces check to probe the kernel for the namespaces and cgroup support Droidspaces needs
  2. Prepare a rootfs directory or an ext4 image, for example at /srv/web.img
  3. First start: sudo droidspaces --name=web --rootfs-img=/srv/web.img --port=8080:80 start
  4. Later starts need only sudo droidspaces --name=web start, and sudo droidspaces --name=web enter opens a shell

System Requirements

Item Requirement
OS Android 8.0 or newer (root required); mainstream Linux desktop distributions
Kernel 3.10 or newer, best compatibility on 4.9 and newer
Architecture aarch64, armhf, x86_64, x86, riscv64
Kernel features PID and IPC namespaces plus cgroup support enabled
Root method KernelSU recommended; Magisk and APatch supported

Notes

  • Verify the kernel first: most stock kernels lack the required options, so run check or read the in-app probe result; containers will not boot without them
  • GrapheneOS is unsupported: it blocks the system calls container isolation relies on, with or without root
  • SuSFS needs a setting change: turn off Hide sus mounts for all processes, otherwise containers fail to boot
  • Passthrough is risky: --hw-access exposes raw block devices, and a wrong dd or mkfs inside the container destroys phone partitions
  • Respect the root boundary: root inside a container can still reach the host, so run only trusted code and use a normal user with sudo day to day

Release history

Sort