Fixing Gentoo Fom My Mistake

Been playing with VirtualBox and Qemu on my Gentoo install, and Qemu, somehow put a block in my /boot menu. Come to find out the CPU I have will not even support VirtualBox or Qemu due to the missing VT-x, needed for both, always check CPU specs on the older Intel CPU’s, just might save one from what I did not do!!!
But with Gentoo, there is usually a fix!!! The fix was to boot with a Gentoo usb and chroot back into the Gentoo install, once in, cd to /boot and do a ls and note the grub entries and the date of the grub entry. Use rm -R to remove the grub entry and reinstall grub reinstall grub-mkconfig and exit out of chroot and reboot.
Everything is back to normal with no errors!!!

2 Likes

That is mysterious… did the qemu install attempt fail with some message about
cpu requirements?
Yes you can wipe /boot/grub/grub.cfg and it will still boot from another linux, but not from itself. You get a very elementry
grub menu, which can then be fixed , as you say , by grub-mkconfig
but
you removed more than grub.cfg? Not sure what that does.
and
I think you could have used a mount instead of a chroot, then remove grub.cfg, and let it boot without it.

The mystery is, why did qemu install interfere with grub?

1 Like

I was led to believe qemu would work without kvm, so I tried a qemu vm install and got the error, that this version of qemu does not support usb redirect, and that is how the block, that somehow affected grub came to be!!!

The chroot was the only way I found to solve the block.
Now I need to find a way to keep the virtualbox modules from auto loading at boot, without a kernel remake, which mau be impossible, without doing a manual kernel install.

Blacklist them in /etc/modules

I have heard and read about this but have never used the blacklist, will google blacklist.

I have Qemu in my Gentoo laptop. There’s Debian and Nixos (on Qemu) and they don’t interfere my boot process any way. I’m using openrc, grub2, gentoo-kernel-bin with efistub on that laptop. It’s pure 64bit system, Wayland + Hyprland. I don’t know what caused the boot problem but like you said it’s just chroot+grub-mkconfig to fix the issue! I nowadays have a Debian/Void/similar distro as a dual boot on my computers if there’s any problems with Gentoo. Then I can boot the computer and chroot.

1 Like

@ihasama
Thanks for the info but my core 2 duo intel e4500 has no support for virtualization but it would and does dual boot well.
Just trying to clean up the mess I created. I could just reinstall Gentoo, but that will have to be for another day. And greetings to a Gentoo user!!!

Hi Daniel, sorry I didn’t know you are on older HW! Try to fix it, not to reinstall. If you have a stage4 then use it. I still rely on stage4 backup even though it’s masked now. I also have a clonezilla backup. Good luck with the re-emerging☺️

@ihasama
It is running well now, doubtful if it will ever get a Gentoo reinstall!!!

I have never used the stage4 and not really worth bkups, of course their is a Windows PC, but it does not see Linux!!!

Nice to hear from someone with Void.
I dual boot too, it does help when there are problems.

1 Like

If there is an entry present in /etc/modules for the modules you want to remove, you can just remove the entry.
If there is no entry, you have to add a blacklist entry

Some systems use /etc/modules.d/ directory instead of /etc/modules/file

1 Like

I found where and why the virtualbox modules were being loaded!!
You will find them here " /usr/lib/modules-load.d/virtualbox.conf"
vbox modules
The modules do not load after commenting out!!!
Since Vbox will never be installed on this PC, it should be safe to just remove modules-load.d dir?

1 Like

Leave the directory there. You may want to load other modules in the future.
Commenting out is fine, just leave it like that.

If memory serves me well the directory modules-load.d is used to compose modules-load from when you do an env-update or something like that? It’s the directory where you do all your editing, the Gentoo tooling generates the final file for you.

Also, the modutils are quite forgiving when you make a mistake, if I remember correctly.

2 Likes