1) Boot Ubuntu Live DVD/USB in testing mode and open terminal
2) Run installation process without installing bootloader by:
sudo ubiquity -b
3) Press Continue testing after installation is over.
4) Mount newly installed file system into /mnt:
sudo mount /dev/sda2 /mnt
sudo mkdir /mnt/boot/efi
sudo mount /dev/sda1 /mnt/boot/efi
for i in /dev /dev/pts /proc /sys; do sudo mount -B $i /mnt$i; done
(where sda2 is the root partition and sda1 is the efi partition)
5) Load efivars by:
sudo modprobe efivars
6) Reinstall grub-install for a 64bit version
sudo apt-get install --reinstall grub-efi-amd64
sudo grub-install --no-nvram --root-directory=/mnt
7) Change root to /mnt and update grub
sudo chroot /mnt
sudo update-grub
8) Move and rename the installed bootloader
cd /boot/efi/EFI
sudo cp -R ubuntu BOOT
cd BOOT
sudo cp grubx64.efi bootx64.efi
9) Reboot the system.
At this point grub is alone and should boot only linux without problem.
2.2 Install windows
Insert windows 10 usb , reboot , and install Windows 10 , at the partition you created before.
This goes with no problem .
After that turn off fast startup in windows , or do it with regedit :
Change:
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Power
HiberbootEnabled DWORD
0 = Turn off fast startup
1 = Turn on fast startup
Now on win 10 login screen at the bottom right corner where you can shutdown , you will have 3 options instead of only 2 shutdown, restart that were shown before . Shutdown, Restart and sleep (as you understand before this shutdown meant sleep (!)) . Windows 10 boots fast because it tries to never shut down, and hibernate when you choose to shutdown . Another nice innovation from our friends at Microsoft.
Also I have to inform you that Windows 10 now features more and more explanatory messages like : "Windows is getting ready" when it performs the windows update we all love.
After win 10 installation, windows boot manager takes over and you can boot linux only by pressing F12 during boot which brings up the laptop boot menu. If you reinstall grub or reinstall linux , grub will not take over. After win 10 installation "Wndows Boot Manager" appears as an option in boot order in bios. If you set it second after the hard disk, it will not solve the problem. ES1-533 sees linux if you press F12 boot menu key during boot , but I could not see it inside bios boot order. In linux you normally change the efi boot order with the efibootmgr -o command, but this command totally crashes and freezes the pc. I am very sure that this command is responsible for freezing the laptop during ubuntu installation , so I reported a bug .
So the only way to bring grub first was to use bcdedit from Windows 10 . Let's fool Windows:
From powershell opened as admin , run :
bcdedit /set '{bootmgr}' path \EFI\BOOT\
You may can't change the order of boot managers with bcdedit but you can change the .efi file path of windows boot manager so that it will point to the one we created while setting up linux in step 1.
Reboot .
After this grub should come first , but it will not have windows boot option.
Start linux and do a
sudo update-grub
and it should see it.
Ensure the Hard Disk is before Windows boot manager in boot order in Bios .
If you press F12 during boot you should see 2 windows boot manager entries and one linux .
3. Linux is not shutting down
The newest fashion in linux is that pc's are not shutting down.
You press shutdown button in your desktop , pc reaches a state where it prints "Reached target shutdown" or "Reboot: power down" and it stucks there without powering off.
Saw that bug on 16.04 installation on an old Dell laptop with core duo, and the problem was resolved by... installing the wireless drivers..
I also saw that this bug has been posted as systemd bug and I came to a point where I believed I could not find a solution , at least for the time being as this pc is very new.
I tried to update the bios from windows and i did updating it to 0.8 from 0.4.
Procedure is very easy and I suggest you do it.
You go into acer website put the snid of your laptop and you download the bios update and run it from windows 10.
Then read an archlinux forum where someone suggested to take a look at kernel messages with dmesg.
Run dmesg and if you see a message:
Using host bridge windows from ACPI; if necessary, use "pci=nocrs" and report a bug
edit /etc/default/grub
GRUB_CMDLINE_LINUX_DEFAULT="pci=nocrs"
and
sudo update-grub
This solved the problem
Now the pc is expected to shut down from linux instead of stucking in Reboot: Power off.
Last one is a world first from kaotonik.net and linux master thk.
VIVA LINUX - resist to microsoft and UEFI !!
p.s. if windows overwrites the boot manager after the update
boot a usb mount /dev/sda1 partition as shown above and simply do in the mounted EFI parttion
sudo cp EFI/ubuntu/grubx64.efi EFI/boot/bootx64.efi
as stated here
https://unix.stackexchange.com/questions/565615/efi-boot-bootx64-efi-vs-efi-ubuntu-grubx64-efi-vs-boot-grub-x86-64-efi-grub-efi