After days of trying, I finally found a solution to realize the dual boot. I am using a VAIO 13A and trying to install the Ubuntu 16.04 alongside the pre-installed Windows 7.
If you have tried all the other solutions found in other posts but not yet succeeded, maybe you could try my solution. I have first tried the solutions provided in the following links:
Sony VAIO with Insyde H2O EFI bios will not boot into GRUB EFI
and
https://askubuntu.com/a/180857/537309
However, either the vaio would still boot the Windows directly, or it can only boot Ubuntu. In the latter case, if I select the "Windows 7" option (which I had added to the grub menu), it will go back to the grub menu again instead of booting the Windows 7.
Here is how I finally solved the problem. First, follow the steps described in (
https://askubuntu.com/a/180857/537309):
1.Make sure the machine is booting in UEFI mode not Legacy
2.Boot from Ubuntu US stick or CD
3.Make sure you selected the install the boot loader into Ubuntu partition
4.Install Ubuntu as usual.
5.Reboot but boot again from the stick
then type in the following commands in the terminal:
sudo mkdir -p /mnt/efi_partition
sudo mount -t vfat /dev/sda3 /mnt/efi_partition
cd /mnt/efi_partion/EFI/Microsoft/Boot
sudo cp bootmgfw.efi /mnt/efi_partition/EFI/Microsoft/bootmgfw.efi
sudo cp /mnt/efi_partition/EFI/ubuntu/grubx64.efi bootmgfw.efi
sudo reboot
Note that the forth line is different from the original solution. It would just copy the bootmgfw.efi file one level up to the Microsoft folder for later use.
Now your vaio should run the grub and allow you to select the operating system. Choose Ubuntu, open a terminal and type in:
sudo emacs /etc/grub.d/40_custom
A window would pop up. Add the following lines to the end of the file:
menuentry "Windows 7" {
set root='(hd0,gpt3)'
chainloader /EFI/Microsoft/bootmgfw.efi
}
Here we tell the grub to use the bootmgfw.efi file we have backed up in the previous step to boot the windows.
Save and close the file. In the terminal, type in:
sudo update-grub
sudo reboot
And now you should be able to boot either system from grub.