Skip to content

Instantly share code, notes, and snippets.

@farshidtz
Created August 29, 2022 12:50
Show Gist options
  • Save farshidtz/2b708daed0cb79b79eccccf2d6d263f1 to your computer and use it in GitHub Desktop.
Save farshidtz/2b708daed0cb79b79eccccf2d6d263f1 to your computer and use it in GitHub Desktop.
Install Ubuntu Core on Intel NUC with 1 USB drive

This guide describes how to install Ubuntu Core on Intel NUC using two USB flash drives.

Here are a few alternative options to remove the reliance on a second USB flash drive:

Download the image on live Ubuntu

This is self explained. Boot into the live Ubuntu and download the image. Flash it according to the official instructions.

This is not always practical:

  • We may need to reuse that image without downloading it every time
  • We may need to use a custom-built image that isn't available online

Copy over SSH

Here, we explain how to copy the image from your development machine to the live Ubuntu session over SSH. It is best to do this over a good internal network.

Boot into the live Ubuntu as usual. Install OpenSSH Server and set a password for the ubuntu user:

sudo apt update
sudo apt install -y openssh-server
passwd # no sudo

Copy from your machine to the live Ubuntu it over SSH:

scp pc.img.xz ubuntu@<my-nuc>:/home/ubuntu

SSH to the live Ubuntu and flash the image. Follow the official instructions to flash:

# find the disk label
sudo fdisk -l

# flash
xzcat /home/ubuntu/pc.img.xz | sudo dd of=/dev/<target disk device> bs=32M status=progress; sync

# shutdown
sudo shutdown now

The shutdown gets interrupted to wait for user input after removing the live USB drive. Instead of doing that, remove the drive and then press and hold the power button to turn off the device. It is safe to do so because the drive is already unmounted.

Turn on and boot Ubuntu Core

Copy the image to the writable partition of live Ubuntu

Plug the live Ubuntu flash drive to your development machine. The last partition is writable and gets mounted as writable. Copy the image to that drive.

Boot the live Ubuntu.

The writable partition gets mounted at /var/crash but for some reason the data can't be found there.

Find and mount the writable parition manually:

sudo fdisk -l
sudo mount /dev/<target disk device> /mnt/writable

Follow the official instructions to flash:

# find the disk label
sudo fdisk -l

# flash
xzcat /mnt/writable/pc.img.xz | sudo dd of=/dev/<target disk device> bs=32M status=progress; sync

Restart and boot Ubuntu Core.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment