> ## Content Index
> Fetch the complete content index at: https://itsfoss.com/llms.txt
> Use this file to discover other available public pages before exploring further.

# Wow! You Can Now Run Linux Inside a PDF
- URL: https://itsfoss.com/news/running-linux-in-pdf/
- Published: 2025-02-04T09:55:06.000Z
- Updated: 2025-02-04T09:55:06.000Z
- Description: Yes, you read that right.
- Author: Sourav Rudra
- Tags: Linux, News, #Import 2025-11-08 21:15

Other than being a reliable piece of software, Linux has made some really cool things a reality, be it by powering a [coffee maker](https://www.reddit.com/r/LinuxActionShow/comments/594b7m/the%5Fnew%5Fcoffee%5Fmachine%5Fat%5Fmy%5Fworkplace%5Fruns%5Flinux/?ref=itsfoss.com) or running Doom [on a terminal](https://itsfoss.com/android-16-linux-terminal-doom/). Of course, the tinkerers who dedicate their time and resources to innovate are the real MVPs here.

One such tinkerer, [vk6\_](https://www.reddit.com/user/vk6%5F/?ref=itsfoss.com) (*aka ading2210/Allen*), a high-school student with an affinity for programming, web development, and cybersecurity, has managed to do something very noteworthy.

They successfully **managed to run Linux inside a PDF file** on a [web browser](https://itsfoss.com/best-browsers-ubuntu-linux/). 🤯

## Running Linux Inside A PDF: What's Happening?

0:00 

/0:37 

1× 

Just a short demo of LinuxPDF booting up and the **man* command being executed.

Building on an earlier project where they got Doom to [run in a PDF file](https://github.com/ading2210/doompdf?ref=itsfoss.com), the developer has now released LinuxPDF, that is powered by a modified version of the [TinyEMU](https://bellard.org/tinyemu/?ref=itsfoss.com) RISC-V emulator that has been compiled to [asm.js](https://en.wikipedia.org/wiki/Asm.js?ref=itsfoss.com) using an older version of [Emscripten](https://emscripten.org/?ref=itsfoss.com).

By leveraging the [PDF](https://en.wikipedia.org/wiki/PDF?ref=itsfoss.com) format's [JavaScript](https://en.wikipedia.org/wiki/JavaScript?ref=itsfoss.com) support, they enabled Linux to run within the document, utilizing the limited but functional JavaScript support available in Chromium-based browsers.

In its current state, users can use the virtual keyboard to interact with LinuxPDF, run commands, or send keystrokes to the [virtual machine](https://itsfoss.com/virtual-machine/) using the text box. Another thing to note is that this uses the same display code as DoomPDF (*linked above)*.

To quote Allen, they define the inner workings of LinuxPDF like this:

> C code can be compiled to run within a PDF using an old version of Emscripten that targets asm.js instead of WebAssembly. With this, I can compile a modified version of the TinyEMU RISC-V emulator to asm.js, which can be run within the PDF. For the input and output, I reused the same display code that I used for DoomPDF. 

> It works by using a separate text field for each row of pixels in the screen, whose contents are set to various ASCII characters. For inputs, there is a virtual keyboard implemented with a bunch of buttons, and a text box you can type in to send keystrokes to the VM.

### Want To Try It Out?

For a quick test run, you can visit the [official website](https://linux.doompdf.dev/linux.pdf?ref=itsfoss.com) that hosts the live demo; just keep in mind that it **only works on Chromium-based web browsers**. If you want to build it from source, then you should visit [GitHub](https://github.com/ading2210/linuxpdf?ref=itsfoss.com).

[LinuxPDF](https://linux.doompdf.dev/linux.pdf?ref=itsfoss.com)

Additionally, I highly recommend you read the original [Reddit thread](https://www.reddit.com/r/linux/comments/1ifwpl0/i%5Fgot%5Flinux%5Frunning%5Fin%5Fa%5Fpdf%5Ffile%5Fvia%5Fa%5Friscv/?ref=itsfoss.com) for some great community commentary on this project.

**Suggested Read** 📖

[Running Doom on Android 16’s Linux TerminalWho would’ve thought Doom could run on the upcoming Android 16’s Linux Terminal?![](https://news.itsfoss.com/content/images/size/w256h256/2022/08/android-chrome-192x192.png)It's FOSS NewsSourav Rudra![](https://news.itsfoss.com/content/images/2025/01/doom-on-android-16-terminal.png)](https://itsfoss.com/android-16-linux-terminal-doom/)