How to install Ubuntu Linux 16.04 LTS on an HP Z240 workstation

I tried to install Ubuntu Linux 16.04 LTS on a Z240 HP workstation alongside Windows 10, which was preinstalled. The installation process went smoothly, but when I rebooted Grub didn’t show up and Windows booted automatically.

Eventually I discovered that to make the Ubuntu installation install Grub correctly on the Z240 workstation, one must disable legacy boot from the UEFI bios.

If the installation has already been done, one can fix Grub by using Boot repair, as shown here