Ubuntu – Installing 32-bit Ubuntu side-by-side with 64-bit Ubuntu on UEFI system

bootdual-bootgrub2partitioninguefi

I got my hands on one of those notebooks with 64-bit Intel processors and Windows 8 64-bit installed by default.

First, I wanted to install 32-bit Ubuntu 14.04 on this machine.

I eventually learned that I should turn off SecureBoot from BIOS, as well as FastBoot (Is disabing Secure Boot needed for Ubuntu 14.04 dual-boot with Windows 8 UEFI); then I tried to boot the USB thumbdrive with UEFI (which I cannot remember if it worked); eventually the live USB 14.04 32-bit booted.

I first tried keeping the Windows restore partitions, and install only on the main partition, but after all of that failed, I wiped the disk and setup a new partition table – and I could get Ubuntu 32-bit to install. apparently successfully – but when trying to boot from the installation after that, I'd get:

Reboot and select proper Boot Device
or Insert Boot Media in selected Boot device

This is also noted in "Reboot and select proper boot device" error after clean Ubuntu 13.04 install – and after finding Clean Install of Ubuntu won't boot [reboot and select proper boot device], I noted this:

If your computer has EFI or UEFI firmware or has pre-installed Windows 8, you must choose Ubuntu 64-bit version. 32-bit version will not work.

And then I replaced the Ubuntu 32-bit installer on my USB thumbdrive with an Ubuntu 64-bit, and finally could both go through the installation successfully – and have this installed version boot from the main partition on the system.

So far, so good – but I think sometimes I may need a 32-bit system for debugging and such. So, since my knowledge of UEFI and the like is pretty poor, I would like to ask (before I waste hours on this, before finding it is impossible):

Provided I already have a working 64-bit UEFI installation on the main drive of this computer, does it get easier if I decide to: shrink the 64-bit partition to make space; then make a new partition for the 32-bit system; and finally, install Ubuntu 32-bit from a USB thumbdrive on this partition?

I have seen in https://help.ubuntu.com/community/UEFI, that:

Use a 64bit disk of Ubuntu. (Ubuntu32bit cannot be easily installed in UEFI mode. This is a problem if 32-bit UEFI is the only way your computer can boot, e.g. if you have a modern Intel Atom based laptop. In this case, you will need a complicated work-around.)

… however, I am not sure if these instructions apply only to first-time install of Ubuntu on a system (or possibly, for a side-by-side with Windows).

I'm sort of hoping that in my case, where I want a 64-bit and a 32-bit Ubuntu side by side (and no Windows), would be easier: my reasoning is that having had 64-bit already successfully installed, the install process would have already set up boot partitions, "bootable" labels etc appropriately – and then, when the 32-bit version is installed, it would detect Grub on the machine, and it would simply add itself as an entry, instead of trying to install the bootloader from scratch (even though the installer always asks explicitly what device should the bootloader be installed on, which makes me fear that the 32-bit install process may overwrite the correct bootloader of the 64-bit one, and thereby mess up things).

So – has anyone tried this before, and can one expect an easier (that is, a straightforward) install process in this case; or should one expect breakage of the working 64-bit install, if a 32-bit install is attempted side-by-side thereafter?

Best Answer

The Easy Way

The easy way to do what you want is to not boot the 32-bit Ubuntu directly; instead, install it in a virtual machine (in VirtualBox, QEMU, or VMware, for instance). Depending on your exact needs, this may be all you need, and it's a lot easier than trying to get everything properly multi-booting. OTOH, if you're developing, say, drivers for your computer's hardware, a virtual machine will probably not do what you want.

The Hard Way

Broadly speaking, I can think of three ways to do what you want (aside from the easy solution of using a virtual machine):

  • Go 100% BIOS/CSM/legacy -- You can wipe the computer and install all your OSes using the Compatibility Support Module (CSM), which enables BIOS-mode boot loaders to work. This will make it much like installing on a computer from several years ago. The trick is that it can be hard to control the boot mode of installation media, particularly if you're unfamiliar with the tools and techniques used to do so. See my Web page on the subject for more information; however, that page is written with an eye towards discouraging mixed-mode installation, so information on doing a 100% BIOS-mode setup is kind of buried amidst other things. Also, if you want to keep Windows, you'll need to jump through some exotic hoops or re-install it completely, and to do the latter you'll need to track down appropriate installation media.
  • Use a 64-bit EFI-mode GRUB to launch a 32-bit kernel -- The 64-bit EFI-mode GRUB 2 can launch 32-bit Linux kernels -- or at least, some of them can. (GRUB binaries vary significantly in how they're built, so I can't promise that all 64-bit EFI-mode GRUB binaries will do the job.) As a practical matter, to work in this way, you'd probably want to install Windows, then a 32-bit Ubuntu (in BIOS mode will work fine), then the 64-bit Ubuntu in EFI mode. Ideally, the 64-bit Ubuntu's GRUB should detect the 32-bit Ubuntu installation and create separate menu entries for it. They might not be well-labeled, but they should work. If they aren't detected, it might be possible to create entries manually.
  • Use rEFInd to boot 64-bit EFI-mode OSes and your 32-bit BIOS-mode OS -- This approach is similar to the preceding one; however, you would install my rEFInd boot manager after completing the 64-bit Ubuntu installation. You would then edit /boot/efi/EFI/refind/refind.conf: Uncomment the scanfor line and ensure that hdbios is among the options. The result is that rEFInd will enable you to launch Windows or 64-bit Ubuntu in EFI mode, and it will show a gray diamond-shaped icon that will launch the BIOS-mode GRUB from the 32-bit Ubuntu installation. This GRUB will in turn launch the 32-bit Ubuntu. (It may eventually pick up and show options to launch the 64-bit Ubuntu in BIOS mode, too.)

In theory, any of these options should work. In practice, they all present pitfalls during setup, and any might be blocked by firmware quirks or other problems. Thus, you may need to try two or even all three of them before you get something to work.

Related Question