This guide provides step-by-step instructions for enabling GPU acceleration in your Droidspaces containers. Whether you are running on an Android device or a Linux desktop, Droidspaces offers multiple ways to leverage hardware acceleration for a smooth graphical experience.
Note
For the best experience on Android, it is highly recommended to use our official rootfs tarballs, which come pre-configured with the necessary drivers and environment settings.
Hardware acceleration on Android is achieved by bridging the container's graphics stack with a host-side X server (Termux-X11). Droidspaces handles the complex mount management and security contexts required to make this seamless.
This method uses software rendering via llvmpipe. While it doesn't provide full hardware acceleration, it is the most stable way to run GUI applications when a compatible GPU driver isn't available.
When you enable the Termux X11 toggle in the Droidspaces app, the following sequence occurs:
-
Host-side Preparation: Droidspaces creates a
tmpfsmount on top of Termux's/data/data/com.termux/files/usr/tmpin the host's mount namespace. -
Bypassing FBE Encryption: While a direct bind-mount of
/data/data/com.termux/files/usr/tmpto the container is possible, it frequently breaks applications likeaptor any tool performing heavy I/O in/tmp. This happens because Termux's data directory is protected by Android's File-Based Encryption (FBE), leading to "Required key not available" (ENOKEY) errors. By bridging the path viatmpfs, X11 sockets and temporary files become fully readable and writable by the container. -
Bind Mounting: This "Unified Tmpfs Bridge" is then bind-mounted to the container's
/tmpdirectory, enabling seamless communication between the container and the Termux-X11 app.
- Termux:
pkg install x11-repo && pkg install termux-x11 - Container:
sudo apt install mesa-utils(for testing withglxgears)
-
Configure Container: In the Droidspaces app, navigate to your container's configuration.
-
Enable X11: Toggle Termux-X11 to
ON(Hardware Access is not required for software rendering). -
Environment: Add
DISPLAY=:0to the Environment Variables section and save. -
Start Container: Launch your container.
-
Launch X Server: Open the Termux app and run:
termux-x11 :0
-
Verify: Run
glxgearsinside the container terminal. The output will render in the Termux-X11 app.
This method provides GPU acceleration for non-Qualcomm devices (Mali/PowerVR) via a virglrenderer bridge. It translates OpenGL calls from the container into commands that the host Android OS can execute.
- Termux:
pkg install x11-repo && pkg install termux-x11 virglrenderer-android - Container:
sudo apt install mesa-utils(for testing withglxgears)
-
Container Configuration: Enable Termux-X11 in the Droidspaces container settings. Then, add the following to the Environment Variables section:
DISPLAY=:0 GALLIUM_DRIVER=virpipe
-
Start Container: Launch your container.
-
Start VirGL Server: Open Termux and run the server in the background:
virgl_test_server_android & -
Start X Server: In Termux, run:
termux-x11 :0
-
Verify Acceleration: Run
glxinfo -Band look for "VirGL" in the renderer string.
Tip
If the renderer fails to initialize, try starting the VirGL server with the Vulkan backend:
virgl_test_server_android --angle-vulkan &
For Qualcomm Adreno GPUs, Droidspaces supports native hardware acceleration using the Turnip driver. This bypasses the need for virgl and provides near-native performance.
- Recommended Rootfs: Use the Base/XFCE tarball from the official builder repository.
- Termux:
pkg install x11-repo && pkg install termux-x11
-
Install Tarball: Download and install a compatible rootfs via the Droidspaces app.
-
Enable GPU Access: In the container settings, enable GPU Access and Termux X11.
-
Set Display: Add
DISPLAY=:0to your environment variables. -
Launch Sequence:
- Start the container via Droidspaces.
- Open Termux and run
termux-x11 :0
-
Permission Management (Non-Root Users): If you are using a non-root user, you must grant them access to the GPU device nodes:
sudo usermod -aG droidspaces-gpu <your_username>
-
Start Desktop Environment: To launch the full XFCE desktop (if installed), run:
dbus-launch --exit-with-session startxfce4
On Linux-based hosts, GPU acceleration works natively with zero additional configuration within Droidspaces.
- An active X11 or Wayland session on your host.
- Functional GPU drivers (Mesa/Intel/AMD).
-
Enable Hardware Access: Ensure the Hardware Access toggle is enabled in your container configuration (or use the
--hw-accessCLI flag). -
Xhost Permission: On your host machine, allow the container to connect to your X server:
xhost +local:
-
Set Display Variable: Add the host's
DISPLAYnumber to the container's environment (usually:0):echo "DISPLAY=:0" >> /etc/environment
-
Run Applications: GUI applications launched from the container will render natively with full hardware acceleration.