Score:0

How to perform unattended install of Ubuntu Core from USB flash drive

uz flag

There is a way to setup Ubuntu Server unattended install by creating a custom ISO file with instructions in preseed and programming this on a USB flash drive to install Ubuntu Server on a industrial PC for example.

Is there a way to do with Ubuntu Core? I thought that maybe writing the image on a USB flash drive (using the command below) and booting from it might do it, but it just installs Ubuntu Core 22 on the USB drive and not the internal SSD drive.

xzcat ~/Downloads/ubuntu-core-22-amd64.img.xz | sudo dd of=/dev/sda bs=32M status=progress; sync

What would be the best approach to go about creating a USB flash drive unattended install of Ubuntu Core 22?

Score:0
cn flag

Ubuntu Core does not have a pre-made Live/Bootable installer, so what you are asking for is not easy.

Fundamentally, you need a bootable OS on the USB stick, and that system handles the install of Ubuntu Core onto the target system. The bootable OS need not be Ubuntu Core (or any flavor of Ubuntu).

The basic process is:

  1. You boot the USB stick, it downloads/installs Ubuntu Core to the device's onboard storage.
  2. You reboot from the onboard storage, Ubuntu Core starts and does all its first-run setup.
  3. The system reboots into the setup system, connects to the network, scans for cloud-init customizations (and implements them if found).
  4. Finally, the system starts the ssh server and opens to authorized logins.

You can see that for autoinstall you're going to be doing a lot of scripting to sequence the steps, to help the bootable USB OS discover the storage device to install, to test for success/failure of each step, and to somehow signal USB-removal to the human.

Kris avatar
uz flag
Right now, I just need an automated way to copy the Ubuntu Core image to the SSD. The user can initially interrupt the boot process to tell it to boot from USB stick. After that it would boot to USB stick, write the Ubuntu Core IMG to SSD, & reboot. The next time around the boot would not get interrupted so it would boot from SSD. I can user preseed to customize the Ubuntu Core to automatically install itself. I just need an automated way to program the image to the SSD. Maybe there is a way to automate the live CD of Ubuntu Desktop.
Kris avatar
uz flag
I'm really surprised I can't modify the Ubuntu Core 22 image & it's installer to choose the SSD instead of the USB flash drive as the default installer.
user535733 avatar
cn flag
Your comments suggest that you still expect a traditional bootable install application. No such thing for Ubuntu Core. Hence the first sentence of this answer, particular emphasis on "not easy." There are lots of ways to automate it, but none are pre-baked. You are blazing that path.
Kris avatar
uz flag
Yes, so far the only link was able to find was from Dell, but it installs it on USB Flash drive and not internal persistent storage: https://www.dell.com/support/kbdoc/en-in/000121349/installing-ubuntu-core-os-with-the-ubuntu-core-16-os-usb-drive
user535733 avatar
cn flag
Since you seem to be looking at deploying Ubuntu Core and custom Snaps, I suggest joining the forum at snapcraft.io. That's where Ubuntu Core developers and Snap experts hang out. You will eventually get good answers here, but you will get faster answers directly from the active Core/Snap community there.
Kris avatar
uz flag
Thank you, I have joined the community. Other container OS operating systems like BalenaOS allow one to install an image from USB in a "zero-touch method"/unattended method.
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.