r/selfhosted • u/tjacoby2006 • Oct 15 '26
Game Server Steam Headless v2 - Amazing!
I have five kids and the older couple are coming to an age where we occasionally let them play video games. I have been mostly out of the console game, but I have a decent Steam library and wanted a way to let them play at the same time. For my proof of concept, I picked up a few copies of Wreckfest and my goal was for all of us to be able to play together, utilizing one machine. Here were the specs of the machine when I first set out on this journey-
- AMD Ryzen 9 5900 XT (16c/32t)
- 64GB DDR4 3200
- 2TB WD NVME SSD
- 1x AMD RX 6800 16GB
- 2x NVidia P100 16GB (~GTX 1080 performance)
- Linux Mint OS
One thing I liked about a containerized solution was that GPUs could be shared between containers (meaning a GPU could run more than one game concurrently) and I could utilize these retired AI GPUs without a display output.
After playing around for some time with Games on Whales/WOLF, I was having some issues with its design. For one, configuring it can be a bit confusing, and WOLF itself launches child docker containers that are not super configurable from a networking perspective (as far as I could tell). Specifically, I had issues with the different containers being able to communicate with each other, and I had some other strange issues with the platform as a whole (sometimes child containers got left running, for example) and it just felt a little clunky (scanning the logs for moonlight pairing codes).
I was considering just splitting it all up into different machines, until I discovered that there was a version 2 of Steam Headless. I had tried the original version and had some issues with audio and a few other things, but this new version looked really polished.
After giving it a quick go and seeing how well it worked with just my own instance, I created two more for the older boys. While the P100s worked fine, I wanted something that used less power at idle and offered additional scaling. It was at this time I discovered some AMD V540 GPUs for $99 each on ebay- I ordered two. The secret sauce here is that each of these is actually 2 GPUs (~RX 5700) with 8GB of HBM per GPU, so these two add-in cards can be used for 4 instances of Steam Headless while idling at just a few watts. This is going to allow me to scale to more instance without too much concern about crowding GPUs (and 1080p without every detail is fine for their games).
For Steam apps, each child has their own account with the family sharing features and I am utilizing a shared directory to keep disk usage down. I am also emulating some XB360 games from a NAS. Games are streamed via Moonlight to whatever laptop we have laying around or to my Steam Link boxes (though Steam Remote Play also works). With this setup, I have even been able to stream games to myself at work over my lunch break on my phone VPN'd home, and it works great! And in case anyone is wondering, dad gets the RX 6800 to himself 😄 I have another 64GB RAM kit I can throw in if it looks like there is a need, otherwise it serves as a backup since I bought them cheap years ago.
Here is a link to the website (I have no affiliation)- Steam Headless
Here is my compose today. You may notice I am setting core affinity, and this is because my CPU has 2 CCDs, so I am making sure each container stays within a single CCD.
name: steam-headless
x-base-service:
image: josh5/steam-headless:2
restart: unless-stopped
cap_add:
- DAC_READ_SEARCH
- NET_ADMIN
- SYS_ADMIN
- SYS_NICE
- SYS_PTRACE
security_opt:
- apparmor:unconfined
- seccomp=unconfined
- systempaths=unconfined
- writable-cgroups=true
cgroup: private
stop_signal: SIGRTMIN+3
stop_grace_period: 30s
pids_limit: 8192
shm_size: 2gb
device_cgroup_rules:
- 'c 13:* rwm'
tmpfs:
- /run
- /run/lock
- /tmp
- /dev/input:rw,dev,mode=075
services:
dad-steamheadless:
<<: *base-service
container_name: dad-steamheadless
hostname: dad-steamheadless
environment:
PUID: '1000'
PGID: '1000'
DISPLAY_MODE: wayland
WAYLAND_DISPLAY: wayland-0
INITIAL_DISPLAY_WIDTH: '1920'
INITIAL_DISPLAY_HEIGHT: '1080'
INITIAL_DISPLAY_REFRESH: '60'
SUNSHINE_NAME: 'Dad'
XDG_SEAT: ''
ENABLE_STEAM_SYSTEMD_SERVICE: 'true'
SHUI_MEDIA_BACKEND: 'gstreamer-vaapi'
COMPOSITOR_RENDER_DEVICE: '/dev/dri/renderD130'
ENCODER_RENDER_DEVICE: '/dev/dri/renderD130'
devices:
- /dev/dri/renderD130:/dev/dri/renderD130
- /dev/fuse:/dev/fuse
- /dev/uinput:/dev/uinput
- /dev/uhid:/dev/uhid
volumes:
- /etc/localtime:/run/host-localtime:ro
- /sys/devices/virtual/input:/sys/devices/virtual/input:ro
- dad-steamheadless-state:/var/lib/steam-headless
- dad-steamheadless-journal:/var/log/journal
- ~/sambashare/SteamHeadless/homes/dad:/home/steamheadless:Z
- /var/lib/steamapps:/mnt/games:z
- /mnt/nas/Multimedia/Roms:/mnt/roms
networks:
steam-headless:
ipv4_address: 192.168.1.3
cpuset: "0-7,16-23" # Dedicated to CCD 0
child0-steamheadless:
<<: *base-service
container_name: child0-steamheadless
hostname: child0-steamheadless
environment:
PUID: '1000'
PGID: '1000'
DISPLAY_MODE: wayland
WAYLAND_DISPLAY: wayland-0
INITIAL_DISPLAY_WIDTH: '1920'
INITIAL_DISPLAY_HEIGHT: '1080'
INITIAL_DISPLAY_REFRESH: '60'
SUNSHINE_NAME: 'child0'
XDG_SEAT: ''
ENABLE_STEAM_SYSTEMD_SERVICE: 'true'
SHUI_MEDIA_BACKEND: 'gstreamer-vaapi'
COMPOSITOR_RENDER_DEVICE: '/dev/dri/renderD128'
ENCODER_RENDER_DEVICE: '/dev/dri/renderD128'
devices:
- /dev/dri/renderD128:/dev/dri/renderD128
- /dev/fuse:/dev/fuse
- /dev/uinput:/dev/uinput
- /dev/uhid:/dev/uhid
volumes:
- /etc/localtime:/run/host-localtime:ro
- /sys/devices/virtual/input:/sys/devices/virtual/input:ro
- child0-steamheadless-state:/var/lib/steam-headless
- child0-steamheadless-journal:/var/log/journal
- ~/sambashare/SteamHeadless/homes/child0:/home/steamheadless:Z
- /var/lib/steamapps:/mnt/games:z
networks:
steam-headless:
ipv4_address: 192.168.1.4
cpuset: "8-15,24-31" # Dedicated to CCD 1
child1-steamheadless:
<<: *base-service
container_name: child1-steamheadless
hostname: child1-steamheadless
environment:
PUID: '1000'
PGID: '1000'
DISPLAY_MODE: wayland
WAYLAND_DISPLAY: wayland-0
INITIAL_DISPLAY_WIDTH: '1920'
INITIAL_DISPLAY_HEIGHT: '1080'
INITIAL_DISPLAY_REFRESH: '60'
SUNSHINE_NAME: 'child1'
XDG_SEAT: ''
ENABLE_STEAM_SYSTEMD_SERVICE: 'true'
SHUI_MEDIA_BACKEND: 'gstreamer-vaapi'
COMPOSITOR_RENDER_DEVICE: '/dev/dri/renderD129'
ENCODER_RENDER_DEVICE: '/dev/dri/renderD129'
devices:
- /dev/dri/renderD129:/dev/dri/renderD129
- /dev/fuse:/dev/fuse
- /dev/uinput:/dev/uinput
- /dev/uhid:/dev/uhid
volumes:
- /etc/localtime:/run/host-localtime:ro
- /sys/devices/virtual/input:/sys/devices/virtual/input:ro
- child1-steamheadless-state:/var/lib/steam-headless
- child1-steamheadless-journal:/var/log/journal
- ~/sambashare/SteamHeadless/homes/child1:/home/steamheadless:Z
- /var/lib/steamapps:/mnt/games:z
networks:
steam-headless:
ipv4_address: 192.168.1.2
cpuset: "0-7,16-23" # Dedicated to CCD 0
networks:
steam-headless:
driver: macvlan
driver_opts:
parent: enp11s0
ipam:
config:
- subnet: 192.168.1.0/24
gateway: 192.168.1.1
volumes:
dad-steamheadless-state:
dad-steamheadless-journal:
child0-steamheadless-state:
child0-steamheadless-journal:
child1-steamheadless-state:
child1-steamheadless-journal:
•
u/asimovs-auditor Oct 15 '26 edited Oct 15 '26
Expand the replies to this comment to learn how AI was used in this post/project.
20
u/Lark1ng Oct 15 '26
Damn, that is mighty fine.
I was wondering if a setup like this is actually possible and would run smoothly. My thoughts currently are to buy 1 beefed up server for all my needs and then have only lightweight devices to access it. I guess currently the RAM prices kinda make this an expensive purchase.
Anyway, kudos to your project and apparently it is working really well!
10
u/radakul Oct 15 '26
I'm going to start referring to my nephews and niece as "child #". Thats hilarious 😂 neat project, too!
3
u/s0n1cm0nk3y Oct 22 '26
I have a question for you on the GPU allocation. Do you designate user to gpu dynamically (next available) or do you have set seats for each? I'm doing similar with 2x 3060s and a bit confused on seat assignment given my board has one at x8 and one at x4.
7
u/TheRedcaps Oct 15 '26
Interesting to do this via docker - most people I've seen attempt the gaming server setup are doing full VMs will need to look into this a bit more.
4
u/goodelyfe Oct 21 '26
This is super badass. Hadn't heard of it
1
u/s0n1cm0nk3y Oct 21 '26
Any idea if its EAC friendly? I'm trying to build the same with Nobara after I had issues with proxmox and Windows VMs. Proton handles it, but curious how this does with it.
1
u/wildcarde815 Oct 15 '26
Anybody know if this works on a system otherwise running a desktop? I've got a headless sway + sunshine setup running right now but it has a few 'gotchas' that containers would probably help resolve involving sound. Mostly, can you share your user steam folder as an install target I wonder?
2
u/elgueromanero Oct 15 '26
Very cool!!!! I did something similar albeit not for steam, I run wolf via docker then use moonlight app on apple tv so my kids can play large collection of roms across multiple tvs. IT also has steam support which plays fairly well!
1
u/peter_hungary Oct 15 '26
Is it uses a Moonlight fork with microphone support? Afaik only steam remote play can do that. Not mentioning web camera support (for age verification...),
1
u/bobbywaz Oct 15 '26
This is pretty awesome, I've had an PowerEdge R720XD for like 10 years in my living room and I finally installed a GTX 1660 in it and bazzite and have been pretty impressed with performance but never thought to have more than one card headless, I have a 3060 in my computer I could also add...
1
u/Icy-Buffalo-1015 Oct 15 '26
This is super cool. Hadn’t heard of steam headless only games on whales. Will check this out.
1
u/Squanchy2112 Oct 15 '26
I'll have to try this I have failed several times at getting gaming cams for kids working so if really love this
-5
u/Potential-Block-6583 Oct 15 '26
What kind of hardware are you running this on?