# Deployment of Ubuntu Server 16.04 on Raspberry Pi 3 B+

**URL:** <https://hub.mender.io/t/deployment-of-ubuntu-server-16-04-on-raspberry-pi-3-b/998>\
**Category:** General Discussions\
**Created:** [September 10, 2019, 1:27pm UTC](https://hub.mender.io/t/deployment-of-ubuntu-server-16-04-on-raspberry-pi-3-b/998 "2019-09-10T13:27:19Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![moises.valeo](https://avatars.discourse-cdn.com/v4/letter/m/c37758/32.png) [@moises.valeo](https://hub.mender.io/u/moises.valeo)\
**Post date:** [September 10, 2019, 1:27pm UTC](https://hub.mender.io/t/deployment-of-ubuntu-server-16-04-on-raspberry-pi-3-b/998/1 "2019-09-10T13:27:19Z")

</div>

Hi everyone,

I’m new to mender tool and I’m having a problem using mender-convert tool when it comes generating a mender image (.sdimg) from “golden image” Ubuntu Server 16.04 and which is running properly on Raspberry Pi 3 B+.

I have runned the following commands in order to do this:

> > sudo ./docker-mender-convert raw-disk-image-shrink-rootfs --raw-disk-image input/golden-image-1.img --storage-total-size-mb 8000

> > sudo ./docker-mender-convert from-raw-disk-image --raw-disk-image “input/golden-image-1.img” --mender-disk-image /home/integrasys/mender-convert/output/golden-image-1.sdimg --device-type “raspberrypi3” --artifact-name “golden-image-1” --bootloader-toolchain arm-buildroot-linux-gnueabihf --server-url “[docker.mender.io](http://docker.mender.io)” --demo --server-cert “./server.crt” --storage-total-size-mb 8000

The output is the following:

```auto
***Data partition size set to default value: 128MB***
1/10 Shrinking raw disk image root filesystem...
dumpe2fs 1.44.1 (24-Mar-2018)
resize2fs 1.44.1 (24-Mar-2018)
	Root filesystem size:       
	minimal: 2473947136         
	aligned: 2474639360       
	sectors: 4833280
	Raw disk image new endsector: 5103615
	New root filesystem size (sectors): 4833280
2/10 Repartitioning raw disk image...
	Detected raw disk image with 2 partition(s).
	Calculating partitions' sizes of the Mender image.
	Adjust Mender disk image size to the total storage size (8000MB).
	Additional space for rootfs partitions not aligned.         
	Final image will be smaller than 8000MB
	Extracting boot partition from raw disk image.
	Storing data in boot.vfat.
	Extracting root filesystem partition from raw disk image.
	Storing data in rootfs.img.
	Creating blank Mender disk image:       
		image size: 8384413696 bytes       
		boot partition size: 134217728 bytes       
		root filesystem size: 4051697664 bytes       
		data partition size: 134217728 bytes
	Changes in partition table applied.
3/10 Formatting repartitioned raw disk image...
	Creating MS-DOS filesystem for 'boot' partition.
	Creating ext4 filesystem for 'primary' partition.
	Creating ext4 filesystem for 'secondary' partition.
	Creating ext4 filesystem for 'data' partition.
4/10 Setting boot partition...
	Done.
5/10 Setting root filesystem partition...
	Done.
6/10 Setting file system table...
	Done.
7/10 Cleaning intermediate files...
	Partition mappings cleaned.
8/10 Installing Mender to Mender disk image...
	Downloading demo server certificate.
	Installing files.
3install -m 755 -d /mender-convert/output/sdimg/primary/usr/bin
install -m 755 mender /mender-convert/output/sdimg/primary/usr/bin/
install -m 755 -d /mender-convert/output/sdimg/primary/etc/mender
install -m 644 mender.conf.production /mender-convert/output/sdimg/primary/etc/mender/mender.conf.production
install -m 644 mender.conf.production /mender-convert/output/sdimg/primary/etc/mender/mender.conf
install -m 644 mender.conf.demo /mender-convert/output/sdimg/primary/etc/mender/mender.conf.demo
echo "artifact_name=unknown" > /mender-convert/output/sdimg/primary/etc/mender/artifact_info
install -m 755 -d /mender-convert/output/sdimg/primary/usr/share/mender
install -m 755 -d /mender-convert/output/sdimg/primary/usr/share/mender/identity
install -m 755 support/mender-device-identity /mender-convert/output/sdimg/primary/usr/share/mender/identity/
install -m 755 -d /mender-convert/output/sdimg/primary/usr/share/mender/inventory
install -m 755 support/mender-inventory-bootloader-integration support/mender-inventory-hostinfo support/mender-inventory-network support/mender-inventory-os support/mender-inventory-rootfs-type /mender-convert/output/sdimg/primary/usr/share/mender/inventory/
install -m 755 -d /mender-convert/output/sdimg/primary/usr/share/mender/modules/v3
install -m 755 support/modules/deb support/modules/docker support/modules/directory support/modules/single-file support/modules/rpm support/modules/script /mender-convert/output/sdimg/primary/usr/share/mender/modules/v3/
install -m 755 -d /mender-convert/output/sdimg/primary/lib/systemd/system
install -m 0644 support/mender.service /mender-convert/output/sdimg/primary/lib/systemd/system/
	Done.
9/10 Installing Bootloader to Mender disk image...
	Building U-Boot related files.
	Installing U-Boot related files.
cp: cannot stat '/mender-convert/output/sdimg/boot/kernel7.img': No such file or directory
install: cannot create regular file '/mender-convert/output/sdimg/primary/usr/lib/raspi-config/init_resize.sh': No such file or directory
unlink: cannot unlink '/mender-convert/output/sdimg/primary/etc/rc3.d/S01resize2fs_once': No such file or directory
rm: cannot remove '/mender-convert/output/sdimg/primary/etc/init.d/resize2fs_once': No such file or directory
	Done.
10/10 Creating Mender Artifact...
	Rootfs partition id not set - 'primary' will be used by default.
	Storing data in golden-image-1.ext4.
	Writing Mender artifact to: /mender-convert/output/golden-image-1.mender
	This may take 10-20 minutes (using LZMA)...
	Creating Mender Artifact succeeded.
Conversion complete!
The Mender disk image you can provision your device storage with is at:         
	/mender-convert/output/golden-image-1.sdimg
The Mender root file system partition is at:
	/mender-convert/output/golden-image-1.ext4
The Mender Artifact you can upload to your Mender server to deploy to your devices is at:         
	/mender-convert/output/golden-image-1.mender*

```

Then I have flashed this generated image into the microSD but unsucess when I put it on the raspberry, it does not boot giving the following errors that appears in the capture:

 ![IMG_20190910_131921](https://canada1.discourse-cdn.com/flex036/uploads/mender/original/1X/a3778d9fda26fb6fbb7c691737a682d78667088a.jpeg)

Anyone has any suggestion about this issue?

Thanks in advance, I will appreciate any help because I am quite stucked with this. It’s possible to do this?

Best reagards.

Edit: @mirzak: formatting

---

<div class="post-metadata">

**Author:** ![mirzak](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/mirzak/32/2056_2.png) [@mirzak](https://hub.mender.io/u/mirzak)\
**Post date:** [September 10, 2019, 1:49pm UTC](https://hub.mender.io/t/deployment-of-ubuntu-server-16-04-on-raspberry-pi-3-b/998/2 "2019-09-10T13:49:12Z")

</div>

I believe this is the same problem reported in a different thread (see my comments there),

> [@Issue about mender-convert from 2 different input image](https://hub.mender.io/t/issue-about-mender-convert-from-2-different-input-image/957):
>
> As we known, mender-convert can be used to convert existing disk images for use with Mender. For more info, pls see: [https://docs.mender.io/2.0/artifacts/debian-family](https://docs.mender.io/2.0/artifacts/debian-family) And the code is: git clone -b 1.1.1 [https://github.com/mendersoftware/mender-convert.git](https://github.com/mendersoftware/mender-convert.git) Here we use the following mender-convert cmd to generate the mender image: DEVICE\_TYPE="raspberrypi3" # RAW\_DISK\_IMAGE="input/2019-04-09-raspbian-stretch-lite.img " RAW\_DISK\_IMAGE="input/ubuntu-18.04.2-preinstalled-server-arm64+raspi3.img"…

---

<div class="post-metadata">

**Author:** ![mirzak](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/mirzak/32/2056_2.png) [@mirzak](https://hub.mender.io/u/mirzak)\
**Post date:** [September 10, 2019, 1:51pm UTC](https://hub.mender.io/t/deployment-of-ubuntu-server-16-04-on-raspberry-pi-3-b/998/3 "2019-09-10T13:51:38Z")

</div>

Also welcome to the Mender community. I hope you will have a pleasant experience 🙂

---

<div class="post-metadata">

**Author:** ![moises.valeo](https://avatars.discourse-cdn.com/v4/letter/m/c37758/32.png) [@moises.valeo](https://hub.mender.io/u/moises.valeo)\
**Post date:** [September 10, 2019, 3:06pm UTC](https://hub.mender.io/t/deployment-of-ubuntu-server-16-04-on-raspberry-pi-3-b/998/4 "2019-09-10T15:06:21Z")

</div>

Okay, thank you very much, I will try to try ubuntu 18 32-bit although the image I used was this:

ubuntu-16.04-preinstalled-server-armhf+raspi3.img

and it is 32 bit I think.

Best regards.

---

<div class="post-metadata">

**Author:** ![mirzak](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/mirzak/32/2056_2.png) [@mirzak](https://hub.mender.io/u/mirzak)\
**Post date:** [September 10, 2019, 3:10pm UTC](https://hub.mender.io/t/deployment-of-ubuntu-server-16-04-on-raspberry-pi-3-b/998/5 "2019-09-10T15:10:55Z")

</div>

> [@moises.valeo](#):
>
> Okay, thank you very much, I will try to try ubuntu 18 32-bit although the image I used was this:
> 
> ubuntu-16.04-preinstalled-server-armhf+raspi3.img

Then it might something else if you are already using a 32-bit image. I will give it a quick run trough as well

---

<div class="post-metadata">

**Author:** ![mirzak](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/mirzak/32/2056_2.png) [@mirzak](https://hub.mender.io/u/mirzak)\
**Post date:** [September 10, 2019, 3:14pm UTC](https://hub.mender.io/t/deployment-of-ubuntu-server-16-04-on-raspberry-pi-3-b/998/6 "2019-09-10T15:14:36Z")

</div>

Ah, see what the problem is. The content of boot partition on the Ubuntu image is slightly different compared to Raspbian,

```auto
bcm2710-rpi-3-b.dtb bootcode.bin boot.scr cmdline.txt config.txt fixup_cd.dat fixup.dat fixup_db.dat fixup_x.dat initrd.img start_cd.elf start_db.elf start.elf start_x.elf uboot.bin vmlinuz

```

So this will not work with the current mender-convert version.

Problem is the assumptions made in this part of the code,

> <https://github.com/mendersoftware/mender-convert/blob/master/rpi-convert-stage-5.sh#L132-L137>

---

<div class="post-metadata">

**Author:** ![moises.valeo](https://avatars.discourse-cdn.com/v4/letter/m/c37758/32.png) [@moises.valeo](https://hub.mender.io/u/moises.valeo)\
**Post date:** [September 10, 2019, 4:11pm UTC](https://hub.mender.io/t/deployment-of-ubuntu-server-16-04-on-raspberry-pi-3-b/998/7 "2019-09-10T16:11:30Z")

</div>

So what could be the solution to this fault?, is it not possible to use mender-convert with ubuntu server?

I’m testing with the following image:

ubuntu-18.04.3-preinstalled-server-armhf+raspi3.img

What do you suggest I can do?.

Thank you very much.

---

<div class="post-metadata">

**Author:** ![mirzak](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/mirzak/32/2056_2.png) [@mirzak](https://hub.mender.io/u/mirzak)\
**Post date:** [September 10, 2019, 6:54pm UTC](https://hub.mender.io/t/deployment-of-ubuntu-server-16-04-on-raspberry-pi-3-b/998/8 "2019-09-10T18:54:18Z")

</div>

> [@moises.valeo](#):
>
> So what could be the solution to this fault?, is it not possible to use mender-convert with ubuntu server?

Current statement would be that Ubuntu server images are not supported by `mender-convert`. We have never tested those before and have primarily tested with Raspbian images.

> What do you suggest I can do?.

You could give it a go an try to resolve it on your own, would be my best suggestion.

I pointed you to the faulty code, the problem is not hard to fix but currently it has hard to prioritize this. You can see that we are trying to move files around, and on Ubuntu images they are named differently hence the problems and why it does not work.

---

<div class="post-metadata">

**Author:** ![moises.valeo](https://avatars.discourse-cdn.com/v4/letter/m/c37758/32.png) [@moises.valeo](https://hub.mender.io/u/moises.valeo)\
**Post date:** [September 18, 2019, 6:42pm UTC](https://hub.mender.io/t/deployment-of-ubuntu-server-16-04-on-raspberry-pi-3-b/998/9 "2019-09-18T18:42:49Z")

</div>

Hi mirzak,

First of all, thank you very much for the proposed solutions. We still have problems converting from ubuntu image, the kernel.img file is not found in the ubuntu boot.  
Any solution you tell us will be welcome.  
Thank you,  
Greetings
