Can't boot due to failed service

I’m getting the following error after I installed Oracle’s VirtualBox:

The problem is not on a VM but on my main desktop. I installed it typing sudo dnf install VirtualBox in the terminal and I remember it removed some kernel files but I didn’t pay much attention to which files they were since it didn’t actually work and I moved on to something else.

I rebooted the next day and that’s when I got a black screen launching one of the three options on the GRUB menu so I typed e to edit commands and removed rhgb and quiet to see the output of the boot attempt which is the picture I attached. So I went to the emergency shell and
typed:

[root@fedora ~] #systemctl status vboxdrv.service

# vboxdrv.service - Linux kernel module init script
    Loaded: loaded (/usr/lib/systemd/system/vboxdrv.service; enabled;    
    preset: enabled)
   Drop-In: /usr/lib/systemd/system/service.d
            10-timeout-abort.conf
    Active: inactive (dead)

I tried enabling the service
[root@fedora ~] # systemctl enable vboxdrv.service
and restarting it
[root@fedora ~] # systemctl restart vboxdrv.service
but it hasn’t worked and can’t still boot. Is there any way I can fix this?

systemctl status vboxdrv.service provides more output than you have shown.

Do you boot in secure mode?

If so, have you created you certificate and enroled it as described in the file /usr/share/doc/akmods/README.secureboot?

How did you install it?
I just ask this because of the vboxusers goup, you should be part of.

That’s all the output I get from the command. I’m typing it on the emergency shell so I don’t know if that makes it output less information.
Yes, I am booting in secure mode and I had no idea about the certificate.
I apologize for not giving more details, let me edit my original post.

I first typed in the terminal dnf search VirtualBox and after looking at the first package I installed it by sudo dnf install VirtualBox

1 Like

To confirm which repo it was installed from please post the output of dnf list installed VirtualBox

I suspect from what you just said that it was installed from the rpmfusion-free repo but need to confirm.

If VirtualBox was installed from rpmfusion and one had not previously performed the steps noted above about creating the key and enrolling it to allow signing kernel modules then the initial module created was likely unsigned and won’t load with secure boot enabled. That can be fixed relatively easily.

  1. find out exactly if the module was properly built.
    dnf list installed kmod-VirtualBox*
    which should show something like
kmod-VirtualBox-6.3.6-200.fc38.x86_64.x86_64                       7.0.8-1.fc38                                        @@commandline
  1. if it does then that (unsigned) package may be removed with
    sudo dnf remove kmod-VirtualBox-6.3.6*
  2. once removed and one is sure that the signing key has been generated and enrolled into the bios then the module may be rebuilt and signed with
    sudo akmods
  3. after rebuilding the module it may be verified by repeating step 1 above.
  4. After the module has been verified in step 4 then reboot and the system should now be able to load the module vboxdrv which has been missing previously.
2 Likes

Just to clarify, this means the package was installed from rpmfusion repository.

The package from oracle’s repo, which requires manual installation of dependencies, is called VirtualBox-7.0

1 Like

I forgot to mention (naively) that I previously removed the package with sudo dnf erase akmod-VirtualBox so I don’t get anything when typing dnf list installed kmod-VirtualBox* or sudo dnf remove kmod-VirtualBox-6.3.6* since I wiped it out. I also don’t know how to make the part of signing key and enroll it into the bios. Would you mind giving me more feedback on that part? Maybe a link to an online resource so I can read it and actually know what I’m doing because I am honestly out of the loop.

That will need reinstalled.
First follow the steps at /usr/share/doc/akmods/README.secureboot then reinstall that package. Also one may need to sudo dnf reinstall VirtualBox so everything is known to be up to date.

As long as the signing key is properly created and imported into the bios as shown in the README then reinstalling that VirtualBox package followed by a short wait and a reboot should enable the driver to be loaded.

1 Like

Thank you, I did what you told me and indeed the service is now enabled


However, I still cannot boot and I keep watching the same black screen. Any ideas on what could be causing it?

So after that, I supposed I have to reinstall GRUB and I did all the process of mounting my /root partition and I can’t get passed this error:

grub2-install: error: this utility cannot be used for EFI platforms because it does not support UEFI Secure Boot

after typing:
grub2-install --efi-directory=/boot/efi --target=x86_64-efi /dev/nvme0n1p8/

since I’m in a UEFI based system. I alternated the command with this one:
grub2-install --efi-directory=/boot/efi --bootloader-id=fedora /dev/nvme0n1p8

but this time I get

grub2-install: error: cannot find a device for /boot/grub2 (is /dev mounted?)

What do you guys think I could do to make it past these errors?

Don’t touch grub2. It is working fine.

When you ran grub2-install it told you it was not the proper command

You clearly said you are using secure boot, which is why the vboxdrv module needed to be signed.

As noted above grub is working or your system would not have gotten to the point it did in the boot.

Is the boot hanging at the point shown in that last image? If so then it seems possible that it is being halted by problems in configuring the network. Some have had similar problems when their network was wifi and the wifi adapter had an issue either with firmware or with the driver.

Have you tried booting with a live install image and verified that the network properly works with the live image boot?

Please boot to the live image, then install inxi and provide us with the output of inxi -Fzxx if at all possible.

Alright so grub is working fine.

Yes I get the black screen after I launch any of the three options in the grub menu and the output of the boot attempt is finished.

Here’s the output of inxi -Fzxx

While it is much preferred to view text and not images, I was able to note that there is NO driver loaded for the nvidia GPU. That is likely the cause of the black screen.

Have you attempted to install the nvidia driver from rpmfusion? From some other source? Or have you done install and removal of drivers at some point?

Please post the output of dnf list installed '*nvidia*' and dmesg | grep -iE "secure|nvidia|nouveau"