BrowserVM: Running Unmodified Operating Systems and Applications in Browsers
Elliott Wen, Jim Warren, Gerald Weber · 2020
Web browsers are becoming a de-facto universal computing platform. Recently, research communities are attempting to enhance browsers with the capacity to run applications written in general programming languages. Existing approaches mainly compile source codes to browsers' native instruction sets JavaScript or WebAssembly. However, they usually fall short in practice because browsers lack operating system abstractions (e.g., thread and filesystem) and many programs would require extensive modifications. This paper presents BroswerVM, a new approach to run unmodified and complete operating systems and applications inside browsers. BrowserVM is a WebAssembly-based virtual machine hypervisor. BrowserVM efficiently conducts processor emulation through dynamic binary translation. It also provides performant hardware emulation for hard disks, graphics cards and network adapters. Implementing BrowserVM is challenging because of the unique characteristics of WebAssembly: semantic gap with low-level CPU assembly and high initialization overhead. We detail the methods to deal with these challenges and conduct a performance benchmark on BrowserVM. Our results indicate that though slower than native hypervisors, BroswerVM provides acceptable performance to execute existing applications that are not compute-intensive.