← Back to all articles

Announcing WSL Doom!

Have you ever wanted to play Doom in the Windows Subsystem for Linux? Well, now you can!

Doom title screen rendering correctly in WSL2 with TrueColor colours

WSL Doom is a direct fork of id Software's linuxdoom-1.10 — the original Linux Doom source release. It includes 64-bit portability fixes and, critically, a TrueColor X11 port that allows the original source to be compiled and run on x86-64 Linux, including Windows Subsystem for Linux (WSL2) on Windows 11.

Why does this exist?

The port was originally developed as a real-world test case for JMCC — an AI-developed C compiler. In total, compiling and running Doom helped identify 37 codegen bugs in JMCC, covering a wide range of issues from pointer arithmetic and type handling to struct operations and platform-specific calling conventions. All of these were bugs that the compiler's own neatly isolated test cases missed, proving the value of Doom as a C language test suite.

Doom compiled with JMCC running in WSL2

JMCC compiled WSL Doom

What needed fixing?

The original source assumes two things that haven't been true for a long time:

  1. 32-bit pointers. The code is full of (int) casts on pointer values and hardcoded *4 pointer arithmetic. On a 64-bit system, pointers are 8 bytes — these assumptions corrupt memory and crash immediately.
  2. 8-bit PseudoColor X11 displays. Modern X servers only support TrueColor (24/32-bit). The original rendering pipeline writes 8-bit indexed colour values directly to the X11 framebuffer, which simply doesn't work anymore.

The fix involved 10 targeted changes for 64-bit portability (pointer casts, array sizing, zone memory) and a replacement i_video_truecolor.c that converts the game's internal 8-bit palette-indexed framebuffer to 32-bit ARGB via a lookup table before blitting to X11.

Source port family tree

Doom source port family tree showing the lineage from the original Doom through Linux Doom, WinDoom, and the many community ports including WSL Doom highlighted in green

Doom source port family tree (modified from Wikipedia)

WSL Doom sits directly under Linux Doom in the tree — it's not a modern source port like GZDoom or Chocolate Doom. The goal was to make the original source run on modern hardware with the minimum number of changes, not to add features.

Try it

The source code, build instructions, and WSL2 setup guide are all on GitHub: github.com/jamesmiles/doom-wsl

You'll need gcc, libx11-dev, libxext-dev, an X server on Windows (like VcXsrv), and a WAD file. The shareware doom1.wad works fine.

Comments