After chrooting, but before running
grub2-install, you should have checked if
/boot/grub/device.map exists or not. Normally,
grub2-install creates it if it does not already exist, and it tries to guess which Linux device corresponds to which BIOS/GRUB disk identifier. If this mapping is wrong, you'll get strange results.
Unless your system is very special, if you are telling BIOS to boot from the disk that is
/boot/grub/device.map should have this line in it:
If the device.map file did not exist when you ran
grub2-install, it would have had to guess the mapping between Linux device names and BIOS/GRUB disk identifiers. Sometimes
grub2-install can guess wrong. So if
/boot/grub/device.map does not exist, you should create it with the correct information before running
grub2-install to ensure successful repair.
/boot/grub/device.map file exists but has wrong information, you should fix it before running
Now you should again boot into rescue mode, chroot and then check the
/boot/grub/device.map file, then run
When you overwrite the first 446 bytes of the MBR, it includes the signature bytes that are used as disk UUID on MBR-partitioned disks. If the GRUB configuration is using the disk UUID to select the GRUB "root" partition, the UUID will now be different. Your distribution should have a command that can be used to easily rebuild the GRUB configuration file.
In Debian-style systems, it is probably
In RedHat-style systems (Fedora, CentOS etc.), it might be
grub2-mkconfig > /boot/grub/grub.cfg or similar.
The message: FATAL: INT18: BOOT FAILURE is not related to Grub at all, but a problem with VirtualBox.
Apparently VirtualBox checks the partition table to verify that a partition has been marked as active, and if there is no active partition, it reports an error instead of even trying to load & run the MBR code.
This check is unnecessary for GRUB, because if GRUB has been installed to the MBR, it will take control of the boot process regardless of which partition is marked as active.
Having the installation media image still inserted in the virtual CD-ROM drive might also do it, at least with older VirtualBox versions: