Skip to content

Porting native applications to OSv

Tzach Livyatan edited this page Mar 31, 2014 · 9 revisions

There are two way to run a native (e.g. C/C++) app on OSv:

  • Upload and call it on run time
  • Create a "precooked" appliance of OSv and the application

Once launching an appliance, it will automatically start both OSv and the application on top of it.

On both cases, the application have to be in a shared library format (.so). More on how to create a share library from an existing application here

Upload and call application on run time

Assuming you have a a shared library x.so you want to run. You will need to:

  1. Upload the library to OSv file system
  2. Call it
Upload an image to OSv file system:

You can use standard SCP to upload the file over SSH Upload the library, and any additional libraries it depend on to /usr/lib/

scp x.so admin@host:/usr/lib/

Use your real host ip and login/password.

If and only if you are running OSv locally and without a network bridge, you can take advantage of the port forwarding:

scp -P 2222 x.so admin@localhost:/usr/lib/

Run the application

From OSv CLI:

[/]% run /usr/lib/x

If you are running OSv remotely, you can connect to the CLI using SSH:

>ssh admin@192.168.122.89
admin@localhost's password: 
[/]% run /usr/lib/x

Use your real host ip and login/password. In the near future, OSv will support REST API for both run time uploading and running application.

Create a OSv appliance

The easiest way to create an OSv appliance is using Capstan. Go check it out!

Clone this wiki locally