Mokutil --import doesn't work on my AlmaLinux 9.7 installation

After importing the key using mokutil –import and performing reboot, all I get is a few error messages basically saying that the /BOOT/EFI/mmx64.efi file didn’t load and the machine shuts off. I finally found out I could get back to start (key not enrolled) only by booting a live version of AlmaLinux 9 from usb. I see the mok manager screen then, but the live version can’t seem to recognize keyboard input. On the next reboot without the usb inserted, my regular OS boots again, but the key is still not entered. Is this a bug in AlmaLinux 9.7? I’m trying to stay with the secure boot process, but it seems to be forcing me to disable secure boot in order to use Virtual Box.

I spent yesterday doing endless search across the web of all the somewhat similar secure boot issues that people repeatedly have with installing third party kernel modules on various Linux spins over the years. By far most of the issues involved nvidia drivers or VirtualBox installation. From this volume of reading and learning, I eventually realized that MOK key enrollment is an intentionally convoluted procedure and depends on the OS to force a MOK manager to run on subsequent reboot. Apparently for Almalinux 9 this a PE executable call mmx64.efi, which was installed/updated somewhere along the way in /boot/efi/EFI/almalinux folder. /boot is apparently where the ESP partition on my system disk is mounted. The error when I was rebooting after running mokutil –import, indicated that the BIOS firmware couldn’t find the /EFI/BOOT/mmx64.efi file, i.e., almalinux mok manager. So after resetting with my live usb and rebooting again, I simply copied the mmx64.efi file from the /boot/efi/EFI/almalinux to the /boot/efi/EFI/BOOT folder. I did the mokutil –import of the key again and, VOILA!, the mok manager blue screen appeared on the subsequent reboot and I finally got the akmod key enrolled. Virtual Box now works on my secure boot enabled AlmaLinux 9.7 PC. So it appears to be an Almalinux install/update issue. This was the first time I had installed anything requiring akmod support, so I don’t know whether the issue was with the initial install of 9.5 or some subsequent update. I believe the system was updated from 9.6 to 9.7 just before I tried to install Virtual Box. The boot efi files had a date of July 26.