Rocky in VirtualBox fails to find hard disk

Hi!

I am adapting a workflow where I use Packer to generate an OVF image of CentOS 7 + extra RPMs to do the same for Rocky Linux 9 (with RPMs compiled for it, of course), fully scripted with a kickstart file to run unattended. I run the build on an ESXi server, and the OVF imports fine into another ESXi server.

For local testing, I have been running VirtualBox locally on my machine, and imported the OVF there (this is also something I know is used downstream from us), and this has been working fine. With the Rocky Linux 9 OVF, however, the kernel boots up but is unable to find the LVM. Grub sees the hard disk and boots the kernel, but the kernel cannot find the hard disk.

I did a side-by-side comparison of the generated .ovf file, and except for the file names and sizes, the VM settings are identical.

Has anyone seen anything similar and have ideas?

Running the installer in VirtualBox directly generates a VM that works fine, so I know VirtualBox can run Rocky 9.

Hi,

have you set

rd.lvm.vg=<name of your vg> 

in the grub kernel params?

I have the problem that the lvms do not build at startup. This has helped me.

Yes, the rd.lvm.vg parameter is correct, so that’s not it. From the emergency shell that eventually opens, I can not see any disks whatsoever, it is like the kernel doesn’t load any drivers.

I have tried experimenting changing the controller type for the hard disk image, but I haven’t found any combination that works yet.

Hi,

it is possible to set the device port type in virtualbox. Try to set sata if not already set.

Yeah, I tried all combinations I can think of, but none make the disk show up (I checked dmesg, it does not list finding the disks). Weird.

Hi,

have you checked if you are require to rebuild the initrd via dracut? Have you checked if some modules excluded or missing in your dracut.conf ?

If I install directly in VirtualBox, it comes up just fine. This happens when I build on ESXi and export as OVF, and then import this into VirtualBox.

I am migrating from a CentOS 7 based setup, where that works just fine, but the Rocky build is not playing along. Maybe it is indeed missing some modules that used to be included; I will have to look at whether I can have the kickstart configuration force it to include all modules.

I upgraded the base image to Rocky Linux 9.2, and am seeing the same issues. Perhaps it is the initrd that is not populated with enough device drivers to find the hard drive under a different environment? Is there an option somewhere to get it to include a more complete set of drivers?

grub starts and loads the kernel, so the VM can quite obviously see the hard disk, it’s just the kernel that doesn’t.

Tested now generating a corresponding RHEL 9.2 image, and it fails in the same way, so it doesn’t seem to be Rocky-specific.