Previously every game shared one always-on Xvnc/fluxbox/websockify desktop, so starting two games at once meant they fought over focus on the same screen and the same ALSA device. Now: - server.sh no longer starts a shared desktop at all - it just runs setup_server.py. There's no default display anymore. - start_game() allocates a free display from GAME_DISPLAY_NUMS (:90-:99, one per MAX_CONCURRENT_GAMES=10 slot), spins up a fresh Xvnc+fluxbox+websockify for it, and launches the game with DISPLAY set to that display. All four processes are tracked together per game. - stop_game() tears down all four; is_running() does the same lazily if the game exited on its own (crash/quit), so a slot doesn't stay stuck just because nobody clicked Stop. - Starting past the 10-slot cap is refused with an error shown on that game's row instead of silently failing. - Each running game's row gets its own "Open Screen" link (client-side JS, since the port is only known once the game is actually started) instead of one global noVNC link. - run.sh publishes the whole 8090-8099 noVNC port range up front, since Docker can't add port mappings to an already-running container. Verified end-to-end: two different games running concurrently get fully independent Xvnc/fluxbox/websockify/game process sets and noVNC endpoints; stopping one leaves the other untouched; the capacity guard correctly refuses a start at the limit. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01NiNnj78HGx1KWyCCo39HSz
6.8 KiB
TODO
-
~
Reduce image size ofDone in two steps:jayfield/dosbox-novnc(currently2.3GB).- Merged the game download/extract steps and the unzip/smbclient install into a single layer (so the downloaded zips and the packages only needed to extract them no longer persist in the final image). 2.31GB -> 1.6GB.
- Stopped baking the games into the image at all (927MB of that was just t7g's two CD
ISOs).
run.shmounts a named volume (dosbox-games) so installed games persist across--rmrestarts. 1.6GB -> ~690MB. Container now needs network access tovlda-01at runtime (not just build time) to install games. - Dropped the auto-download at container startup entirely.
scripts/setup_server.pyis a small stdlib-only HTTP server that serves an HTML page on${SETUP_PORT}(70${DISPLAY_NUM}, published as7099byrun.sh) listing every*.zipon the SMB share with an Installed/Install status per game; the user clicks "Install" to fetch+extract a specific game into${GAMES_HOME}on demand.
-
Manifest-driven games + Start/Stop/Uninstall: games are no longer discovered from raw
*.zipfiles on the share.setup_server.pylists*.jsonmanifests instead (one per game, in theGames\dosbox\catalog directory), each declaringname/title/zip_path/start_cmd. The web page grew Start/Stop/Uninstall buttons alongside Install, driven entirely by that manifest — nothing about a game's identity or how to run it is hardcoded in the image anymore. Started as astuntcar-only pilot, now extended to 6 games (see the SCUMM item below).t7gstill has no manifest and won't show up in the setup page until one is added (t7g.jsonwith astart_cmdfor itsdosbox-0.74-3.conf).game.sh/scripts/start_game.sh(the olddocker exec-based launch path, with its hardcodedDOSBOX_VERSION/run.batconvention) were intentionally left untouched during the pilot and still overlap with the new Start button — worth reconciling (or removing) once every remaining game has a manifest. -
Create manifests for SCUMM engine gamesDone:scummvmadded to the Dockerfile (/usr/games/scummvm, not on$PATHby default under a non-login shell — manifests use the absolute path). Manifests live in the usualGames\dosbox\*.jsoncatalog directory on the share, but theirzip_pathnow points at wherever the game's zip actually already lived (Games\Monkey Island\...,Games\Indiana Jones\..., etc.) — this required generalizing the manifest schema from a barezipfilename (implicitly underGames\dosbox\) to a fullzip_pathrelative to the share root, since these games weren't colocated with dosbox's. Added and verified end-to-end (install/start/stop/uninstall) viamonkey2:monkey— The Secret of Monkey Islandmonkey2— Monkey Island 2: LeChuck's Revengeatlantis— Indiana Jones and the Fate of Atlantisindy3— Indiana Jones and the Last Crusadetentacle— Day of the Tentacle
Skipped the German CD release of Day of the Tentacle on the share (
Day Of The Tentacle (CD DOS, German).zip) — unlike every other zip here, it doesn't wrap its contents in a single top-level folder (loose files at the zip root plus a strayMANIAC/dir for the embedded Maniac Mansion easter egg), so it doesn't fit the current "zip's top-level folder == install name" extraction convention. Also skipped Curse of Monkey Island (much larger, untested) — could be added the same way if wanted.ScummVM's own game-target IDs (
monkey,monkey2,atlantis,indy3,tentacle) happened to exactly match each zip's existing top-level folder name, so no change was needed to the install/extraction logic itself, only to where zips are looked up from. -
Handle multiple games running at onceDone: each running game now gets its own ephemeral X session (Xvnc+fluxbox+websockify, its own display:90-:99and noVNC port8090-8099) spun up bystart_game()and torn down bystop_game()(or lazily on the next page load, if the game exited/crashed on its own) — instead of every game sharing one screen and fighting over focus/audio. Capped atMAX_CONCURRENT_GAMES = 10; starting an 11th game while all 10 slots are in use is refused with an error shown on its row rather than silently doing nothing. There is no more a single shared "default" desktop or global noVNC link —server.shno longer starts Xvnc/fluxbox/websockify at container startup at all, onlysetup_server.pyitself; each game's own "Open Screen" link appears on its row only while it's running, built with a little client-side JS (the noVNC port differs from the setup port and can't be known server-side without knowing which hostname the browser used to reach the container).run.shpublishes the whole8090-8099range up front, since Docker can't add port mappings to an already-running container. Verified end-to-end with two different games running concurrently (separate processes, separate displays, separate noVNC ports, independent stop/teardown) and the 10-slot cap logic. -
Get game sound actually audible during play.
--device /dev/sndis passed through andalsa-utilsis installed, so DOSBox can write to an ALSA device inside the container, but VNC/noVNC only ever streams video, not audio — nothing currently carries that sound out to the browser.Target latency is a few tens of ms, not seconds — that rules out the "obvious" approach of a PulseAudio null sink piped through
ffmpeginto a compressed (mp3/ogg) HTTP/Icecast-style stream consumed by an<audio>tag: codec frame buffering plus the<audio>element's own jitter buffer realistically puts that in the 1-3s range, no matter how it's tuned.Concrete approach instead: PulseAudio null sink → capture raw/lightly-buffered PCM (small frames, e.g.
parecwith a short--latency) → push those frames to the browser over a plain WebSocket (new endpoint alongsidesetup_server.py, or a small dedicated process) → browser side, feed them straight into the Web Audio API via anAudioWorkletNode(not<audio>, notScriptProcessorNode— that's deprecated and has worse latency) for near-real-time scheduled playback. No container/codec framing in the path at all.Build this to be reusable across the other noVNC-family projects (
docker-xserver-novnc,docker-sdr-novnc), not dosbox-specific — it's a "browser audio + noVNC" concern, nothing about it is really about DOSBox. Follow thedocker-common/scripts/signals.shprecedent (see thedocker-commonrepo): keep the generic PulseAudio-sink/WebSocket/AudioWorklet piece project-agnostic there, then copy it (not symlink) into each project's ownscripts/the same way signal handling is shared, so a fix in one place gets propagated by hand to the others.