# Rocky in VirtualBox fails to find hard disk

**URL:** <https://forums.rockylinux.org/t/rocky-in-virtualbox-fails-to-find-hard-disk/8783>\
**Category:** Rocky Linux Help & Support\
**Created:** [February 3, 2023, 12:58pm UTC](https://forums.rockylinux.org/t/rocky-in-virtualbox-fails-to-find-hard-disk/8783 "2023-02-03T12:58:23Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![nafmo](https://sea2.discourse-cdn.com/flex020/user_avatar/forums.rockylinux.org/nafmo/32/2451_2.png) [@nafmo](https://forums.rockylinux.org/u/nafmo)\
**Post date:** [February 3, 2023, 12:58pm UTC](https://forums.rockylinux.org/t/rocky-in-virtualbox-fails-to-find-hard-disk/8783/1 "2023-02-03T12:58:24Z")

</div>

Hi!

I am adapting a workflow where I use [Packer](https://www.packer.io) 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.

---

<div class="post-metadata">

**Author:** ![lipkowski.be](https://avatars.discourse-cdn.com/v4/letter/l/8e8cbc/32.png) [@lipkowski.be](https://forums.rockylinux.org/u/lipkowski.be)\
**Post date:** [February 8, 2023, 6:44am UTC](https://forums.rockylinux.org/t/rocky-in-virtualbox-fails-to-find-hard-disk/8783/2 "2023-02-08T06:44:04Z")

</div>

Hi,

have you set

```auto
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.

---

<div class="post-metadata">

**Author:** ![nafmo](https://sea2.discourse-cdn.com/flex020/user_avatar/forums.rockylinux.org/nafmo/32/2451_2.png) [@nafmo](https://forums.rockylinux.org/u/nafmo)\
**Post date:** [February 8, 2023, 8:34am UTC](https://forums.rockylinux.org/t/rocky-in-virtualbox-fails-to-find-hard-disk/8783/3 "2023-02-08T08:34:00Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![lipkowski.be](https://avatars.discourse-cdn.com/v4/letter/l/8e8cbc/32.png) [@lipkowski.be](https://forums.rockylinux.org/u/lipkowski.be)\
**Post date:** [February 8, 2023, 9:03am UTC](https://forums.rockylinux.org/t/rocky-in-virtualbox-fails-to-find-hard-disk/8783/4 "2023-02-08T09:03:36Z")

</div>

Hi,

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

---

<div class="post-metadata">

**Author:** ![nafmo](https://sea2.discourse-cdn.com/flex020/user_avatar/forums.rockylinux.org/nafmo/32/2451_2.png) [@nafmo](https://forums.rockylinux.org/u/nafmo)\
**Post date:** [February 8, 2023, 11:55am UTC](https://forums.rockylinux.org/t/rocky-in-virtualbox-fails-to-find-hard-disk/8783/5 "2023-02-08T11:55:33Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![lipkowski.be](https://avatars.discourse-cdn.com/v4/letter/l/8e8cbc/32.png) [@lipkowski.be](https://forums.rockylinux.org/u/lipkowski.be)\
**Post date:** [February 8, 2023, 12:00pm UTC](https://forums.rockylinux.org/t/rocky-in-virtualbox-fails-to-find-hard-disk/8783/6 "2023-02-08T12:00:10Z")

</div>

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 ?

---

<div class="post-metadata">

**Author:** ![nafmo](https://sea2.discourse-cdn.com/flex020/user_avatar/forums.rockylinux.org/nafmo/32/2451_2.png) [@nafmo](https://forums.rockylinux.org/u/nafmo)\
**Post date:** [February 8, 2023, 12:30pm UTC](https://forums.rockylinux.org/t/rocky-in-virtualbox-fails-to-find-hard-disk/8783/7 "2023-02-08T12:30:19Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![nafmo](https://sea2.discourse-cdn.com/flex020/user_avatar/forums.rockylinux.org/nafmo/32/2451_2.png) [@nafmo](https://forums.rockylinux.org/u/nafmo)\
**Post date:** [May 30, 2023, 6:57am UTC](https://forums.rockylinux.org/t/rocky-in-virtualbox-fails-to-find-hard-disk/8783/8 "2023-05-30T06:57:52Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![nafmo](https://sea2.discourse-cdn.com/flex020/user_avatar/forums.rockylinux.org/nafmo/32/2451_2.png) [@nafmo](https://forums.rockylinux.org/u/nafmo)\
**Post date:** [June 20, 2023, 6:54am UTC](https://forums.rockylinux.org/t/rocky-in-virtualbox-fails-to-find-hard-disk/8783/9 "2023-06-20T06:54:37Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![brian](https://sea2.discourse-cdn.com/flex020/user_avatar/forums.rockylinux.org/brian/32/5777_2.png) [@brian](https://forums.rockylinux.org/u/brian)\
**Post date:** [August 25, 2023, 2:59am UTC](https://forums.rockylinux.org/t/rocky-in-virtualbox-fails-to-find-hard-disk/8783/10 "2023-08-25T02:59:58Z")

</div>


