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!
Known issues
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 redirection
and selectkernel messages on debug output
. Note thatprintf()
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.