A Quick Guide To Installing Ubuntu On A Dual Boot System (with Windows)
There are many good guides to installing Ubuntu but they don't all stress that it's very important if you are Dual-Booting with Windows that you need to ensure that Ubuntu is installed using the same 'boot mode' as Windows for everything to work smoothly.
(By 'work smoothly' I mean that, once installed, you switch on your machine and it goes to a grub boot menu where you can choose which Operating System you wish to boot up.)
The official Ubuntu documentation covers this well in the UEFI section: https://help.ubuntu.com/community/UEFI
One of the more obvious ways to tell that this might be your issue is, after installing Ubuntu, when you choose the 'Ubuntu' option from the grub menu it works fine, but choosing 'Windows' results in an error.
Windows can still usually be booted by pressing a key on startup (often f12) to take you to a 'one-time boot menu' and you can select it and successfully boot it from there.
In the case of this question, when switching on, the machine boots straight to Windows unless f12 is pressed, from where Ubuntu can be selected.
One-Time Boot Menu
When switching on your machine there should be a key that you can press to take you to your BIOS settings. That key will depend on what the manufacturer of the machine has chosen. Often it is f2 or esc and sometimes it will briefly flash a message on the screen to tell you what to press.
- The 'Boot Menu' can also be accessed by pressing a key on startup that can vary depending on the manufacturer. (I have a Dell that uses f12 and an HP that uses f9)
Here's an article that has gathered some information about both for many of the most popular computer manufacturers: http://webtechmag.com/list-of-boot-menu-and-bios-keys-by-manufacturer/
Here are two examples of what a 'one time boot menu' can look like (with the USB UEFI option highlighted):
--Note that there are two entries available for the USB, allowing you to boot the USB in UEFI mode or not. (The 'Not-UEFI' option is usually referred to as 'Legacy Boot'.)
If you have installed Ubuntu, apparently successfully, but then encounter this sort of issue, then it is always worth checking the BIOS settings and looking at the 'Boot Order' or 'Boot Sequence'.
The boot order that you want is for 'Ubuntu' to be first, because that option will load the grub bootloader and from there you can choose either operating system.
On an HP Laptop I had (where Windows was booting automatically after I installed Ubuntu), it wasn't clear that Ubuntu was even a boot option until I highlighted and selected the 'Windows' option. It then showed me that there were other options and I could change the order using f5 and f6 to make Ubuntu first.
You may also have a separate Legacy boot option list for 'non UEFI' booting. It's unlikely that a machine from the last five years with Windows pre-installed will use anything other than UEFI and most modern Linux distributions support UEFI boot, so do not require Legacy boot in order to work.
If Legacy boot is enabled, however, if you inserted your USB and didn't specifically choose to boot in UEFI mode, then in my experience this tends to mean that the USB will boot in Legacy mode. (My first 'adventures' with UEFI helped me find this out.)
If you are trying out a Live USB then it usually doesn't really matter what mode it boots in, but when it comes to installing Ubuntu you want to make sure that the Ubuntu USB boots in the same mode as Windows uses. Which will most likely be UEFI.
Although the installation will go fine, you will not have a setup where the grub boot loader appears when you first switch on and happily lets you choose to boot any Operating System on offer.
The simplest option in this case, is to reinstall Ubuntu making sure that you have booted the Live USB in the same boot mode as Windows.
@oldfred has kindly mentioned in the comments that another option is to use the Boot-Repair program to convert it.
I've not had any experience of using this, but you can follow the instructions in the official documentation (https://help.ubuntu.com/community/UEFI) under the heading 'Converting Ubuntu into UEFI or Legacy mode'.
This involves either making a Boot-Repair-Disk Live USB or adding the Boot-Repair ppa and installing the program on Ubuntu.
Best Answer
You're running into Compatibility Support Module (CSM; aka legacy-boot or BIOS-mode boot) issues. Most modern computers use Extensible Firmware Interface (EFI; usually Unified EFI, or UEFI, which is EFI version 2.x) firmware. EFI firmware is fundamentally different from the older BIOS firmware that dominated the PC industry from the 1980s to 2011. The CSM, though, provides a backwards-compatibility layer, enabling new EFI-based computers to boot old OSes. This is useful in some cases, but when used inappropriately, it causes a new set of problems, because you need to know how to control the boot mode, and that can be tricky. Even if you know what you're doing, there's so much model-to-model differences that predicting what a computer will do is next to impossible. For more on this subject, see my Web page on the CSM.
Your computer appears to have both BIOS-mode and EFI-mode versions of GRUB installed. I suspect (but am not 100% positive) that your computer is currently configured to boot into the EFI-mode GRUB, but this version is misconfigured. When you exit from it, you get an EFI shell prompt. When you exit from that, the BIOS-mode GRUB launches and enables you to boot Ubuntu. Your Windows, though, is installed in EFI mode, and the BIOS-mode GRUB can't launch the EFI-mode Windows.
If my analysis is correct, there are at least two good solutions to the problem:
/sys/firmware/efi
. If it's present, you've booted in EFI mode and can continue; if it's absent, you've been unsuccessful in disabling your CSM and should try that again, or at least learn to control your boot mode, as described on my CSM page.Use whichever of those methods sounds most appealing to you. If it doesn't work, use the other method -- but be sure to read the rest of this answer first.
In either of these cases, you should be aware that dual-booting Windows and Ubuntu can create problems if you fail to disable the Fast Startup feature in Windows. (Note that many EFIs have a feature with a similar name, but this feature is unrelated to the Windows feature and is much less troublesome.) The Windows Fast Startup feature turns shutdown operations into suspend-to-disk operations in order to speed up subsequent boots. This practice, though, causes filesystem damage to shared partitions in dual-boot scenarios. The ESP is a shared partition, so Fast Startup can cause damage to this partition. Symptoms include an assortment of boot problems, including a failure to launch GRUB, a failure of GRUB's configuration scripts to detect Windows, and an inability of GRUB to launch Windows even if a Windows entry appears in its menu. Similar problems can occur with rEFInd. Even if you don't run into these problems, you should disable Fast Startup, as described in the link at the top of this paragraph. If you do run into these problems, you should disable Fast Startup, and if you use GRUB, you may need to type
sudo update-grub
to have it update its menu after you've disabled Fast Startup.Note that in Windows 10, it's often necessary to disable Hibernate, in addition to Fast Startup. AFAIK, this is not required with Windows 8.
EDIT:
Normally, rEFInd should show a graphical UI. If it can't read any icons, though, it drops back to a text-mode display like the one you've shown. Thus, I suspect that rEFInd is unable to read its icons -- and probably not its filesystem drivers, either; if it could read the drivers, you'd probably see an entry to launch your Linux kernel directly. Did you use the CD-R or USB flash drive image, and how did you prepare your boot medium from the image? It could be there was a problem with the way you did this, or the filesystem might have been damaged or be in some way unappetizing to your particular firmware.
As a workaround, try downloading the
.zip
file and, in Linux, do this:gdisk
type code EF00 or a "boot flag" set in GParted orparted
); but it will probably work if it uses MBR and is not marked as an ESP..zip
file andcd
into the resulting directorysudo ./refind-install --usedefault /dev/sdd1 --alldrivers
, changing/dev/sdd1
to the device filename for your USB flash drive's FAT partition. This should create a fresh rEFInd install on the disk with all the necessary files.You should be able to boot with this disk. If it still doesn't work, then something very odd is going on. You might try changing the partition table format on the USB disk (use MBR instead of GPT, or vice-versa).
Of course, you could also try the Boot Repair approach instead of trying to get rEFInd to work.