A new project has emerged that allows a stripped-down Linux instance to run inside a PDF file. This innovative approach leverages the PDF format’s capability to execute limited JavaScript, enabling a 32-bit RISC-V Linux buildroot environment to boot within a compatible PDF viewer.
The project, known as LinuxPDF, was developed by a GitHub user who previously created DoomPDF. By compiling the TinyEMU emulator into JavaScript and embedding it in a PDF, users can run a basic Linux distribution. However, performance remains a concern, with boot times reaching up to a minute, making it significantly slower than typical Linux boot processes.
LinuxPDF requires a Chromium-based browser for execution, and while it allows basic Linux commands such as creating directories and text files, it doesn’t support persistent storage. Any changes made during a session are lost after closing the PDF. Users can install applications, but without networking capabilities, they must be downloaded during the build process.
Despite its limitations, LinuxPDF demonstrates the potential of utilizing the PDF format for unconventional applications. The developer notes that modern PDF engines have robust security measures in place, mitigating risks associated with executing JavaScript. However, users are still advised to exercise caution and only open files from trusted sources.
For those interested in exploring further, a 64-bit RISC-V version of Alpine Linux is also available, although it is reported to be even slower than the 32-bit version.
For more detailed information, visit the original article here.