Choose how many containers to run
Each Steam Headless container operates as an isolated gaming workstation with its own desktop session, audio pipeline, virtual input daemon (shinputd), SHUI web portal (port 8483), and Sunshine streaming server (Moonlight). While containers share the host kernel and GPU hardware, user profiles, game state, displays, and controller inputs remain strictly separated.
Hardware capacity and sizing calculations
Running multiple simultaneous gaming sessions requires balancing four critical host resources: CPU cores, System RAM, GPU / VRAM, and Host Inotify capacity.
1. CPU core allocation
Modern 3D gaming under Linux (via Proton, DXVK, and VKD3D) places substantial demands on the CPU for game physics, audio mixing, shader compilation, Wayland compositing, and video stream encoding.
| Workload Type | Recommended Physical Cores per Container | Minimum Cores / Threads |
|---|---|---|
| Lightweight / 2D / Emulation (e.g. SuperTux, RetroArch, indie titles) | 1–2 cores | 2 threads |
| Standard 1080p 3D Gaming (e.g. modern action, RPGs, esports) | 4 physical cores | 4 cores / 8 threads |
| Heavy 1440p+ / AAA 3D Gaming (e.g. Cyberpunk 2077, Starfield) | 6 physical cores | 6 cores / 12 threads |
Real-world CPU benchmark evidence
During physical host capacity qualification on a quad-core / eight-thread Intel host:
- Two simultaneous 3D gaming sessions (Batman: Arkham Origins running at 1080p) delivered a smooth 59 FPS average with comfortable CPU headroom.
- Adding a third simultaneous session pushed host CPU Pressure Stall Information (
someavg10) to 17.03% (with spikes to 28.08%). Because tasks were frequently waiting for CPU time, average frame rates dropped by 29% (to 42 FPS) and minimum frame rates collapsed by 38% (to 33 FPS).
For simultaneous modern 3D gaming, plan for 4 physical CPU cores per concurrent player. If your host has an 8-core / 16-thread processor (such as an AMD Ryzen 7 or Intel Core i7), two concurrent 3D containers will run comfortably at full frame rate.
2. System RAM planning
Each container requires memory for both base system services and the active game:
- Base Desktop & Streaming Overhead: ~1.3 GiB to 1.6 GiB per container (desktop environment, background services, SHUI, and Sunshine).
- Container Shared Memory (
shm_size: 2gb): Required for Wayland DMA-BUF framebuffers and PipeWire audio buffers. - Game Working Set: Typically 4 GiB to 12+ GiB depending on the game title and graphic settings.
Host memory planning table
| Target Setup | Minimum Recommended Host RAM | Comfortable Host RAM |
|---|---|---|
| 1 Container (Single gaming session) | 16 GiB | 16 GiB – 32 GiB |
| 2 Containers (Two concurrent gaming sessions) | 24 GiB | 32 GiB |
| 3 Containers (Three concurrent gaming sessions) | 32 GiB | 48 GiB – 64 GiB |
| 4+ Containers (LAN party / multi-seat rig) | 64 GiB | 64 GiB – 128 GiB |
While Linux swap prevents the Out-Of-Memory (OOM) killer from terminating processes during memory spikes, paging memory to disk during active gameplay introduces severe frame stutter and latency. Ensure your physical RAM accommodates all active containers.
3. GPU rendering and VRAM sharing
Linux DRM render nodes (/dev/dri/renderD128) support concurrent multi-process access. Multiple containers can share a single graphics card simultaneously without GPU pass-through or PCIe partitioning.
However, Video Memory (VRAM) is a hard physical boundary:
- When video memory saturates, Vulkan drivers and game engines stall as textures are evicted to system RAM across the PCIe bus.
- In our hardware benchmarks on a 4 GiB GPU, running two 1080p games consumed ~3.5 GiB VRAM smoothly. A third game triggered VRAM saturation and pushed the GPU core to 93.7% sustained utilisation, causing immediate frame drops.
- Rule of thumb: Ensure the combined VRAM requirements of your games fit within your physical GPU's memory (e.g. an 8 GB card handles two 1080p games requiring 3–4 GB VRAM each; a 16 GB card can comfortably support 3–4 simultaneous 1080p/1440p containers).
4. Host-wide inotify capacity (Multi-container requirement)
A critical consideration when running multiple rootful containers is the Linux kernel's inotify limit.
Because rootful containers share the host's per-UID inotify instance pool, each container's systemd, KDE Plasma desktop, and Steam client consume inotify instances. The default Linux host limit (fs.inotify.max_user_instances = 128) is often exhausted when launching a second or third container, causing services to fail with:
EMFILE: Too many open files
Applying the multi-container inotify configuration
Before launching multiple containers, raise the host inotify instance ceiling. The following example uses the standard 1024 default for two or three concurrent containers. For four or more containers, select a higher value from the inotify sizing table.
# Check current limit
sysctl fs.inotify.max_user_instances
# Persist the multi-container limit
printf '%s\n' 'fs.inotify.max_user_instances = 1024' | \
sudo tee /etc/sysctl.d/90-steam-headless-inotify.conf
# Apply immediately without rebooting
sudo sysctl --load=/etc/sysctl.d/90-steam-headless-inotify.conf
Container identity
Moonlight and network discovery clients identify containers using the container's network hostname (hostname), so assigning unique hostnames (such as steam-headless-a and steam-headless-b) is the recommended method. If a separate display name is needed, SUNSHINE_NAME is available as an advanced override in the container options. Steam Headless generates its internal virtual seat name automatically:
| Setting | Example Container A | Example Container B |
|---|---|---|
container_name | steam-headless-a | steam-headless-b |
hostname | steam-headless-a | steam-headless-b |
Network isolation: Why macvlan is required
Every Steam Headless container binds to fixed network ports:
- Port 8483 (TCP/UDP): SHUI web interface, API, and WebRTC streaming.
- Ports 47984–47990 (TCP/UDP): Sunshine GameStream protocol.
Because multiple containers cannot listen on the same host ports simultaneously, host networking cannot be used for multiple containers.
The recommended and fully supported architecture is macvlan networking. Macvlan attaches each container directly to your physical network interface, giving each container its own dedicated IP address on your local LAN:
Container A: 192.168.1.50 -> SHUI at https://192.168.1.50:8483
Container B: 192.168.1.51 -> SHUI at https://192.168.1.51:8483
For detailed network setup and host-to-container communication shims, see Macvlan networking.
Example: Two-container Docker Compose deployment
Below is a complete Compose configuration running two isolated containers (desktop-a and desktop-b) sharing a single graphics card over macvlan networking. Use the container options reference when you need to change its display, streaming, or desktop values.
name: steam-headless-multicontainer
x-container-base: &container-base
image: josh5/steam-headless:2
restart: unless-stopped
privileged: false
cap_add:
- DAC_READ_SEARCH
- NET_ADMIN
- SYS_ADMIN
- SYS_NICE
- SYS_PTRACE
security_opt:
- seccomp=unconfined
- systempaths=unconfined
- writable-cgroups=true
cgroup: private
stop_signal: SIGRTMIN+3
stop_grace_period: 30s
pids_limit: 8192
shm_size: 2gb
tty: true
devices:
- /dev/dri/renderD128:/dev/dri/renderD128
- /dev/fuse:/dev/fuse
- /dev/uinput:/dev/uinput
- /dev/uhid:/dev/uhid
device_cgroup_rules:
- 'c 13:* rwm'
tmpfs:
- /run
- /run/lock
- /tmp
- /dev/input:rw,dev,mode=0755
services:
desktop-a:
<<: *container-base
container_name: steam-headless-a
hostname: steam-headless-a
environment:
PUID: '1000'
PGID: '1000'
volumes:
- /etc/localtime:/run/host-localtime:ro
- /sys/devices/virtual/input:/sys/devices/virtual/input:ro
- steam-headless-a-state:/var/lib/steam-headless
- steam-headless-a-journal:/var/log/journal
- ./data/homes/desktop-a:/home/steamheadless:Z
- /mnt/storage/games:/mnt/games:z
networks:
session-lan:
ipv4_address: 192.168.1.50
desktop-b:
<<: *container-base
container_name: steam-headless-b
hostname: steam-headless-b
environment:
PUID: '1000'
PGID: '1000'
volumes:
- /etc/localtime:/run/host-localtime:ro
- /sys/devices/virtual/input:/sys/devices/virtual/input:ro
- steam-headless-b-state:/var/lib/steam-headless
- steam-headless-b-journal:/var/log/journal
- ./data/homes/desktop-b:/home/steamheadless:Z
- /mnt/storage/games:/mnt/games:z
networks:
session-lan:
ipv4_address: 192.168.1.51
networks:
session-lan:
driver: macvlan
driver_opts:
parent: eth0
macvlan_mode: bridge
ipam:
config:
- subnet: 192.168.1.0/24
gateway: 192.168.1.1
volumes:
steam-headless-a-state:
steam-headless-a-journal:
steam-headless-b-state:
steam-headless-b-journal:
For advanced multi-container topologies and network routing, see Run multiple containers.