Ubuntu Core 16 is now available. It is a tiny, transactional implementation of Ubuntu Linux that targets embedded applications such as the Internet of Things (IoT). It uses a new packaging system with modules called snaps that include metadata about their connectivity and interface requirements (Fig. 1).
A snap can have one or more interfaces that are either a plug or a slot providing connections between snaps. A snap exists as a read-only, immutable, compressed squashFS blob, while an instance also includes a private, writeable directory. Communication with the operating system services uses the interface mechanism. Snaps can be given access to other directories.
Ubuntu Core is a more limited, compact Linux, but it includes features such as transactional over-the-air updates with full rollback support. This is key for all IoT aspects, from consumer to industrial IoT (IIoT).
Security is also part of the mix, using Ubuntu’s AppArmor support that matches that found on the standard version of Ubuntu Linux. The security system applies to snaps and their automatic connectivity and configuration. A snap is confined to its published interfaces. Much of this is done by restricting directory and file access very similar to how the Inferno operating system worked.
A nice thing about the open-source Ubuntu Core is that it is free. It can be distributed at no cost. There is also an app (snap) store that can be used to distribute applications to consumers, as well as for developers.
The snap file used for distribution is actually a specially formatted, compressed zip file (Fig. 2). This includes a metadata file that includes the interface and security information to put the snap into context within an Ubuntu Core system. Snaps can include native code, as well as interpreted code like Python, PHP, and even Bash scripts.
Ubuntu Core 16 matches the usual Ubuntu 16.04 LTS (long-term support) platform in terms of the base kernel (Fig. 3). The difference is in package isolation. For example, shared libraries cannot go across snap boundaries.
Public collections of snaps and their source can be found on GitHub. Ubuntu Core is available for download for a range of target platforms that include Raspberry Pi 2 and 3, Intel NUC and Joule, Samsung’s Artik, Qualcomm Snapdragon, BeagleBone, Gumstix, and more. Essentially the system needs an x86 or a ARMv7 or better processor. This fits most Cortex-A systems. 128 Mbytes of RAM is a good starting point, with about 4 Gbytes of non-volatile storage. A Raspberry Pi 2 Model B has a Cortex-A7, 1 Gbyte of RAM, and an microSD card slot.
It is even possible to run Ubuntu Core 16 on virtual machines like Linux’s KVM. Although Ubuntu Core targets small footprint IoT applications, it is an interesting alternative to containers as a thin OS for more modular systems.
Once a system is running Ubuntu Core, it can use its connectivity to maintain and update the system’s snap collection. Snaps are available for most IoT-related protocols like MQTT and links to many cloud-based IoT services.
Ubuntu Core has a lot of competition, such as Windows 10 IoT Core, embedded RTOSes, and various Linux incarnations like Tizen Linux. It has the advantage of familiar Ubuntu underpinnings and development tools and the snappy module system.