I usually run Ubuntu and Windows on the same computer, in order to be able to select which OS I want to boot, I use GRUB. Here we're going to learn how to add Windows 10 to the GRUB OS list.
Using your Ubuntu OS you need to know which partition is the Windows EFI located, mine is at /dev/sda2
.
Once you know it, you should run the following command adapting it to your partition.
sudo blkid /dev/sda2
This command will allow you to know the UUID of your Windows EFI partition.
Next, we need to edit the /etc/grub.d/40_custom
file in order to add the Windows 10 entry.
sudo vi /etc/grub.d/40_custom
Here is the entry you should add, change WINDOWS_EFI_PARTITION_UUID
with the value you obtained previously.
menuentry "Windows 10" --class windows --class os {
insmod ntfs
search --no-floppy --set=root --fs-uuid WINDOWS_EFI_PARTITION_UUID
ntldr /bootmgr
}
Sometimes the GRUB menu is hidden by default on boot, you should enable it changing the GRUB configuration.
sudo vi /etc/default/grub
You should set the timeout seconds, and comment out the default style.
GRUB_TIMEOUT=5
#GRUB_TIMEOUT_STYLE=hidden
Once you've made all the changes, you should apply them by running the following command.
sudo update-grub