I know this problem has been raised several times, but I have spent nearly four days, but I couldn't solve my problem. I just bought a Sony laptop that came preinstalled with Windows 8 with these specs: i5 CPU/4GB RAM/500GB HDD/1GB Nvidia GeForce 740M graphics.
I installed Ubuntu successfully in UEFI mode and secure boot disabled alongside Windows, but I didn't get any Grub bootloader. The problem was not solved even by boot-repair.
Then I tried Kubuntu, but this one wasn't even booting from the flash drive in UEFI mode and I was was compelled to change the mode to legacy which subsequently helped, but the same Grub problem persists. The mode has to be changed to legacy from boot setup each time I require to boot Kubuntu/Ubuntu and back to UEFI to boot Windows.