Skip to content

fix(cloud-hypervisor): Add initrd for urunit configuration#843

Merged
urunc-bot[bot] merged 1 commit into
mainfrom
fix_initrd_clh
Jul 24, 2026
Merged

fix(cloud-hypervisor): Add initrd for urunit configuration#843
urunc-bot[bot] merged 1 commit into
mainfrom
fix_initrd_clh

Conversation

@cmainas

@cmainas cmainas commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

Description

Include cloud-hypervisor in Linux's MonitorCli in order to set the urunit configuration as the initrd for the cloud-hypervisor VM.

Related issues

How was this tested?

Executed the arbor.nbfc.io/nubificus/urunc/busybox-cloud-hypervisor-linux-raw:latest and checked urunit logs along with cloud-hypervisor command

logs:

[   11.863133] Run /urunit as init process
Warning: No configuration for block mounts
/bin/sh: can't access tty; job control turned off
/ # 
[   32.981715] ACPI: PM: Preparing to enter system sleep state S5
[   33.008017] reboot: Restarting system
[   33.020332] reboot: machine restart

urunit found the configuration since it reports no block configuration. Also the cloud-hypervisor command:

$ ps aux | grep cloud
root       11277  7.8  0.1  19348  7052 pts/1    S+   15:59   0:00 sudo docker run --rm -it --runtime io.containerd.urunc.v2 harbor.nbfc.io/nubificus/urunc/busybox-cloud-hypervisor-linux-raw:latest
root       11278  0.0  0.0  19348  2588 pts/3    Ss   15:59   0:00 sudo docker run --rm -it --runtime io.containerd.urunc.v2 harbor.nbfc.io/nubificus/urunc/busybox-cloud-hypervisor-linux-raw:latest
root       11279 15.7  0.7 1809316 29568 pts/3   Sl+  15:59   0:01 docker run --rm -it --runtime io.containerd.urunc.v2 harbor.nbfc.io/nubificus/urunc/busybox-cloud-hypervisor-linux-raw:latest
root       11319 52.4  0.9 287932 36608 ?        Ssl  15:59   0:03 /opt/urunc/bin/cloud-hypervisor --memory size=268M,shared=on --cpus boot=1 --kernel /cntrRootfs/.boot/kernel --console off --serial tty --seccomp true --net tap=tap0_urunc,mac=92:18:8b:9d:fa:a9,mtu=1500 --initramfs /urunit.conf --fs tag=fs0,socket=/tmp/vhostqemu --cmdline panic=-1 console=ttyS0 root=fs0 rw rootfstype=virtiofs ip=172.17.0.2::172.17.0.1:255.255.0.0:urunc:eth0:off retain_initrd URUNIT_CONFIG=/sys/firmware/initrd init=/urunit -- /bin/sh
cmainas    11371  0.0  0.0   9144  2260 pts/4    S+   15:59   0:00 grep --color=auto cloud

LLM usage

N/A

Checklist

  • I have read the contribution guide.
  • The linter passes locally (make lint).
  • The e2e tests of at least one tool pass locally (make test_ctr, make test_nerdctl, make test_docker, make test_crictl).
  • If LLMs were used: I have read the llm policy.

@netlify

netlify Bot commented Jul 22, 2026

Copy link
Copy Markdown

Deploy Preview for urunc canceled.

Name Link
🔨 Latest commit 9d7b0fc
🔍 Latest deploy log https://app.netlify.com/projects/urunc/deploys/6a631aad056b180008644511

@cmainas
cmainas marked this pull request as ready for review July 22, 2026 16:51
@cmainas
cmainas requested a review from ananos July 22, 2026 16:51
@ananos

ananos commented Jul 24, 2026

Copy link
Copy Markdown
Contributor

Tested this on our dev box (CLH v50.0, virtiofsd 1.13.2). First reproduced #842 on main with the busybox-cloud-hypervisor-linux-raw image: the guest boots over virtiofs but urunit reports

Read configuration file: No such file or directory
Could not read file /sys/firmware/initrd

With this patch the same image boots and urunit finds its configuration ("Warning: No configuration for block mounts", which is the expected output for this image), and the CLH command line now carries --initramfs /urunit.conf. Also ran our standard qemu/fc boots with the patched binary -- no regression for the other monitors.

The fix itself is minimal and in the right place: BuildExecCmd for cloud-hypervisor already translated ExtraInitrd to --initramfs, it was only the MonitorCli gate that left CLH out. LGTM!

@ananos ananos left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verified on our dev box (details in the comment above) -- reproduced #842 on main and confirmed the fix. LGTM!

Include cloud-hypervisor in Linux's `MonitorCli` in order to set the
urunit configuration as the initrd for the cloud-hypervisor VM.

PR: #843
Signed-off-by: Charalampos Mainas <cmainas@nubificus.co.uk>
Reviewed-by: Anastassios Nanos <ananos@nubificus.co.uk>
Approved-by: Anastassios Nanos <ananos@nubificus.co.uk>
@urunc-bot
urunc-bot Bot merged commit ece02f8 into main Jul 24, 2026
5 of 7 checks passed
@ananos
ananos deleted the fix_initrd_clh branch July 24, 2026 07:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

urunit config is not passed as initrd in cloud-hypervisor

2 participants