- Chromium browsers can turn a PDF into a working Linux environment under emulation
- Chrome’s disabled JIT compiler hampers performance
- High school-aged developer has form for impressive PDF projects, such as running Doom inside one
A high-school student has achieved another coding feat, getting a lightweight Linux distribution to run inside a PDF document.
Ading2210 developed LinuxPDF for Google Chrome and other Chromium-based browsers by leveraging a version of TinyEMU, a RISC-V emulator, that has been modified to run inside a PDF.
Unlike traditional virtual machines, this emulator operates entirely within Chrome’s PDF viewer by utilizing an older version of Emscripten that compiles to asm.js instead of WebAssembly.
How LinuxPDF works
When a user opens the file and agrees to “Start Emulator,” the embedded code loads, launching a minimal Linux environment. The interface consists of a text-based Linux viewport with a soft keyboard made of interactive PDF buttons. Users with a physical keyboard can enter commands in a designated input field.
Despite its ingenuity, LinuxPDF is far from practical for regular use. According to Ading2210, boots takes between 30 and 60 seconds.
This sluggish performance is thanks to Chrome’s disabled Just-in-Time (JIT) compiler, a move which bolsters security but prevents optimizations that could speed up code execution. As a result, LinuxPDF remains more of a technical experiment than a functional operating system.
Those interested in testing LinuxPDF can open it in a Chromium-based browser like Google Chrome or Microsoft Edge. Developers can also explore or modify the source code which is freely available on GitHub.
Via TomsHardware