Issue
So I am making this multiboot pendrive from scratch using the arch wiki and i wanted to test it in qemu. The grub I installed is in efi 64 bits so naturally I ran
qemu-system-x86_64 -m 512 -enable-kvm -usb -device usb-host,hostbus=1,hostaddr=7
but the bootloader shows the error: /grub/i386-pc/normal.mod not found
and of course it is. Because i386-pc is for the 32bit install!!! These files are in the /boot/grub/x86_64-efi folder!!! I tried all the googling possible but I my case is not represented in any result. I downloaded symlinks to see if qemu-system-x86_64
was actually another binary in disguise but it isn't. Can anyone help?
Solution
use for UBUNTU:
$ sudo qemu-system-x86_64 -m MEMORY_IN_BYTES -enable-kvm -cpu host -hda /dev/sdX
-drive if=pflash,format=raw,readonly,file=/usr/share/OVMF/OVMF_CODE.fd
-drive if=pflash,format=raw,file=/.../my_uefi_vars.fd
See for other OSs and how to make the file copy to my_uefi_vars.fd: https://wiki.archlinux.org/title/Unified_Extensible_Firmware_Interface#OVMF_for_virtual_machines
To fix boot order if you get something like "UEFI QEMU DVD-ROM QM00003 Not Found": https://pve.proxmox.com/wiki/OVMF/UEFI_Boot_Entries
Credits to plushkatze and r3dk0w from reddit.
EDIT: Additional explanation. This has to do with the firmware for the efi which had to be loaded in the -drive
s of the command above from the files in case you run it from qemu. For virtual box for example you will also have to switch to efi firmware with a command to alter the vdmk file to boot with it.
Answered By - Zeor137