0

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?

sdaau
  • 3,056
  • 1
    I'm pretty sure 32-bit just doesn't have EFI support. You would have to specially boot it in legacy mode. – TheWanderer Mar 23 '16 at 12:25
  • Thanks for that @Zacharee1 - I seemingly do not have a legacy mode in the computer's BIOS, which is probably why I could never boot the previous 32-bit installs; so I'll keep that in mind... Cheers! – sdaau Mar 23 '16 at 12:37
  • 1
    If a 64 bit UEFI system when you turn off Secure boot, you then have two choices to boot UEFI or CSM/BIOS/Legacy. Only some lightweight Bay Trail based systems may be UEFI Class 3 or no BIOS/CSM mode. The 64 bit UEFI grub will not boot a BIOS install, but you should be able to boot from UEFI or one time boot key a legacy install. – oldfred Mar 23 '16 at 13:26

3 Answers3

4

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.

Rod Smith
  • 44,284
  • 7
  • 63
  • 105
  • Thanks for the general overview, @RodSmith - it seems I went with the second option of your "Hard Way", looks like it works for me - my notes are posted below. Cheers! – sdaau Mar 23 '16 at 20:10
  • In my case, I had Win10, Ubuntu (64bit) and Debian (32Bit). I booted up Ubuntu (64 bit) in UEFI mode, and appended http://bit.ly/2awH6P9 at /etc/grub.d/40_custom and regenerated grub config. – Nehal J Wani Jul 29 '16 at 22:11
2

Ok, tried it, it works - but there are caveats, so here's my notes:

The bios on this PC gave me two options for booting Ubuntu 14.04 32-bit desktop bootable USB thumbdrive: UEFI, and non-UEFI one. The UEFI choice simply rebooted the BIOS, so I had to use the non-UEFI one. Once the USB thumbdrive booted, chose Try Ubuntu.

From here, I ran gparted (or gparted-pkexec), then shrunk the main partition of the Ubuntu 14.04 64-bit, then made the unallocated space into a new ext4 partition. At this point, it is visible that the 64-bit installer made a separate partition for boot - note this for later.

At this point, I ran the Install Ubuntu icon from the live 32-bit run. When it comes to the Installation Type screen (see http://www.ubuntu.com/download/desktop/install-ubuntu-desktop), here choose "Something Else", and simply doubleclick at the partition made in the previous step, "use" it as ext4, and have it as mount point / (the root), then continue the setup.

About here you will get the “Reserved BIOS boot area” prompt (".. If you do not go back to the partitioning menu and correct this error, ..", see Should I create the Reserved BIOS boot area partition?) - you can ignore this and proceed, as we saw with our own eyes previously in gparted that there already is such a boot partition.

When the 32-bit installation finishes and the PC reboots, you will notice there is no Grub menu at start, instead the PC boots directly into the 64-bit OS. In here, as per I can't get grub menu to show up during boot, I changed GRUB_HIDDEN_TIMEOUT etc (see https://www.gnu.org/software/grub/manual/html_node/Simple-configuration.html and Bug #1258597 “Warning: Setting GRUB_TIMEOUT to a non-zero value ...”) values in /etc/default/grub, and ran sudo update-grub - I think it is this that made the 32-bit install partition be found, and it's menu entry get added to Grub menu. When this run is finally rebooted, the Grub menu should be shown at startup - if not, try holding/tapping Shift as soon as the BIOS screen goes by.

Now I can boot in the newly installed 32-bit, I run apt-get update + dist-upgrade as there's a new kernel, the new kernel gets installed, and now there should be an extra entry in the Grub menu, so update-grub gets ran in 32-bit mode automatically by apt-get dist-upgrade, and will unfortunately make a mess of the boot process. Next time we reboot, if we want to go to the 32-bit OS via the Grub menu, we will be greeted with Grub errors like "file not found" and "unaligned pointer".

Luckily, at this point, the Grub entry for the 64-bit process is still uncorrupt, so we can boot in the 64-bit system, and here issue sudo update-grub to correct the Grub boot.

Now, at this point there are two minor glitches. First, the names shown in the Grub menu are something like "Ubuntu" for the 64-bit (the first) install, and "Ubuntu with kernel xxxx on /dev/sdxy" for the 32-bit install. I'd rather have names like "Ubuntu 64-bit" and "Ubuntu 32-bit", but that is apparently difficult to do (How can I edit my Grub bootloader entries (Hide, Rename, Remove)? Preferably doing it manually, and not with a program, Bug #439538 “Grub2 don't provide a option for rename menuentry on /etc/default/grub”), as Grub2 seems to autogenerate these names from scripts.

Then, also the order of boot is set by Grub2 scripts, so if you need to have the default OS to be booted to be the 32-bit, you'll have to count in which order is the desired entry shown at Grub2 boot menu, then use GRUB_DEFAULT=x in /etc/default/grub (How do I change the GRUB boot order?) followed by sudo update-grub - again, ran strictly in the 64-bit OS!

Obviously, one will have to be extra careful each time with possibly re-tuning these things each time there is a kernel update in either of the OSs...

sdaau
  • 3,056
  • Thanks for providing all the links. As noted in my answer, most of the solutions are tricky, and the links you've provided may help others navigate this minefield. – Rod Smith Mar 23 '16 at 23:58
1

The bug report on this can be found on launchpad. It is stated there that Debian has beta's for 32-bit EFI. From the link:

What's here?

This is a fourth build of netinst CDs with experimental EFI support included. For the first time, I've included i386 support as well as just amd64. The amd64 image should boot and work in EFI mode on a recent amd64 (x86_64) machine, doing the following steps differently:

boot via UEFI rather than BIOS mode
use GPT partitioning on hard disks rather than MSDOS
add a FAT-formatted EFI partition for booting
install an EFI bootloader rather than lilo/grub-pc

It might be worth an attempt to copy that over to an Ubuntu ISO and try it out.

Rinzwind
  • 299,756