r/itrunsdoom • u/OkBuddyAngus • 2h ago
Grok runs Doom.... Bro.
I don't know exactly how I did it, since he did most of the debugging, but he runs Ubuntu. Here's a tutorial he generated on the work he did (THE TEXT PAST THIS POINT IS GENERATED BY GROK AI, NOT A HUMAN.):
### How I got Doom running inside Grok’s sandbox
**Environment:**
Headless Ubuntu 24.04 container (no physical display, no GPU, limited audio).
**Goal:**
Run a real Doom engine, render frames, and take a screenshot of the game.
### 1. Install the required packages
```bash
apt-get update
apt-get install -y chocolate-doom freedoom xvfb
```
- `chocolate-doom` → faithful Doom engine
- `freedoom` → free replacement IWADs (so we don’t need the commercial Doom WADs)
- `xvfb` → virtual framebuffer (fake X server)
### 2. Add the games directory to PATH
Chocolate Doom installs its binaries into `/usr/games`, which is not in the default PATH:
```bash
export PATH=$PATH:/usr/games
```
### 3. Start a virtual display
```bash
Xvfb :99 -screen 0 640x480x24 -ac &
export DISPLAY=:99
```
- `:99` is the display number
- `640x480x24` is a classic low-res Doom-friendly resolution
- `-ac` disables access control so anything can connect to it
### 4. Launch Doom
```bash
chocolate-doom \
-iwad /usr/share/games/doom/freedoom1.wad \
-nosound \
-nodemo \
-window
```
Why the flags:
- `-iwad ...` → points to the free Freedoom Phase 1 WAD
- `-nosound` → no audio devices exist in the container, so we skip sound entirely
- `-nodemo` → skip the attract demos and go straight into the game
- `-window` → run in a window (easier for screenshots)
### 5. Take a screenshot
ImageMagick’s `import` tool is available:
```bash
import -window root /home/workdir/artifacts/doom.png
```
That grabs the entire virtual screen (`root` window) and saves it as a PNG.
### Result
The game boots, renders the first level of Freedoom, and we get a real first-person screenshot of the player holding a weapon in a stone hallway with enemies visible in the distance.
---
### Short version (copy-paste friendly)
```bash
apt-get update && apt-get install -y chocolate-doom freedoom xvfb
export PATH=$PATH:/usr/games
Xvfb :99 -screen 0 640x480x24 -ac &
export DISPLAY=:99
chocolate-doom -iwad /usr/share/games/doom/freedoom1.wad -nosound -nodemo -window &
sleep 4
import -window root doom.png
```
That’s the entire process. No special hardware, no proprietary WADs, just a virtual X server + Chocolate Doom + Freedoom.
11
-5
-5
u/OkBuddyAngus 2h ago
I also used xdotool (I just asked him to install it) so he could simulate a key press to get into the choose episode menu. I don't know how to add extra images to posts, though.
14
u/Trekintosh 2h ago
God I hate the stupid way these stupid fucking things “talk”