hermit-rs icon indicating copy to clipboard operation
hermit-rs copied to clipboard

Request for info: running hermit-based applications on top of Xen

Open lyuts opened this issue 2 years ago • 3 comments

Hi guys,

Thank you for this project and your effort, this looks very interesting and promising. Out of curiosity I decided to give a try of hello world in one of test xen installations.

Compiled with

cargo build -Zbuild-std=std,core,alloc,panic_abort -Zbuild-std-features=compiler-builtins-mem --target x86_64-unknown-hermit

I grabbed the produced binary, created an empty initramfs and tried spinning up a domU. Guest failed to run, and I'm getting the following errors in the xl logs.

2022-12-27 02:10:11.988+0000: xc: panic: xc_dom_hvmloader.c:112: xc_dom_parse_hvm_kernel: ELF image is not 32bit: Invalid kernel
2022-12-27 02:10:11.988+0000: libxl: libxl_dom.c:578:libxl__build_dom: xc_dom_parse_image failed
2022-12-27 02:10:11.988+0000: libxl: libxl_create.c:1654:domcreate_rebuild_done: Domain 53:cannot (re-)build domain: -3
$ file target/x86_64-unknown-hermit/debug/unikernel_demo
target/x86_64-unknown-hermit/debug/unikernel_demo: ELF 64-bit LSB pie executable, x86-64, version 1 (embedded), dynamically linked, BuildID[xxHash]=3122861d032a21a2, with debug_info, not stripped

This is probably not a bug, and instead I'm looking for pointers in investigating this or proper ways to run this on Xen. Any bits of information would be useful. Thank you.

lyuts avatar Dec 27 '22 02:12 lyuts

Update: I should confirm that I'm on a 64bit host, and 32 bit error message looks like a red herring. I realized that I'm just feeding in a produced binary as is. I compressed it and I'm now getting a more descriptive error:

xc: panic: xc_dom_core.c:692: xc_dom_find_loader: no loader found: Invalid kernel

which makes sense, and I need to figure out how to bundle both loader and kernel when creating the guest.

lyuts avatar Dec 29 '22 03:12 lyuts

Excuse me, I oversaw this issue. I know this issue. Currently, we don't have the time to support Xen.

stlankes avatar Feb 10 '23 09:02 stlankes

@stlankes , do you think would it be possible for you and/or other project core team to document Xen support, i.e. issues, blockers, and what bits are missing? I myself would find it very useful for studying the domain, and maybe someone from the community could step up and help with the implementation.

lyuts avatar Feb 25 '23 20:02 lyuts