Ubuntu Core on Raspberry Pi: A Bumpy Ride with Mixed Outcomes

September 21, 2023

My experience working with Ubuntu Core , this comes as part of a series of working with embedded Linux OS for Raspberry Pis or similar devices.

Quick links to my other posts: Yocto and Raspberry Pi , Updatable Linux OS


In this blog post, we’ll explore my journey with Ubuntu Core on a Raspberry Pi, navigating the initial setup, learning the ropes of Snaps and Snapcraft, and dealing with hardware compatibility challenges.

I choose to use Raspberry Pi as a hardware platform because of its large prevalence in the DIY community and its online resources. For some applications it does offer a road to production use cases with the CM4 module . While Raspberry Pi OS (formerly Raspbian) is the default choice for many, I wanted to explore options that may be used in a real-world IoT solution with hundreds or thousands of headless small Linux devices that need to be deployed, managed, and updated.

The Promise

I read much of the marketing from Canonical’s website about Ubuntu Core and watched a number of vague product Youtube videos before I started. I was left with a feeling that I wasn’t sure what I was getting with Ubuntu Core, an OS for sure, but what about management control plane for devices? However the two selling points that stuck out to me:

Loved by developers: Core is Ubuntu; open source, binary-compatible and backed by a strong developer community. Improve productivity with a unified and application-centric developer experience. - From Ubuntu.com/core

Wonderful I do enjoy Ubuntu and have been in the Ubuntu/Debian ecosystem for years with desktop OSs and Embedded. That said there is a bit of bait-and-switch with moving from traditional Ubuntu to the containerized OS with only Snapd/Snap.

Low-touch: Reliable, self-healing, remotely accessible and recoverable devices which are always up-to-date with mission-critical over-the-air (OTA) updates. - From Ubuntu.com/core

Over-the-air (OTA) updates was a key reason I was interested in looking at Ubuntu Core. With any headless wireless IoT device deployed in the field getting OTA right is key. One wrong update and you brick your device and need field techs to go to location and replace the device. I haven’t dug into all the technical details of Snaps and their self-contained features but I do know they put a lot of effort into this aspect. You can read their whitepaper How Ubuntu Core transforms OTA updates for IoT .

The Initial Setup Conundrum

My Ubuntu Core journey began with high hopes but quickly hit a stumbling block: the initial setup. Unlike the user-friendly process of Raspberry Pi OS, Ubuntu Core requires a monitor and keyboard for the setup. For those accustomed to the convenience of headless setups in IoT projects, this was a noticeable departure from the norm. The absence of first-class provisioning for a Raspberry Pi left me wishing for a smoother start.

Learning Snaps and Snapcraft

One of the most significant hurdles in my Ubuntu Core adventure was the transition to Snaps and Snapcraft for software management. As someone deeply ingrained in the Debian/Ubuntu world of apt and deb packages, embracing Snaps felt like a leap into the unknown.

Snapcraft, while a powerful tool for creating and deploying Snaps, introduced a steep learning curve. Adapting to this new packaging system took considerable effort and time. This transition was especially painful when dealing with Tailscale . I love Tailscale! I use it for managing remote devices and providing seamless SSH access to devices through varying network configurations. Unfortunately unlike Raspberry Pi OS / Ubuntu and most other OSs Tailscale is not supported 🙁 though I did find this non-working Snap by Sergio Schvezov.

I spent some time packaging a simple golang application that advertises on Bluetooth LE using the Bluez interface. It was fairly easy to install Snap and Multipass on my Macbook Pro M2. I found the docs adequate though the changes between core20 and core22 threw me off a bit. With core22 you need to add which their examples for core20 did not have:

build-snaps:
  - go

I eventually got it working and packaged my application. I scp’d it to my device and installed with `snap install –dangerous my-bluetooth-app.snap`
I read up onUbuntu Core’s container permission model and how plugs and interfaces work to ensure my app could talk to the Bluez interface . I think I got it working, to be sure i also tried in `devmode` which removes all permissioning (see this ).

The Bluetooth Blues

One of the most frustrating moments in my Ubuntu Core journey was the absence of Bluetooth drivers for the Raspberry Pi. Attempting to connect Bluetooth peripherals left me scratching my head and diving deep into the troubleshooting rabbit hole.

After spending a considerable amount of time debugging, I eventually had to concede defeat. The lack of essential Bluetooth drivers made it impossible to use this feature on my Raspberry Pi with Ubuntu Core.

I found this helpful forum about manually copying over drivers. However at this point between the Tailscale issues and now this I was ready to give up and move on. I never went through the suggestions and got it working.

I left off frustrated with this issue and the learning curve to Snapcraft that I never explored the more Ubuntu Core specifics like modeling custom devices and images .

The Conclusion

In hindsight, my journey with Ubuntu Core on a Raspberry Pi was a mixed bag of experiences. While Ubuntu Core offers certain benefits, such as enhanced security, transactional updates, and long-term support, the challenges I encountered outweighed these advantages.

The initial setup inconvenience, the steep learning curve of Snaps and Snapcraft, and the hardware compatibility issues with Bluetooth all contributed to a less-than-ideal experience. Moreover, the feeling of vendor lock-in from Canonical, the company behind Ubuntu, added to my reservations. NitroKey sums this up quite well in a better post (may be slightly out-dated).

Ultimately, the benefits of using Ubuntu Core on a Raspberry Pi did not seem to outweigh the costs. The ecosystem’s differences from what I was accustomed to in the Debian/Ubuntu world, along with the hardware woes, left me yearning for the familiarity and ease of use offered by Raspberry Pi OS. My next adventure is exploring Mender to handle full OS OTA updates to both Raspberry Pi OS as well as Yocto built images.