This is a tutorial on how to dual boot Windows + Linux + *any* EFI capable os on the 2012 Sony VAIO line (and possible any other similarly restricted laptops).
this tutorial is needed because on the Sony VAIO S and probably many other laptops the UEFI Firmware is hard-coded to look for windows bootloaders and ignore all others.
this will NOT disable secure-boot on laptops on which it is enabled
This tutorial is based on FEDORA with grub2 and has not been tested on any other distributions or bootloader !!
( I will update when I get the chance to play with Ubuntu )
As per usual I am not responsible for any damage done to your laptop or any loss of personal information.
REQUIERS
Step 1: make a grub usb stick
- a usb stick with at least 100mb (I know that's virtually nothing now a days)
- windows must already be running on UEFI
- a somewhat descent knowledge of linux
- comfortable using the terminal
Step 2: backup windows boot loaders
Format the usb stick to fat 32
Copy the contents of ftp://mirror.csclub.uwaterloo.ca/fedora/linux/releases/test/18-Alpha/Fedora/x86_64/os/EFI or any other fedora mirror
to /EFI on your usb stick by running this on the root of your usb stick
** we MUST use fedora 18 because the bootloader shipped with <17 is grub legacy and it will complicate the process **
/test/18-Alpha/ will eventually change to /test/18-Beta/ then just /18/Code:wget -r -nH --cut-dirs=8 ftp://mirror.csclub.uwaterloo.ca/fedora/linux/releases/test/18-Alpha/Fedora/x86_64/os/EFI/
Now uninstall all grub related components
If you are asked to uninstall grubby DO NOT DO IT, it is required by the kernel and will remove the kernel if you try to do so.
Now re-install grub2-toolsCode:sudo yum remove grub{,2}{.*,-*}
Update the conf file on the usb stickCode:sudo yum install grub2-tools
At this point you should be able to reboot and use grub off the usb stick to boot into linux, if this dosn't work ask for help here.Code:sudo grub2-mkconfig -o /YOUR_USB_MOUNT_POINT/EFI/BOOT/grub.cfg
Step 3: Install Grub
Go to /boot/efi/EFI
Clear the efi nvram with
Rename the Microsoft folder to Microsoft .bak
and the boot folder to bak_boot (if the folder name starts with boot it is likely to cause problems)
Now reboot with the usb stick unplugged, you should see "No Operating System Found"Code:sudo efibootmgr -O
if windows starts you did not rename everything you needed to and you need to do this step again
Step 4: Re-add Windows
Plug in the usb stick and use it to boot into Linux
Delete any old grub config files
Install grub2-efiCode:sudo rm -rf /boot/grub*
Rename /boot/efi/EFI/fedora to /boot/efi/EFI/bootCode:sudo yum install grub2-efi
Since this isn't grub's default location we can tell the os where it is byCode:sudo mv /boot/efi/EFI/fedora /boot/efi/EFI/boot
Update the cfg fileCode:sudo ln -s /boot/efi/EFI/boot/grub.cfg /etc/grub2-efi.cfg
At this point you should be able to boot into linux from grub without the usb stick.Code:sudo grub2-mkconfig -o /boot/efi/EFI/boot/grub.cfg
Step 5: Test
In /boot/efi/EFI
Chainload windows from grub
rename Microsoft.bak/ back to Microsoft/
rename Microsoft/Boot/bootmfg.efi to Microsoft/Boot/bootmrg.efi.bak
now move ./Microsoft/Boot/bootmrgfw.efi to ./Win7.efi
Code:sudo mv /boot/efi/EFI/Microsoft/Boot/bootmgrfw.efi /boot/efi/EFI/Win7.efi
add a menu entry consisting of
where YOUR_OUTPUT_HERE is the output of running the commandCode:menuentry "Microsoft Windows 7" { insmod part_gpt insmod fat insmod search_fs_uuid insmod chain search --fs-uuid --no-floppy --set=root YOUR_OUTPUT_HERE chainloader /efi/Win7.efi }
which sould be something likeCode:echo `grub2-probe --target=hints_string /boot/efi/EFI/Win7.efi` `grub2-probe --target=fs_uuid /boot/efi/EFI/Win7.efi`
Update the cfg file againCode:--hint-bios=hd0,gpt1 --hint-efi=hd0,gpt1 --hint-baremetal=ahci0,gpt1 EAE5-4F3B
Code:sudo grub2-mkconfig -o /boot/efi/EFI/boot/grub.cfg
Reboot your computer to ensure everything worked
If it did jump with joy and thank me
Setp 6: Troubleshoot
If it didn't work try to find what you did wrong (READ every single line of the post and comments),
then use google,
if all else fails boot with the usb stick and post the output of
Code:sudo find /boot/efi/Code:sudo grub2-mkconfigCode:echo `grub2-probe --target=hints_string /boot/efi/EFI/Win7.efi` `grub2-probe --target=fs_uuid /boot/efi/EFI/Win7.efi`
-
Thanks !
It worked well for me on my VAIO SVS 1311C5E.
I had to copy the BOOTX64.efi file from the EFI/BOOT of the usb stick to /boot/efi/EFI/Boot to make it work before step 5.
I'm also still wondering why grub gets stuck on the windows 7 choice when you don't remove the /boot/grub2 folder...
[tutorial] VAIO EFI dual+ boot tutorial
Discussion in 'VAIO / Sony' started by gabcas, Oct 18, 2012.