QEMU fails to run KIWI-created Tumbleweed KIS image (Kernel panic; unable to mount root fs)

18 views
Skip to first unread message

Delaney Ebbinger

unread,
Feb 14, 2024, 3:49:12 PMFeb 14
to kiwi
I'm currently trying to build a custom OpenSUSE Tumbleweed image which should ultimately be bootable via iPXE. I've already successfully managed to build a hybrid live image of the desired configuration by following the "Build an ISO Hybrid Live Image" guide; following this I'm trying to deploy the same image as a KIS image.

The current <type> element of my config.xml looks as follows:
<preferences>
  <type image="kis" filesystem="ext4"/>
</preferences>

KIWI (running on a Tumbleweed build machine) successfully builds the image and creates the seemingly correct files. I end up with an .initrd, a kernel, an .append file, and a rootfs.

The problem now arises when trying to boot the image via the QEMU method outlined in the KIS guide, using the following command:

qemu-system-x86_64 -kernel /tmp/builddir/*.kernel  -initrd /tmp/builddir/*.initrd  -hda /tmp/builddir/tumbleweedkis.*-1.99.1  -append $(cat /tmp/builddir/*.append) -serial stdio

QEMU first spits out a warning about "the image format not being specified and probing guessed raw" and informs me that as a result of this write operations would be restricted.
It then successfully boots the kernel and the initrd but completely fails to switch into the root fs with "Kernel panic - not syncing: VFS: Unable to mount root fs". To me this looks like either current QEMU versions for some reason can't work with the rootfs created by my KIWI or I have overlooked something in my configuration.

I'd appreciate your help in pinpointing this issue a lot. Unfortunately I also haven't found any example config.xml for a working OpenSUSE KIS build I could use as a starting point for troubleshooting - so I'd also be extremely grateful if someone more knowledgeable than me could point me in the right direction.

Best, Del.

Marcus Schäfer

unread,
Feb 15, 2024, 3:59:56 AMFeb 15
to kiwi-...@googlegroups.com
Hi,

our documentation needs to improve here. I will update the
chapter right after this mail.

> QEMU first spits out a warning about "the image format not being
> specified and probing guessed raw" and informs me that as a result of
> this write operations would be restricted.

yes and this is an issue. You built a kis image, meaning kernel + initrd
+ a filesystem image. The option "-hda ..." expects a disk image containing
a partition table and if you don't provide further information how this
device should be connected to the VM it will not appear in the way
you expect it.

So change your "-hda ..." option to:

-drive file=/tmp/builddir/tumbleweedkis.*-1.99.1,if=virtio,driver=raw

> It then successfully boots the kernel and the initrd but completely
> fails to switch into the root fs with "Kernel panic - not syncing: VFS:
> Unable to mount root fs".

correct because the device with the UUID mentioned in the .append file
did not appear. This will change if you attach the filesystem image
as suggested above.

You should also add "rw" to the append line because a raw filesystem
image is still not a disk and linux will see this device as unclean
and will mount it read-only. Thus my full command line looked like this:

qemu-kvm \
-cpu Broadwell-v2 \
-m 4096 \
-netdev user,id=user0 \
-device virtio-net-pci,netdev=user0 \
-serial stdio \
-kernel kiwi-test-image-disk.x86_64-1.42.1-6.7.4-1-default.kernel \
-initrd kiwi-test-image-disk.x86_64-1.42.1.initrd \
-append "$(cat *.append) rw" \
-drive file=kiwi-test-image-disk.x86_64-1.42.1,if=virtio,driver=raw

and that booted up and worked for me

Hope this helps.

I will update the docs

Cheers,
Marcus
--
Public Key available via: https://keybase.io/marcus_schaefer/key.asc
keybase search marcus_schaefer
-------------------------------------------------------
Marcus Schäfer Brunnenweg 18
Tel: +49 7562 905437 D-88260 Argenbühl
Germany
-------------------------------------------------------
signature.asc
Reply all
Reply to author
Forward
0 new messages