# INTEL NUC x86-64 Ubuntu 18.04

**URL:** <https://hub.mender.io/t/intel-nuc-x86-64-ubuntu-18-04/2214>\
**Category:** Debian family\
**Created:** [July 21, 2020, 4:16pm UTC](https://hub.mender.io/t/intel-nuc-x86-64-ubuntu-18-04/2214 "2020-07-21T16:16:14Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![MarekBelisko](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/marekbelisko/32/33_2.png) [@MarekBelisko](https://hub.mender.io/u/MarekBelisko)\
**Post date:** [July 21, 2020, 4:16pm UTC](https://hub.mender.io/t/intel-nuc-x86-64-ubuntu-18-04/2214/1 "2020-07-21T16:16:14Z")

</div>

# 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.

 ![56-102-184_R01.jpg](https://canada1.discourse-cdn.com/flex036/uploads/mender/original/1X/ad3adaddb7d9678aa50203828084c0ae84e04aa2.jpeg)

URL: [https://www.intel.com/content/www/us/en/products/boards-kits/nuc.html](https://www.intel.com/content/www/us/en/products/boards-kits/nuc.html)  
Wiki: [https://en.wikipedia.org/wiki/Next\_Unit\_of\_Computing](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](https://docs.docker.com/install) to use this tutorial

### Build Docker image for `mender-convert`

Open a terminal and clone the [mender-convert repository](https://github.com/mendersoftware/mender-convert), e.g.

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

```

Enter your `mender-convert` environment:

```bash
cd mender-convert

```

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

```bash
./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](https://releases.ubuntu.com/18.04/) and install it as usually on Intel NUC as described [here](https://ubuntu.com/download/intel-nuc-desktop)

**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:

```bash
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:

```bash
guzip ubuntu_18.04.img.gz

```

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

```bash
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](https://hosted.mender.io/ui/#/settings/my-organization).

Configure the Mender client for hosted Mender server:

```bash
./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:

```bash
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](https://docs.mender.io/architecture/mender-artifacts?target=_blank) 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](https://docs.mender.io/architecture/standalone-deployments?target=_blank).

# 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:

```bash
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:

```auto
sudo sgdisk -e /dev/sda

```

# References

- The documentation on [Building a Mender Debian image](https://docs.mender.io/artifacts/debian-family) contains more information about using Mender with the Debian family of distributions.
- The official [Mender documentation](https://docs.mender.io/) explains how Mender works. This is simply a board-specific complement to the official documentation.

# Known issues

---

<div class="post-metadata">

**Author:** ![MarekBelisko](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/marekbelisko/32/33_2.png) [@MarekBelisko](https://hub.mender.io/u/MarekBelisko)\
**Post date:** [July 21, 2020, 4:16pm UTC](https://hub.mender.io/t/intel-nuc-x86-64-ubuntu-18-04/2214/2 "2020-07-21T16:16:28Z")

</div>



---

<div class="post-metadata">

**Author:** ![MarekBelisko](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/marekbelisko/32/33_2.png) [@MarekBelisko](https://hub.mender.io/u/MarekBelisko)\
**Post date:** [July 21, 2020, 7:01pm UTC](https://hub.mender.io/t/intel-nuc-x86-64-ubuntu-18-04/2214/3 "2020-07-21T19:01:15Z")

</div>



---

<div class="post-metadata">

**Author:** ![lucastcox](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/lucastcox/32/948_2.png) [@lucastcox](https://hub.mender.io/u/lucastcox)\
**Post date:** [December 20, 2020, 1:41am UTC](https://hub.mender.io/t/intel-nuc-x86-64-ubuntu-18-04/2214/4 "2020-12-20T01:41:36Z")

</div>

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.
