SOLVED: How to install Ubuntu 24.04.1 on an USB stick
Volker Wysk
post at volker-wysk.de
Fri Sep 6 16:51:16 UTC 2024
Hi!
I've puzzled things out. Here's how I am successful installed Ubuntu 24.04.1
on USB-sticks. I'm using Liam Proven's virtual machine method. What follows
is a step by step guide and some considerations on UEFI.
We create a virtual machine, which runs the Ubuntu Installer, which installs
Ubuntu on the USB stick. After this, we delete the machine. The virtual
machine will have access only to the USB-stick device and can't interfere
with the host system. So there's no danger from buggy installers or faulty
input in the installer run. It also means that you can install to a stick in
UEFI mode, when your system already runs in UEFI mode and has an EFI System
Partition. The two ESPs won't interfere with each other.
1. Install "virt-manager" and "GParted" (if not already installed).
2. Download the ISO of the (Ubuntu or other) Installer of your choice (such
as 24.04.1).
3. Stick in the target USB stick.
4. Start virt-manager.
5. Create a new virtual machine. That's the icon near the top
left. A five page setup procedure follows.
5.1. Keep the selection at "Local install media" as it is.
5.2. Choose your new ISO at the second step at "Chose ISO or CDROM install
media".
5.3. You can keep the memory and CPU settings (next step).
5.4. The fourth step (storage) can be left alone too. We'll delete it later.
5.5. All ready. Check "Customize configuration before install", then click
on "Finish".
6. The hardware configuration window pops up.
6.1. Select "VirtIO Disk 1" and click on remove (that's the virtual disk
form step 5.4). Choose "Delete the associated storage files" and klick on
"Delete".
6.2. Start GParted. At the top right corner is the menu of all the drives on
the system. Open it and determine the device file name of your target USB
stick. Make sure that your USB-Stick isn't mounted. You can double-click in
GParted on the partitions of your stick and it tells you if it's mounted
(along other things). You better triple-check that you've got that right.
6.3 Click "Add hardware" (bottom left) in the VM hardware list. Select
"Storage" and "Select or create custom storage". In the entry field right of
"Manage..." insert the device file name of your target USB stick. This is
something like "/dev/sdc". You better triple-check that you've got that
right, again.
6.4 At "Bus type" choose "USB". Then click on "Finish". In the hardware
list, there appears a new entry "USB Disk 1".
7. Click on "Begin installation". The Grub menu appears in the virtual
machine's window. Choose "Try or install Ubuntu" and go through the
installation procedure.
8. After the installation is complete, we delete the virtual machine, which
we created. In the Virtual Machine Manager window, right-click on the
virtual machine and choose "Delete". Make sure "Delete assiciated storage
files" isn't checked. It would delete your device file of the stick.
That's it.
A view words on UEFI. The installer can make an UEFI installation or the
older (more compatible) BIOS/USB installation. It depends on the firmware
and how it has been booted. On my desktop system, I can boot both UEFI and
the older BIOS/USB/MBR media. I don't know how this is in other systems.
The installer will create an UEFI media (including an EFI System Partition)
when it has been started in UEFI mode. It will create the older media when
not.
The default for the virtual machine is BIOS mode (no UEFI). If you want
UEFI, this means that you need to specify the firmware for the virtual
machine. In the hardware configuration window of virt-manager at "Overview"
and then "Firmware", you can choose between "BIOS", "UEFI" and three UEFI
variants. I haven't found out yet, in how the UEFIs differ.
When I build an Linux USB stick with UEFI mode, it won't run on my old (non-
UEFI) laptop. It only runs on my newer desktop. When I build it in BIOS
mode, both machines can boot from it.
That's it. I hope many guys will find that useful.
Cheers,
Volker
More information about the ubuntu-users
mailing list