Skip to content

Running unmodified Linux executables on OSv

WALDEMAR KOZACZUK edited this page Jan 22, 2020 · 9 revisions

From the beginning, OSv has been designed to implement a subset of Linux flavor of POSIX API. But until the release 0.54.0 most Linux applications had to be re-compiled from source as shared libraries or some, like Java, rely on OSv version of /usr/bin/java wrapper to run. This meant one could NOT run a Linux executable "as is". In other words, OSv has always been Linux-compatible at source level but not at binary level.

Starting with the release 0.54.0, it should be in general possible to run unmodified Linux position-independent executables (so-called "PIEs") and position-dependent executables "as-is" as long as they do not use "fork/execve" or other unsupported Linux API. It means that very often one can take a binary from Linux host and run it on OSv without having to locate the source code on the Internet and build it as a shared library. At this moment OSv still does not support statically-linked executables as described here.

So how can one run arbitrary Linux executable on OSv? In high-level it as simple as locating and adding the relevant executable file and any related files onto the filesystem that is part of an OSv image and running that image on the hypervisor of choice. An executable can be located on the host filesystem or can be downloaded from Internet. Very often an executable would depend on a number of shared libraries which also need to be added to the image.

Creating OSv image requires fusing a kernel and application files either using Capstan or the python-based build scripts. The former is ... and described here .... The build script require manifest that can be put by hand or using manifest_from_host.sh

Clone this wiki locally