Installing multiple linux distros alongside Windows with GRUB and UEFI

12,135

As a general rule and IMHO, installing multiple Linux distributions to multi-boot on a single computer is more trouble than it's worth. For the most part, one distribution will do what the others will do. If you want experience with multiple desktop environments, you can install as many as you like within Ubuntu and switch between them by logging out and logging in again, selecting the appropriate desktop environment at login. You can even set it up so you can be logged in to multiple desktop environments simultaneously on different virtual terminals (VTs).

If you want experience with different package managers or other features that really are distribution-specific, chances are installing extra distributions using a virtualized environment, such as VirtualBox or VMware, will be easier and safer than dual-booting. This also has the advantage that you can run both distributions simultaneously.

That said, if you really need to multi-boot, IMHO GRUB is not the best choice. Its Achilles heel is that it requires configuration within the OS from which it was installed. (At least, that's true of the stock configurations delivered by Ubuntu and most other distributions. It is possible to create a GRUB configuration that's better divorced from any one distribution, but that requires advanced knowledge, and it's still necessary to configure it from within an OS.) That is, if you use Ubuntu's GRUB to control the boot process but you also install, say, Fedora, then when you update Fedora's kernel, Ubuntu's GRUB won't know about that fact until you reboot into Ubuntu and type sudo update-grub (or until you update Ubuntu's kernel). Alternatively, Ubuntu's GRUB might chainload to Fedora's GRUB, in which case Fedora's GRUB will know about the updated Fedora kernel, but that complicates the process for booting to Fedora. Worse, each OS is likely to try to control the boot process, resulting in repeated boot coups, in which OS A sets its boot loader as the default, even though you want OS B's GRUB to do the job. (This isn't a GRUB-specific issue, though; it's likely to occur whenever you multi-boot.) The more OSes you try to multi-boot, the more frequently you'll run into boot coups.

For complex setups, many people prefer to use my own rEFInd boot manager. Unlike GRUB, rEFInd scans the disk for boot loaders and kernels whenever the computer starts, so it will detect new kernels no matter what distribution installed the kernel or rEFInd. There are caveats to this, though, and you may need to tweak things a bit for each distribution to get it to work. In particular, you may need a /boot/refind_linux.conf file for each distribution so that rEFInd can pass appropriate boot options to each OS. This is covered on this page of the rEFInd documentation.

Another approach, albeit largely a theoretical one right now, is to use the Freedesktop.org Boot Loader Specification. The idea is that distributions should put their kernels in standardized locations and cooperate on a configuration file format so that boot loaders for one distribution can load kernels for another distribution. This proposal has merit, but AFAIK few distributions are adopting it, so as a practical matter this isn't something you can rely on today.

Share:
12,135

Related videos on Youtube

the_eraser
Author by

the_eraser

I think way too much

Updated on September 18, 2022

Comments

  • the_eraser
    the_eraser over 1 year

    I've read some posts and manual pages but I still have doubts. My gParted screenshot is the following.

    enter image description here

    During the installation process of Ubuntu 16.10 I installed GRUB in /dev/sda1 ("Windows Boot Manager" was written near /dev/sda1) (I've had disabled "Secure Boot" before).

    The GRUB menu is the following.

    enter image description here

    Everything has worked fine until now, but now I'm planning to install multiple linux distros, UbuntuStudio and an Arch distro for sure (Antergos I think). I'm also thinking to leave additional room into the SSD to try distros when I feel like it. I want to be sure beforehand on the following.

    Whenever I install a new distro, do I need to install a bootloader? If so, is it correct to install everything in /dev/sda1 ("Windows Boot Manager") as done before?

    In the past I tried to triple-boot my old notebook (BIOS) with Windows XP, Ubuntu and UbuntuStudio and whenever I updated the kernels, I wasn't able to boot anymore. If I remember well, they suggested to have a single GRUB on a separate partition and refer to that from the linux distros. What is the best way to have multiple linux distros now with UEFI? In what is different from the past (BIOS) (just for curiosity)?

    Please keep it simple, I am very happy to learn how the boot process work and how can I have multiple linux distros booting and updating flawlessly, but many answers I've read tend to be puzzling.

    Thanks in advance, Luca

    • Caturday Saint
      Caturday Saint over 7 years
      Are you just interested in trying out other Linux distros? If so, you could use Virtual Box to test them out, which would prevent partitioning head aches from multi-booting.
    • the_eraser
      the_eraser over 7 years
      Probably creating a Virtual Environment is the best solution for trying out distros, so I will avoid to have the fifth OS installed. Anyway I'm interested to at least triple boot or quadruple boot (windows 10 included).
    • oldfred
      oldfred over 7 years
      Before you install anything, be sure to back up your ESP - efi system partition sda1. I have multiple Ubuntu installs, and each new install overwrites my default boot and main working install's entry. Relatively easy to reset once you know but otherwise difficult.
  • the_eraser
    the_eraser over 7 years
    Thank you. Very clear. My primary intent, although not mentioned before, was/is to have a rolling release distro (e.g. Antergos) and a version release distro (e.g. Ubuntu) on the same machine, to have advantages from both worlds. A creator of a bootloader dissuading me from (>2)-booting is a big deterrent...I'll try with rEFInd or a chainload of GRUBs trying to avoid bootcoups when I feel like...easiest way probably is to clone Windows10 somewhere else so to dual-boot two linuxes.
  • andreas
    andreas over 3 years
    Rod, as some years went by since this post. Is your rEFInd boot manager still the preferred way to set up linux multiboot? In my case I want to set up some distros on one SSD to try them as host os to boot some VMs with GPU passthrough. Namely Proxmox, Fedora & Arch as hosts and Windows 10, Ubuntu (and maybe others later) as Clients...