I'm trying to make a usb drive with two linux distros installed inside. The idea is to carry the usb drive with me and boot the distros in the computer available at the place where I am at that moment. I know that this might be a bad practice, but just wanna give it a try.
I tried to install Kali Linux distro to my usb drive according to this video, in which a VirtualBox VM is used to install the O.S. into a usb drive.
When I first tried I didn't booted my VM in EFI mode and so the O.S. was installed in legacy mode (boot instructions written in the MBR). All was OK as long as I booted on my pc supporting legacy boot, but when I tried to boot from my Microsoft Surface (which doesn't support legacy boot), I obviously couldn't boot from the external drive.
So I tried to reinstall Kali with EFI mode activated on the VM, but I wasn't lucky this time either and didn't manage to boot the distro on my Surface. The situation was the same as when I tried to boot from my Surface having the distro installed in legacy mode: the Surface didn't recognize the bootable usb drive at all.
Googling I found a bunch of solutions to install/reinstall GRUB to an usb/external drive, but when I tried them, it seemed they were working only as long as I booted on the same device which I used to install GRUB on the usb drive. As an example, when I used the VirtualBox VM to install GRUB into my usb device, I was able to boot my Kali distro into the usb device ONLY from that VirtualBox VM.
I think I'm missing something here... Can someone give me an hand to clarify and, maybe, solve?
I attach screenshots describing the partitioning of my usb drive and the content of the ESP partition on the USB drive after the installation in EFI mode of Kali Linux, in case they can help:
--- UPDATE ---
I managed to boot my system on BOTH my PCs capable of EFI boot. I just moved the Kali boot loader located in my ESP from /EFI/Kali to the fallback path /EFI/BOOT and renamed the bootloader from "grubx64.efi" to the fallback name "bootx64.efi". I don't know why the boot process didn't manage to boot /EFI/Kali/grubx64.efi do someone has any clues?
Now I only got to make everything bootable in legacy mode (aka using BIOS), is it possible? It seems to be possible to boot a usb drive both UEFI and legacy mode, but is there a way I can set everything up without messing anything working in my actual EFI bootable configuration?