The TL;DR, added in the edit:
The question is:
How can I make the BIOS prefer GRUB over Windows Boot Manager on the same UEFI boot partition?
The problem is not with Grub; Grub does the right thing when the BIOS starts it. The problem is not with "the disk isn't bootable," because both the Windows UEFI bootstrap and the Grub UEFI bootstrap are bootable. The problem is which UEFI bootstrap the BIOS chooses to boot from.
I'm setting up a new computer, and want it to by default boot into Ubuntu, but have the option to select Windows on boot. This is especially important if power goes out and comes back; I won't even be in the house.
I started out by installing Ubuntu 17.04 on my internal NVMe disk, partitioned with GPT to use half the disk, and a separate UEFI boot partition. GRUB boots that just fine, and I see the GRUB boot menu on start-up where I can select whatever items GRUB knows about.
Then I installed Windows 10 Pro from a recently downloaded ISO. It installed Windows Boot Manager onto the same UEFI partition, and left the Ubuntu intact (great!) and that boots fine into Windows 10.
However, it did "something" that makes the UEFI firmware immediately select the Windows Boot Manager rather than GRUB on power-up. The only way to boot Linux now is to use the BIOS boot manager (F11 on my BIOS) and select the GRUB boot loader manually. The UEFI BIOS knows that there are multiple bootable installs on the UEFI partition, because I can choose between them in the boot manager. However, when I'm in the setup menu in the UEFI BIOS, it just lets me choose "UEFI boot my internal drive" in the boot priority selection -- it doesn't let me choose which particular boot loader on that partition to use. And, by default, it chooses Windows, not GRUB.
The internets (and this site) suggests that the old way to fix this is to run
update-grub (so GRUB recognizes Windows) and then
grub-install (to put GRUB back on the device.) I have done this, but unfortunately, it still has the behavior as described above, where the BIOS by default chooses Windows Boot Manager. (
update-grub does find the Windows Boot Manager install, and adds that to the menu, and that menu item works when I manually choose the GRUB partition in the UEFI boot manager.)
What can I do to make GRUB the "default" boot on my UEFI boot partition?
Using a MSI X399 Carbon motherboard.
Second edit: Because the correct answer ends up being mentioned in a comment to a response, I'll repeat it here:
"BCDEDIT" in an admin shell on Windows is the working solution. The others don't work.