I don't know offhand how Ubiquity for 17.10 would run from a boot of Ubuntu 17.04. Even if you use chroot
, you'll still be running the older kernel and have lots of 17.04 stuff running in the background. You could always try this, but you might be the first person in the world to do so, and with little reason....
Instead of doing it this way, why not simply boot the 17.10 installer directly? There's no reason this wouldn't work on your computer -- or if there is, you haven't identified what that reason might be. This course will eliminate the risk of problems because you ran the installer from an older OS's environment.
Either way you do it, you face a problem: By default, Ubiquity will try to install GRUB to the first EFI System Partition (ESP) it finds, which will normally be the ESP on your hard disk. Thus, you'll end up with a USB drive that will not boot by itself and a computer that will not boot unless the USB drive is plugged in. (The latter is because Ubuntu configures its GRUB to rely on /boot/grub/grub.cfg
, which will be on the USB drive after you install Ubuntu there.) The easiest solution to this problem is to tell Ubiquity to not install GRUB, but then install it (or some other boot loader) manually later. In brief, the procedure is:
- Boot the Ubuntu installer in its "try before installing" mode -- do not select the option to install Ubuntu as the computer boots!
- Once the installer has booted and you see a desktop environment, open a Terminal window.
- Type
ubiquity -b
. The -b
option tells Ubiquity to not install a boot loader.
- Install to the USB drive normally, but be sure it includes an ESP.
- Install a boot loader to the ESP, using the filename
EFI/BOOT/bootx64.efi
. This step is itself fairly complex, and I'm afraid I don't have a step-by-step procedure handy for doing it from an Ubuntu installation environment; however...
- Boot Repair might be able to do the job, or at least help.
- My web page on EFI boot loaders for Linux covers the general principles and procedures, along with several boot loader options. You should be able to piece together a procedure after reading that page, although there'll be some trial-and-error when it comes to configuration details.
The final step of boot loader installation is trickier than it should be because installing to a USB drive is not something that Ubiquity was designed to do, and because GRUB configuration is a nightmare. (Most people don't experience the nightmare because GRUB provides configuration scripts that do things properly, and Ubiquity sets things up properly for the common case of installing Ubuntu to a hard disk. Your case is not common, though.) If you don't need Secure Boot support, using another boot loader is likely to be easier than using GRUB, since everything else is easier to configure than GRUB; but GRUB is the only one that comes signed in a way that makes it work with Secure Boot without jumping through extra hoops. Thus, if you need Secure Boot, it's more of a toss-up.
Note also that BIOS-mode and EFI/UEFI-mode booting rely on entirely separate boot loaders. Thus, if you want your USB drive to be bootable in both modes, you'll need to install both BIOS-mode and EFI-mode boot loaders, which further complicates matters. My procedure assumes you want to boot only in EFI mode, since you explicitly mentioned UEFI computers but not BIOS computers.
Finally, there are other ways to do this. The easiest is likely to be to install using a computer with no OS already on it. That way, you can set up the USB drive with an ESP, and it will be the only ESP available. Post-installation, it then becomes a matter of renaming a few files, as described here, to get the USB drive booting on any computer. Temporarily unplugging your hard disk or changing its ESP's type code to something else may be a way to do this with your regular computer, but these options run the risk of follow-on problems. (Most notably, some EFIs erase boot options that are no longer valid, so if you unplug your hard disk, you may find that it will no longer boot when you plug it back in.)