Search code examples
c++kvmconanunikernel

IncludeOS hello world failing


I would like to look into IncludeOS and run their hello world. I am on Ubuntu and did install the required dependencies. The program exits with an error. What am I doing wrong here?

apt-get install python3-pip python3-dev git cmake clang-6.0 gcc nasm make qemu
pip3 install setuptools wheel conan psutil jsonschema
conan config install https://github.com/includeos/conan_config.git

I followed the installation instructions and used the clang-6.0-linux-x86_64 profile, as is recommended for Linux. The profiles are listed here

git clone https://github.com/includeos/hello_world.git
mkdir your_build_dir && cd "$_"
conan install ../hello_world -pr <your_conan_profile>
source activate.sh
cmake ../hello_world
cmake --build .
boot hello

The program crashes when calling it with the boot command.

The output (some paths altered) when calling boot hello -dv (verbose, debug)

* <boot>:  VERBOSE mode set for environment
* <VMRunner>:  Loading default config. 
* <VMRunner>:  Trying to load config from /path/to/vm.vanilla.json 
* <VMRunner>:  Successfully loaded vm config 
* <VMRunner>:  " Single virtio nic with vanilla cpu features " 
* <VMRunner>:  Trying to load config from ./vm.json 
* <VMRunner>:  Successfully loaded vm config 
* <VMRunner>:  " {'net': [], 'image': 'service.img', 'mem': 128} " 
* <VMRunner>:  {'description': 'Single virtio nic with vanilla cpu features', 'net': [], 'image': 'service.img', 'mem': 128} 
* <boot>:  Args to pass to VM:  []
* <boot>:  1 VM initialized. Commencing build- and boot...
* <VMRunner>:  Loading default config. 
* <VMRunner>:  Trying to load config from path/to/vm.vanilla.json 
* <VMRunner>:  Successfully loaded vm config 
* <VMRunner>:  " Single virtio nic with vanilla cpu features " 
* <VMRunner>:  Trying to load config from ./vm.json 
* <VMRunner>:  Successfully loaded vm config 
* <VMRunner>:  " {'net': [], 'image': 'service.img', 'mem': 128} " 
* <VMRunner>:  {'description': 'Single virtio nic with vanilla cpu features', 'net': [], 'image': 'service.img', 'mem': 128} 
* <boot>:  Booting in debug mode
* <boot>:  No file extension. Trying to boot as kernel
* <VMRunner>:  VM boot, timeout:  None multiboot:  True Kernel_args:   image_name:  hello 
* <VMRunner>:  Booting with multiboot: True kernel_args:   image_name: hello 
* <qemu>:  KVM ON 
* <VMRunner>:  File magic:  hello: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), statically linked, stripped

* <VMRunner>:  Found 64-bit ELF, need chainloader 
Looking for chainloader: 
Found /path/to/chainloader Type:  /path/to/chainloader: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), statically linked, stripped

* <VMRunner>:  Booting hello directly without bootloader (multiboot / -kernel args) 
* <VMRunner>:  Command: sudo qemu-system-x86_64 --enable-kvm -cpu kvm64,+rdrand,+rdseed -kernel /path/to/chainloader -append "" -initrd hello "" -s -m 128 -nographic 
[ WARNING ] Running with sudo
* <qemu>:  Started process PID  1343 
* <VMRunner>:  Event loop done. Exit status: None poll: 1 
* <VMRunner>:  No poll - getting final output 
* <VMRunner>:  Exit called with status 1 ( PROGRAM_FAILURE ) 
* <VMRunner>:  Message: process exited Keep running:  False 
* <VMRunner>:  Calling on_exit 
* <VMRunner>:  Program exit called with status 1 ( PROGRAM_FAILURE ) 
* <VMRunner>:  Stopping all vms 

[ PROGRAM_FAILURE ] process exited

Solution

  • After some work I found the answer: Hardware virtualization was disabled on my machine. I solved it by using this solution.

    ...such a stupid mistake!