A compiler toolchain that turns C and C++ code into WebAssembly so it can run in browsers, Node.js and other Wasm runtimes.
copy/v86
An x86 PC emulator that runs in the browser, translating machine code to WebAssembly at runtime to boot real operating systems.
- Stars
- 23,609
- Forks
- 1,924
- Open issues
- 116
- Last commit
- 3 days ago
What is it?
v86 emulates an x86-compatible CPU along with a set of PC hardware, including a VGA card, PS/2 keyboard and mouse, IDE and floppy controllers, a PCI bus, NE2000 and virtio network devices, and a SoundBlaster 16 sound card. Machine code is translated into WebAssembly modules at runtime to achieve reasonable performance inside a browser tab.
The project is aimed at running old and hobby operating systems in the browser. The project documents working guests including various Linux distributions, FreeDOS, MS-DOS, Windows 95 through 2000, ReactOS, Haiku and FreeBSD, with some Windows XP and later versions working only under certain conditions. Disk images are loaded from URLs, and the emulator can be embedded in a web page through libv86.js or the v86 npm package.
The emulator has a JavaScript API for controlling the serial console, saving and restoring state, and wiring up networking between instances. It can also be built locally with Rust and Make, with a debug build and an optimized build.
Key features
- 01Emulates an x86 CPU up to roughly Pentium 4 level with SSE3 support
- 02Translates machine code to WebAssembly at runtime
- 03Includes VGA with SVGA and Bochs VBE extensions, plus PS/2 keyboard and mouse
- 04Provides virtio, NE2000 and dial-up modem networking options
- 05Supports saving and restoring emulator state
- 06Can be embedded via libv86.js or the npm package
Use cases
- Running retro operating systems like Windows 95 or MS-DOS in a web page
- Demonstrating or teaching how a PC and x86 boot process work
- Embedding a sandboxed Linux or DOS environment in a browser-based tool
- Studying CPU emulation and dynamic binary translation to WebAssembly
Quick start
- 1
Install the npm package
npm install v86 - 2
Embed the emulator in a webpage using the V86 constructor, as shown in the README API example
Things to know
- 64-bit guest operating systems are not supported.
- Multicore emulation is not supported.
- Building from source requires Rust, clang, Java and Node.js, plus other tools.
- Some operating systems, such as Plan 9 and OS/2, do not work.
Topics
FAQ
- What is v86?
- An x86 PC emulator that runs in the browser, translating machine code to WebAssembly at runtime to boot real operating systems. v86 emulates an x86-compatible CPU along with a set of PC hardware, including a VGA card, PS/2 keyboard and mouse, IDE and floppy controllers, a PCI bus, NE2000 and virtio network devices, and a SoundBlaster 16 sound card. Machine code is translated into WebAssembly modules at runtime to achieve reasonable performance inside a browser tab.
- Is v86 free to use? What license does it have?
- v86 is open source under the BSD-2-Clause license. Check the license terms before using it in commercial products.
- Is v86 still maintained?
- Actively maintained. The last commit to v86 was on Oct 18, 2026.
- What can I use v86 for?
- Running retro operating systems like Windows 95 or MS-DOS in a web page Demonstrating or teaching how a PC and x86 boot process work Embedding a sandboxed Linux or DOS environment in a browser-based tool Studying CPU emulation and dynamic binary translation to WebAssembly
- How do I install v86?
- Install the npm package: npm install v86 Embed the emulator in a webpage using the V86 constructor, as shown in the README API example
- Where can I get v86?
- The source code and installation instructions are on GitHub: https://github.com/copy/v86
Summary generated by AI from the project's README. GitHub stats refresh daily.
Related projects
A pure WebAssembly and JavaScript port of FFmpeg that lets browsers record, convert and stream video and audio.
A Rust framework for building interactive client-side web apps by compiling to WebAssembly, with a JSX-like macro for HTML.
A WebAssembly runtime and CLI for running apps and AI agent code in fast, lightweight, sandboxed environments.
A standalone WebAssembly runtime built on the Cranelift code generator, with WASI support and embeddings for multiple languages.
A TypeScript-like language and compiler that turns a typed subset of TypeScript into WebAssembly modules.