Dual Boot with Windows

Useful Facts

  • Ubuntu full disk encryption (FDE) is not possible with dual-boot

  • Legacy/MBR allows only 4 primary partitions

  • GPT (GUID Partition Table) allows 128 primary partitions

  • Ubuntu install partitions (for / and swap area) can be either primary or logical

  • Never defragment an SSD

  • Don't install Ubuntu using a computer that already has Ubuntu, especially if it has a dual-boot. It seems to corrupt the bootloader of the existing install

Prepare the Install Disk

  • Get a USB drive at least 8GB

  • Install the desired Ubuntu image using either balenaEtcher or Rufus

Prepare the Computer

  • The drive must be NTFS. FAT32 drives can't be shrunk.

  • Backup the entire drive (Windows) if desired

  • Shrink the existing drive to make room for the Ubuntu partition

Install Ubuntu

UEFI Method

This method is preferred. It is also required if the Windows system is already set up for UEFI boot.

  • Follow this guide:

    • This guide is for Legacy/MBR installs, but 99% of it is the same, and it's a great simple guide

    • Make all new partitions logical. They can be primary, but logical works fine and it avoids potential issues with having too many primary partitions.

  • For UEFI installs, don't create the /boot partition. Instead, make sure there is an existing "efi" partition from Windows, and if the Ubuntu installer gives you a dropdown to select the location of the boot loader, select the partition with "Windows Boot Manager" (the "efi" partition).

    • There is a partition/directory on each physical bootable disk that contains one or more boot loaders. When you install Ubuntu, the Ubuntu bootloader (Grub) gets added to this partition at \EFI\ubuntu\

    • The Ubuntu bootloaders are:

      • \EFI\ubuntu\shimx64.efi - Windows signed (preferred)

      • \EFI\ubuntu\grubx64.efi - Not signed by Windows

    • If there is NOT an existing "efi" partition, create one.

    • If there is already an "efi" partition, do NOT make another one.

This is what the "Something else" (manual installation) screen should look like in the Ubuntu installer when everything is configured properly.

After clicking "Install Now," review the changes and confirm that only the intended partitions will be formatted.

Other References

Legacy/MBR Method

Troubleshooting

If you can't boot into Ubuntu after installing on a separate partition, try the following:

  • Windows: Disable hibernate

  • BIOS: Disable fast/quick boot

  • Turn OFF Fast Startup

    • Windows 10 -> System Settings -> Power & Sleep -> Additional power settings -> Choose what the power buttons do -> turn OFF "Turn on fast startup (recommended)"

  • Set the boot manager to Ubuntu (grub) in Windows

# Run as administrator in Command Prompt, not Powershell.

# List current Windows boot configuration.
bcdedit /enum

# Change Windows Boot Manager to Ubuntu (Grub).
# Preferred, Windows signed
bcdedit /set {bootmgr} path \EFI\ubuntu\shimx64.efi
# or
# Not signed by Windows
bcdedit /set {bootmgr} path \EFI\ubuntu\grubx64.efi

# Delete current Windows Boot Manager entry.
# This has not worked for me, but also does not seem to be necessary.
bcdedit /deletevalue {bootmgr} path \EFI\ubuntu\shimx64.efi
# or
bcdedit /deletevalue {bootmgr} path \EFI\ubuntu\grubx64.efi

# Change Windows Boot Manager back to Windows.
bcdedit /set {bootmgr} path \EFI\Microsoft\Boot\bootmgfw.efi

If the above works, you will see this success message:

Run bcdedit /enum and confirm that Windows Boot Manager is now using shimx64.efi or grubx64.efi.

  • Reinstall Ubuntu: Make the install partition Logical

  • Reinstall Ubuntu: Make the install partition Primary

  • If you get this error, your bootloader file is not located where it should be on the disk, or it has a different name than what the system is expecting.

    • This happened when I tried booting off my live install USB drive, so somehow the drive got messed up. I fixed this buy just re-flashing the Ubuntu install disk. I could have also fixed it by manually changing the bootloader files on the disk.

How to Change Grub Boot Order

Change what boots by default when you turn on the computer.

Removing Ubuntu

Last updated