INTEL NUC x86-64 Ubuntu 18.04

Board description

The Intel® NUC is a powerful 4x4-inch mini PC with entertainment, gaming, and productivity features, including a customizable board that is ready to accept the memory, storage, and operating systems that you want. From fully configured, ready-to-use Mini PCs to kits and boards for do-it-yourselfers, find the Intel® NUC that is right for you.

URL: https://www.intel.com/content/www/us/en/products/boards-kits/nuc.html
Wiki: https://en.wikipedia.org/wiki/Next_Unit_of_Computing

Test results

The Ubuntu releases in the table below have been tested by the Mender community. Please update it if you have tested this integration on other Ubuntu releases.

Debian Build Runtime
Ubuntu-Bionic-x86-64 :test_works: :test_works:

Build Means that the image generation completes without errors and outputs images.
Runtime Means that Mender has been verified to work on the board.

Getting started

Convert your own image

Prerequisites

  • A Linux-based laptop/workstation (Ubuntu has been verified to work)
  • You need to install Docker Engine to use this tutorial

Build Docker image for mender-convert

Open a terminal and clone the mender-convert repository, e.g.

git clone -b 2.2.x https://github.com/mendersoftware/mender-convert.git

Enter your mender-convert environment:

cd mender-convert

There is a utility script which can be used to generate the appropriate docker image to run mender-convert :

./docker-build

This will create a container image you can use to run mender-convert .

Image preparation

Installing Ubuntu 18.04 on target machine

Download Ubuntu image and install it as usually on Intel NUC as described here

NOTE !
When installing please select manual partition setup and just create 2 partitions:

  • /boot/efi - size 200MB
  • / (root partition) - size ~6GB

For demonstration purposes we didn’t use whole disk space for root filesystem just small portion as we need to copy disk image for conversion purposes.

Copying image for conversion

When system is installed reboot Intel NUC and start Ubuntu live (choose first option in grub menu) from USB stick. When booted we need to copy content of installed system from ssd. For storing final disk image we would need to plug another USB stick with at least 8GB empty space.
For copying use command:

sudo sh -c 'dd if=/dev/sda conv=sync,noerror bs=1M count=7500 status=progress | gzip -c  > /media/ubuntu/disk/ubuntu_18.04.img.gz'

NOTE!
Please adjust path to USB stick (/media/ubuntu/disk) depending on your setup

After some time we will have content of installed system copied from ssd to USB stick. When command is finished safely remove USB stick (wait until data are written).

Prepare image for conversion

Plug USB stick to host PC and copy image ubuntu_18.04.img.gz to mender-convert input directory and extract it by running:

guzip ubuntu_18.04.img.gz

As Ubuntu is using GPT disk format and we copy only part of disk we need to run:

sudo sgdisk -e ubuntu_18.04.img

Above command fix GPT header and we have ready input image for conversion.

Convert the Ubuntu disk image to support Mender

With the raw disk image and the container configured above, we can convert the
image.

You can get your Mender Professional tenant token at the My organization page in Mender Professional.

Configure the Mender client for hosted Mender server:

./scripts/bootstrap-rootfs-overlay-hosted-server.sh \
    --output-dir ${PWD}/rootfs_overlay_demo \
    --tenant-token "Paste token from Mender Professional"

There are additional scripts in the scripts/ directory to configure with a local demo server, or production server.

Run mender-convert inside the container by running:

MENDER_ARTIFACT_NAME=release-1 ./docker-mender-convert \
    --disk-image input/ubuntu_18.04.img \
    --config configs/generic_x86-64_hdd_config \
    --overlay ./rootfs_overlay_demo

Conversion will take 10-15 minutes, depending on your storage and resources available.

Use the output images

After a successful conversion, the images and artifacts are:

  • deploy/ubuntu_18.04-x86_64-mender.img.gz
  • deploy/ubuntu_18.04-x86-64-mender.ext4
  • deploy/ubuntu_18.04-x86-64-mender.mender

The disk image (with .img.gz suffix) can be used to start install on target device with Mender integrated. On the other hand, if you already have Mender running on your device and want to deploy a rootfs update from this conversion, you should use the Mender Artifact files, which have .mender suffix. You can either deploy this Artifact in managed mode with the Mender server (upload it under Releases in the server UI) or by using the Mender client only in Standalone deployments .

Install

For installation we use similar approach as we copy disk image from INTEL NUC to USB stick.

  • boot live system from Ubuntu 18.04 USB stick as was done before
  • copy deploy/ubuntu_18.04-x86_64-mender.img.gz to USB stick and after it is copied plug USB stick to INTEL NUC

Finally to install mender converted image run:

zcat /media/ubuntu/disk/ubuntu_18.04-x86_64-mender.img.gz | sudo dd of=/dev/sda bs=1M status=progress 

Copying can take some time as we extract archive and flash it to ssd disk. When command is finished you can safely remove all USB stick from INTEL NUC and reboot it to boot mender enabled image.

When this step is done we again need to fix GPT header by running:

sudo sgdisk -e /dev/sda

References

  • The documentation on Building a Mender Debian image contains more information about using Mender with the Debian family of distributions.
  • The official Mender documentation explains how Mender works. This is simply a board-specific complement to the official documentation.

Known issues

2 Likes

Can confirm this works on Ubuntu 20.04. Might want to note that secure boot needs to be disabled in bios in order for NUC to boot after flashing.

1 Like