I have installed Ubuntu 15.04 with Windows 8 on my Vaio. When I shut down from Windows and start the laptop, I get the GRUB menu and can select between booting with Windows and Ubuntu. However, after I shut down from Ubuntu and start, directly Windows opens.
How can I fix this?
Here’s how I installed Ubuntu:
- I used a 64-bit iso.
- I disabled Fast Startup and hibernation in Windows.
- I left SecureBoot enabled while installing Ubuntu in UEFI mode. I
set Secure Boot Mode to ‘Custom’ in the BIOS Settings. - I created free space for Ubuntu from within Windows.
- While installing from a LiveUSB, I manually created partitions for
/, /home and swap. I did not create a /boot partition. - I selected the ‘Device for bootloader information’ as the only hard
disk on my laptop. I did not select a specific partition. Also, I
did not create an EFI System partition as described in Ubuntu UEFI
Guide because it recommends having only one ESP per disk.
Dual Boot did not work. Then, I disabled SecureBoot and ran the following command on Windows:
bcdedit /set {bootmgr} path \EFI\ubuntu\grubx64.efi
And the GRUB menu started showing every time after I had shut down from windows. But whenever I shut down from Ubuntu and start, it directly boots Windows.
I did consult the following threads and pages:
How to fix dual-booting Windows 8 and Ubuntu 14.04 on a Sony Vaio?,
Installing Ubuntu Alongside a Pre-Installed Windows with UEFI
Here are some of the possible solutions I found and need advice on which of them to try:
-
Reinstall Ubuntu and this time create a /boot partition. Then run Boot Repair.
-
manually copy the ubuntu Boot directory in place of the \EFI\Boot Directory, and rename shimx64.efi to \EFI\Boot\bootx64.efi (not \EFI\Microsoft\Boot\bootmgfw.efi ), like in this guide: http://www.slideshare.net/Tinydile/vaio-pro13-win8ubuntu1310uefi.
(I’ve never used xTerm or rEFInd. So I do not understand what the commands in this guide are exactly for and whether this guide solves the problem.)
Can somebody please explain what is causing this problem and how I should fix it? I'm confused because dual-boot does work, just not straight after shutting down from Ubuntu.
Thank you in advance.
Best Answer
Sony VAIOs are pretty notorious for having flaky firmware. I recommend you first check Sony's site for an update and, if one is available, install it.
If that doesn't help, start investigating your firmware boot order options using
efibootmgr
in Ubuntu. You'll see something roughly like this:The details will differ, of course. Look at the
BootCurrent
andBootOrder
lines; the numbers refer to the variousBoot####
entries. In this example, theBootOrder
is set torEFInd (direct)
first, followed byubuntu
, and so on; and the system actually booted (BootCurrent
) via rEFInd. Note that the numbers are actually hexadecimal, although this example doesn't show any over-9 digits.Compare the output of this command when you reboot from Windows vs. when you reboot from Ubuntu. Does the
BootOrder
change depending on how you boot? Also, does rebooting from Windows automatically change theBootOrder
back (and fix the boot-time behavior)?If the
BootOrder
is changing, you might try setting it back to the way it should be in Ubuntu. Use the-o
option toefibootmgr
, as in:Change the numbers to match your
Boot####
options, of course. If this works on a one-time basis, you can create a shutdown script to do it automatically every time you shut down, as described here:Execute a script upon logout/reboot/shutdown in Ubuntu
If that doesn't help, then there are possible solutions that involve renaming and moving boot loader files. Boot Repair can do this semi-automatically via an option on its Advanced menu (I don't recall the exact name, though; it's something to do with backing up and renaming files). I'd use this option only as a last resort, though; it's an ugly hack that doesn't always work and that can create confusion down the road if/when you need to re-install an OS or otherwise manipulate the boot loaders.
I do not recommend re-installing Ubuntu as a solution. It didn't work the first time and it's unlikely to do any better the second time. The presence or absence of a
/boot
partition is almost certainly irrelevant to your problem.