Category:Unikraft Users
Getting started with Unikraft
In the following we will compile and run a small "Hello World"-application with Unikraft. Before we start you'll need to make sure that you have gcc
, make
and git
installed.
First of all, we are going to create a directory structure for building Unikraft:
mkdir unikraft cd unikraft mkdir apps
Clone the Unikraft main repo:
git clone http://xenbits.xen.org/git-http/unikraft/unikraft.git
Clone the helloworld application to apps/
:
cd apps git clone http://xenbits.xen.org/git-http/unikraft/apps/helloworld.git
We're now ready to start configuring the application image via Unikraft's menu. To access it, simply type:
cd helloworld make menuconfig
Select your target architecture and platforms. There will be an image generated for each platform. After you exit and saved your configuration, we can build the individual unikernel images:
make
After the build completed, you can run your image. The execution steps depends where you run the image on.
For Linux user-space, the image is just a standard ELF, so you can simply run it with:
./build/helloworld_linuxu-x86_64
For KVM, you can use the following command line:
qemu-system-x86_64 -enable-kvm -m 4 -device isa-debug-exit -vga none -device sga -serial stdio -kernel build/helloworld_kvm-x86_64
For Xen, you first need to create a VM configuration:
name = 'helloworld' vcpus = '1' memory = '4' kernel = './build/helloworld_xen-x86_64'
Save it as helloworld.cfg
and run the guest with:
xl create -c helloworld.cfg
And that's it! For more information please check out the documentation in our Unikraft repository. Thanks!
This category currently contains no pages or media.