You should be able to set things up the way you want. Your machine is UEFI, so to boot an Ubuntu system of USB, you should set up the USB with its own EFI partition (300M, FAT32, flagged bootable), and specify that PARTITION to the installer (might or might not work, specifying the device has NEVER worked for me).
Anyway, check after the installation, and if the USB's EFI partition is empty, just copy it from the hard disk's EFI. Now, the USB default bootloader is not indicated by some nvram entry in the firmware, so NOTHING needs to be changed on the Windows side (other that selecting USB before hard disk, and maybe adding some boot delay to give yourself a chance to hit a function key). The USB bootloader is /EFI/Boot/bootx64.efi
. For a non-secure boot, that file should be a copy of the unsiged grubx64.efi. For secure boot, bootx64.efi should be a copy of the shimx64.efi
file, and the signed version of grubx64.efi
should be present in /EFI/Boot
too. The grub.cfg file should be in
/EFI/ubuntu`, and that should automatically boot when the USB is present.
Now, what you have may be a nvram entry in first place (after USB) in the bootorder pointing to the hard disk's /EFI/ubuntu/grubx64.efi
, trying to run a config file off the (non-present) USB. That entry is just wrong - delete it! efibootmgr
on the Ubuntu side will allow that, or maybe a Windows program can do the same thing. The first entry for the hard disk should be for Windows.
Now without the USB, Windows should just run. With the USB, the USB's /EFI/Boot/bootx64.efi
should run and boot grub.