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
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:
Clone the helloworld application to
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:
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:
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!
In this early release, there a couple of things that do not work yet as expected. Please check out this page to get an overview of items we are working on:
- Console on Xen on ARM is not working. In order to see any output, use a Xen hypervisor that supports debug consoles (you probably need to rebuild the hypervisor with `debug=y`). In Unikraft's menu go to
Library configuration -> ukdebug -> Message redirectionand select
kernel messages on debug output. Note that
printf()will still not work until the Xen console is implemented.
- Initialization of memory allocator crashes on Xen on ARM. In Unikraft's menu, unselect
Library configuration -> ukboot -> Initialize ukallocbbuddy as allocator
- Scheduling works currently only on x86 and Xen.
This category currently contains no pages or media.