Friday, May 06, 2016

Dual Booting Windows 10 and Ubuntu 16.04

For a couple of years, secure boot was making it harder every time to install a Windows/Linux dual boot. I've just finished successfully setting up a dual boot on my Lenovo X1 Carbon and am happy to report that it requires more or less the same tedious steps as before.

Here are step-by-step instructions for setting up a dual boot, where Windows has already been installed.
  1. Shrink the size of your Windows partition. Create a partition for Linux, an optional swap partition for Linux, and an optional other partition if you want to share files between your two partitions. You don't need to format your Linux and swap partitions. You will want to format the optional shared partition as NTFS.
  2. Get an Ubuntu image onto a DVD or a USB drive.
  3. Turn off Fast Boot in Windows. If you don't do this, your system is going to boot straight into Windows every time.
  4. In your BIOS, disable Secure Boot, enable UEFI, and disable Legacy Boot. You can mess with your BIOS settings by restarting and then intercepting startup by pressing "enter."
  5. Boot from your image. You can do this by restarting and intercepting startup to boot from a device. When choosing the installation option, make sure to choose "something else" instead of the ones that erase all your files.
  6. Follow the instructions and install Linux onto the partition(s) you've set aside for it. You will need to select the intended Linux partition and format it as ext[something] (I did ext3) and set the mount point as the top directory. You'll also need to designate the swap partition as such. You'll also have to explicitly specify your boot partition. Since you already have Windows installed, this will be the first partition formatted fat32. (This was different than before. I don't recall ever having to explicitly reformat my Linux partition or choose my boot partition.)
  7. From Linux, run Boot-Repair to reinstall your GRUB. Otherwise you'll boot straight into Windows every time. (If you accidentally booted back into Windows, you can repair your GRUB by running Linux live off your boot device.)
  8. If you want to share files between Windows and Linux, you'll also need to configure your shared partition so you can use it in Linux. (Instructions here. I had to restart before Dropbox let me put my directory there.)

P.S. Does anyone know when I'd ever want to use Legacy Boot? According to everything I've read it doesn't seem like I ever need it for anything. Why is it there?


Andreas said...

I don't bother with Secure Boot for Linux and just use UEFI for Windows and Legacy for Linux. My OS switcher is the UEFI/Legacy selection prompt. Never had a problem. For me the question is "why Secure Boot?". It seems to be mostly something designed by Microsoft to make it harder to install Linux, and screw that.

houseofs said...

I don't remember the exact steps I followed to install Fedora on my X1 Carbon last year (is yours particularly new?) but I didn't have to resort to any shenanigans. Resizing the partition and letting the Fedora partition tool figure out the specifics seemed to work OK for me out of the box (I don't even remember having to disable secureboot). I did not add a shared partition, however.