My computer is a Sony Vaio Notebook. I used Ubuntu and Win 8 with dualboot but windows somehow managed to remove the menu to choose the OS at startup. I think the BIOS is UEFI. Secure boot was disabled already and Boot Repair somehow fails.

How can I fix this?

up vote 14 down vote accepted

Sony, HP, and many laptop vendors are hard-coded to only boot Windows.

There are several work-a-rounds that suggest you move the grub grubx64.efi or shimx64.efi file on top of the Windows /EFI/windows/bootmgfw.efi. However this isn't recommended because Windows Update will restore bootmgfw.efi and you'll be back to only Booting windows.

Instead, I suggest renaming the fallback /EFI/Boot/bootx64.efi and boot hard drive entry or use rEFInd.

Make sure you backup the entire EFI partition before making changes.

You have several options available:

I. Move and rename the grub files grubx64.efi or shim64.efi (for secure boot) to this folder/file /EFI/BOOT/BOOTX64.EFI

  1. Rename /efi/boot/bootx64.efi, copy shim or grub into /efi/boot and name it bootx64.efi Then boot hard drive entry. New versions of Boot-Repair automatically do this with 'Use the standard EFI file' in advanced options. It also backs up current bootx64.efi which is probably just a copy of Windows .efi boot file.

    From live installer mount the efi partition on hard drive: Mount efi partition. check which partition is FAT32 with boot flag. Often sda1 or sda2 but varies.

    sudo mount /dev/sda1 /mnt
    

    only if not already existing,

    sudo mkdir /mnt/EFI/Boot
    sudo cp /mnt/EFI/ubuntu/* /mnt/EFI/Boot
    

    If new folder created, the bootx64.efi will not exist, skip this command

    sudo mv /mnt/EFI/Boot/bootx64.efi /mnt/EFI/Boot/bootx64.efi.backup
    

    Make grub be hard drive boot entry in UEFI. If not existing, may have to update UEFI also with efibootmgr.

    sudo mv /mnt/EFI/Boot/grubx64.efi /mnt/EFI/Boot/bootx64.efi 
    

If need be, add a new UEFI hard drive boot entry: See also

man efibootmgr

If ESP is sda or default drive & partition entries:

sudo efibootmgr -c -L "UEFI Hard drive" -l "\EFI\Boot\bootx64.efi"

If ESP is not sda1, sdX is drive, Y is efi partition, also NVMe drives :

sudo efibootmgr -c -g  -w -L "UEFI hard drive" -l '\EFI\Boot\bootx64.efi' -d /dev/sdX -p Y
sudo efibootmgr -c -L "UEFI hard drive" -l "\EFI\Boot\bootx64.efi" -d /dev/nvme0n1 -p 2 
  1. (This is the same as what Boot-Repair used to do in II. Not now recommended: Rename /efi/Microsoft/Boot/bootmgfw.efi and copy grub or shim into /efi/Microsoft/Boot and name it bootmgfw.efi Then boot Windows entry to boot to grub menu. You have to manually add a grub menu entry to boot renamed Windows efi file. Grub2's os-prober entry boots bootmgfw.efi entry which is now just grub, so it will not work.

    Users who manually moved efi files around see post #6.

    http://ubuntuforums.org/showthread.php?t=2101840
    http://ubuntuforums.org/showthread.php?t=2219452
    http://ubuntuforums.org/showthread.php?t=2221498&p=13012109#post13012109

II. If you ran Boot-Repair's fix for "buggy UEFI" with an older copy it's best to undo it. And then make the change above to use bootx64.efi To undo and to rename files to their original names, you just need to tick the "Restore EFI backups" option of Boot-Repair.

Any rename either manually or with Boot-Repair will need to be redone after a Windows update as it will restore Windows files.

III. Edit Windows BCD, one alternative to Boot-Repair's rename to make shim have Windows name. Some systems work better to register grub/shim from inside Windows - for those that keep resetting Windows as default.

Grub not showing on startup for Windows 8.1 Ubuntu 13.10 Dual boot

bcdedit /set {bootmgr} path \EFI\ubuntu\grubx64.efi

https://coderwall.com/p/vfyqkg

IV. If Description has to be Windows, then change UEFI description. This really only works for those with just Ubuntu, and no Windows install at all.

sudo efibootmgr -c -L "Windows Boot Manager" -l "\EFI\ubuntu\shimx64.efi"

Restore or a new Windows UEFI entry - assumes default sda1 add -p 2 if sda2 (see man efibootmgr -d drive & -p partition options):

sudo efibootmgr -c -L "Windows Boot Manager" -l "\EFI\Microsoft\Boot\bootmgfw.efi"
sudo efibootmgr -c -L "Windows Boot Manager" -l "\EFI\Microsoft\Boot\bootmgfw.efi" -d /dev/nvme0n1 -p 1 

V. Some install rEFInd which seems to be another workaround and has nice boot icons.

http://www.rodsbooks.com/refind/index.html

http://www.rodsbooks.com/refind/secureboot.html

PPA available to make it easy to install in Ubuntu

http://www.rodsbooks.com/refind/getting.html

  • Yes! Renaming worked for me! I mounted the efi partition and copied the files ../EFI/ubuntu/grubx64.efi to ../EFI/Boot/ and to /EFI/Microsoft/Boot and changed the name of the file as follows. In the ../EFI/Boot directory I overwrote the bootx64.efi with the file and in the ../EFI/Microsoft/Boot i overwrote the bootmgfw.efi with the file . That was all I think. Thank you very much! – user296880 Jun 23 '14 at 20:28
  • For those stuck on Windows: I managed to do the rename approach describe in option a1 without leaving Windows. I opened a command window as administrator, then ran mountvol S: /S to mount the EFI partition as S:. I had odd issues with going up and down folders, but moving a copy of grubx64.efi a folder at a time into /EFI/Boot, then renaming it to bootx64.efi worked. – Peter Becker Sep 17 '15 at 10:59

I have an Acer that has the same problem. My solution is to "reboot" windows, rather than shutdown (which is really just a hybernate.)

By rebooting (Which may trigger updates,) the system shuts down and you can select boot from the bios. You do have to catch it before it reboots.

I rarely use windows so booting this way doesn't bother me at all. Unless, of course, windows updates.

This worked for me. I used a Toshiba laptop with UEFI.

  1. Install Ubuntu in UEFI mode. Make sure to designate a /boot, /, and swap space on the hard drive.

  2. Go into Windows 10. Open an admin command prompt and follow step 3.

  3. Reboot. The boot menu should appear now.

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.