Creating a bootable Xubuntu flash drive using macOS (10.14 and later)
Prepping the Flash Drive and Installing Xubuntu
It currently is not possible to make a bootable persistent Xubuntu USB flash drive (i.e., one you can boot up from and save your work to) exclusively using macOS. So we’re going to break this into two procedures: First we’ll create a bootable read-only Xubuntu USB flash drive (which is fast and easy in macOS), and then we’ll use that flash drive to run Xubuntu and create a second fully fledged readable/writable “persistent” bootable USB flash drive (which is why you need two USB flash drives).
PROCEDURE #1: Making a “non-persistent” bootable USB drive on a Mac
- Boot up your Mac and open the web browser of your choice
- Goto xubuntu.org and download the 20.04 LTS (“long term support”) release. (This version of Xubuntu is current and stable, and considered “enterprise grade”; it is scheduled to continue to enjoy full support and updates until 2025, and critical security updates until 2030.) You’ll want the file that ends in “.iso“; it’ll be 1 or 2 GB. Save it to your Desktop so that it’s easy to find later.
- Next format one of your USB flash drives. Plug one into your Mac, then launch the macOS Disk Utility. Select the “Physical Disk” (not “Physical Volume”) corresponding to your USB flash drive, and chose “ERASE” from the ribbon at the top of the Disk Utility window. A new window will pop up. Name the drive “USB B“, chose “MS-DOS (FAT)” and “GUID Partition Map,” then click ERASE. When the operation is complete, eject the drive, put a note on it so you remember it is “USB B,” and set it aside.
- Now take your other USB flash drive, plug it into your Mac, and run the Disk Utility again. The process is basically the same: Select the “Physical Disk” (not “Physical Volume”) corresponding to this USB flash drive, and chose “ERASE” from the ribbon at the top of the Disk Utility window. A window will pop up. Name the drive “USB A” (note the name on the flash drive!), chose “MS-DOS (FAT)” and “GUID Partition Map,” then click ERASE. Leave this drive plugged in.
- Goto https://www.balena.io/etcher/ and download “Etcher.” This is the software we’ll use to make the USB flash drive bootable; there are many similar programs. Most should work just as well.
- Now we will the “USB A” flash drive into a bootable copy of Xubuntu. First run Etcher. Once it launches, do the folloing:
- Click the “Flash from file” button on the left side of the Etcher window.
- A file menu will open. Locate your Xubuntu download (it will have a name like “xubuntu-20.04.1-desktop-amd64.iso”). Click “Open.”
- Now click on “Select Target” in Etcher and make sure your flash drive is selected.
- Click “Flash!”, enter your password, and wait.
- IMPORTANT: when the process is complete, there will be a pop up saying “The disk you inserted was not readable by this computer.” Just click “Eject” and everything will be fine. If you click “Initialize…” you’ll have to do the process over again.
- Henceforth we will call this flash drive “USB A“. IMPORTANT: USB A will boot into a functional version of Xubuntu Linux—which is great! But you will not be able to save your work on it (i.e., it does not “have persistence”)—which is annoying! So, we’re going to boot into Xubuntu using USB A, which will give us access to the tools we need to create the bootable “persistent” Xubuntu USB flash drive we need.
PROCEDURE #2: Making a bootable persistent Xubuntu USB drive on a Mac
- Start by boot up your new Xubuntu flash drive:
- Shutdown your Mac.
- Plug in USB A (if it isn’t still plugged in).
- Now turn on Mac by holding down the Power button and Option key at the same time.
- Release the Option key when the Startup Manager screen appears.
- Select your USB flash drive from the list (NOTE: If your USB flash drive isn’t listed, try booting as normal, updating your macOS software, and then starting all over again with Procedure #1.)
- Once Xubuntu loads it may display a big “Install” dialogue box. Don’t worry, it isn’t really “installing” anything on the computer. Click “Try Xubuntu” (the dialogue box might refer to your USB flash drive as a “CD”—just accept that; volunteers did all this!) If you do not get this dialogue, then it will just boot directly into Xubuntu, which is fine.
- Reconnect to the Internet (if you’re using wifi, the Xubuntu system will not know which network to use or any of your passwords) .
- This part will seem ridiculous, but we need to re-download your Xubuntu .iso (I know; I’m sorry. This is a Mac thing.) So, goto xubuntu.org (again) and download the 20.04 LTS (“long term support”) release (again). You’ll want the file that ends in “.iso“ (again); it’ll (still) be 1 or 2 GB. Save it to your Desktop so that it’s easy to find later.
- Now it’s time to install the software that will allow us to create a persistent flash drive. Start by opening the Terminal Emulator (click on the mouse icon in the upper left corner and look under “Favorites”). Enter the following commands at the command line prompt (hit Enter after each, and wait for the command to run; it will return you to a prompt when it’s ready for a new command):
sudo add-apt-repository universe
(will probably tell you ‘universe’ distribution component already enabled for all sources; that’s good!)- sudo add-apt-repository ppa:mkusb/unstable
- sudo apt update
- sudo apt install mkusb
- sudo apt install usb-pack-efi
- Now click on the little mouse icon in the upper left and start typing “mkusb” in the Search box. A green icon with a stylized USB-pitchfork will pop up. It will be labelled “mkusb” Click it to launch the software.
- The program will ask “
Run mkusb versin dus?
” click YES - The program will warn you that the target device will be overwritten. That’s the point, so click OK.
- Chose “i” (for “install (make a boot device)”) and click OK
- Chose “p” (for “‘persistent live’—only Debian and Ubuntu“) and click OK
- Select your .iso
- Plug in USB B.
- Select USB B in mkusb and click OK.
- A new window will open labeled “persistent live drive settings”. Click Use defaults.
- Another new window will open labeled “select space for persistence (percent)”. click Use default.
- One more new window will open labeled “select version of usb-pack”. click Use default.
- Next you’ll get the “final checkpoint, go ahead?” dialogue. Select the “Go” radio button and click Go.
- Wait. A bunch of stuff will happen in the various open terminal windows. That’s good.
- When all of the operations are complete you can click the OK button. Shutdown the computer (click on the mouse icon in the upper left corner and then click the shutdown power button in the lower right corner of that menu.)
- Phew! Done! Now let’s test it out. To boot up your persistent Xubuntu flash drive:
- Unplug USB A and plug in USB B.
- Turn on Mac by holding down the Power button and Option key at the same time.
- Release the Option key When the Startup Manager screen appears.
- Select your USB flash drive from the list.
- The next menu is the “Grub” menu; it’s simple and text-based. Highlight the top option (it ends in “persistent live” and is probably already highlighted). Hit Enter. Xubuntu loads as before (likely skipping the big “Install/Try Xubuntu” dialogue box).
- Poke around for a bit and familiarize yourself with Xubuntu. Change the desktop background (there are several ways to do so; one is to right click anywhere on the desktop. Or you can click on that little mouse icon in the upper left and look for Settings). Once you’ve picked a new background for your desktop, shutdown the computer entirely, and then boot back into your Xubuntu flash drive again. If all is working well, then you should still see the new background image you picked.
- Since you no longer need USB A for anything, feel free to format it (as per Procedure #1 Step #3 above—to avoid confusion give it a new name, like “first clone”), and then use Etcher to clone USB B onto this fresh flash drive.
All done! You’re ready for the next step. Go back to the “Install PyCKBot” section of Software and carry on.