evansm7 / vftool

A simple macOS Virtualisation.framework wrapper

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Required kernel modules?

mbreese opened this issue · comments

Is there a list of what kernel modules are required for an image to boot? I'm trying this on an Intel Mac (Big Sur).

I've been successful in getting an Ubuntu VM to load (using the Ubuntu cloud images and following the instructions from @droidix #2 (comment)). I've also managed to get the cloud image of Debian 10 to work, by adding certain virtio modules to the initrd image, but it's still strange...

Basically, the Debian kernel works with the following modules added:

  • virtio_pci
  • virtio_blk
  • virtio_net
  • virtio_console

However -- it doesn't work exactly like this. When loading the kernel with the following options -a "root=/dev/vda console=hvc0", the VM goes right into the initramfs image. Adding virtio_console got me this far.

Steps (in either a chroot from the initramfs image or using the Ubuntu kernel/initrd to edit the Debian initrd)

(initramfs) mkdir /mnt
(initramfs) mount -t ext4 /dev/vda /mnt
root@(none):/# echo "virtio_console" >> /etc/initramfs-tools/modules 
root@(none):/# update-initramfs -u

I then copied the file /boot/initrd.img-4.19.0-13-amd64 image out of the disk image to use with vftool.

The strangeness is that I can get a full VM to boot when I add the debug option to the kernel command. Starting the vm with -a "root=/dev/vda console=hvc0 debug" successfully boots the Debian VM. It seems like there is a timing issue where the storage device isn't found unless the kernel is in debug mode, but I don't have any guess as to where it is.

I'd like to be able to use as stock of a Debian kernel as possible, so does anyone know which kernel modules or arguments I might need to try to get this to work stably?

Here is the full command line that works:

vftool -k vmlinuz-4.19.0-13-amd64 -i newinitrd -d debian_10_cloud.img -t 1 -m 2048 -a "root=/dev/vda console=hvc0 debug"      

This is the command that doesn't:

vftool -k vmlinuz-4.19.0-13-amd64 -i newinitrd -d debian_10_cloud.img -t 1 -m 2048 -a "root=/dev/vda console=hvc0"      

I have the same results if I'm using the full disk with partitions (using root=/dev/vda1) and only the ext4 partition (using root=/dev/vda).

I was able to bootstrap a debian instance using the comment mentioned above and additionally added notes.

Though, in my case, I'm using bullseye - I wonder if that would impact the behavior seen previously (I'm not going to try and use buster/current stable because I need a few things in bullseye anyway)

You can check my PR #20 😁

@fanvinga have any idea for android vm ?