Ubuntu Core is a transactional version of the Ubuntu Linux OS, made specifically for internet of things (IoT) devices and large container deployments. This OS powers many digital signs, robotics and gateways, and uses the same kernel, libraries and system software as the standard Ubuntu, but on a much smaller scale.
Ubuntu Core can be run as a VM, or on the following platforms:
- Raspberry Pi 2 and 3;
- Compute Module 3;
- Qualcomm DragonBoard 410c;
- Intel NUC;
- Intel Joule;
- Samsung Artik;
- KVM;
- Amazon Web Services (AWS);
- Microsoft Azure; and
- Google Cloud Platform.
First Steps
- Start by creating an Ubuntu SSO account
- Import an SSH Key into your Ubuntu SSO account on this page. Instructions to generate an SSH Key on your (Linux or Mac) machine can be found here. See here for Windows machines.
Hardware and software requirements
- A Raspberry Pi 2 or 3
- A microSD card
- A monitor with an HDMI interface
- An HDMI cable
- A USB keyboard
- An Ubuntu Core image for Raspberry Pi 3
Installation instructions
- Copy the Ubuntu Core image on the SD card. We like Etcher for this. It just works.
- Attach the monitor and keyboard to the board.
- Insert the SD card you just images and plug the power adaptor into the board.
First boot
- The system will boot then become ready to configure
- The device will display the prompt “Press enter to configure”
- Press enter then select “Start” to begin configuring your network and an administrator account. Follow the instructions on the screen, you will be asked to configure your network and enter your Ubuntu SSO credentials
- At the end of the process, you will see your credentials to access your Ubuntu Core machine:
This device is registered to <Ubuntu SSO email address>. Remote access was enabled via authentication with the SSO user <Ubuntu SSO user name> Public SSH keys were added to the device for remote access.
User login
Once setup is done, you can login with SSH into Ubuntu Core, from a machine on the same network, using the following command:
ssh <Ubuntu SSO user name>@<device IP address>
The user name is your Ubuntu SSO user name, it has been reminded to you at the end of the account configuration step.
First boot tips
- During setup,
console-conf
will download the SSH key registered with your Store account and configure it so you can log into the device viassh <Ubuntu SSO account name>@<device IP address>
without a password. - There is no default
ubuntu
user on these images, but you can runsudo passwd <account name>
to set a password in case you need a local console login.
Installing and running your first snap
The snapd daemon manages the snap environment on the local system. Its installation will include the snap tool for interacting with snaps. You can check both are installed by attempting to run snap version
on the command line:
$ snap version snap 2.35 snapd 2.35 series 16 neon 16.04 kernel 4.4.0-128-generic
If snapd is not present for some reason, simply install it
sudo apt install snapd
Here is how you can now find any “hello world” kind of snaps in the store:
$ snap find hello hello-node-snap 1.0.2 bhdouglass - A simple hello world command hello-mdeslaur 2.10 mdeslaur - GNU Hello, the "hello world" snap hello-snap 0.01 muhammad - GNU hello-snap, the "Hello, Snap!" snap hello 2.10 canonical - GNU Hello, the "hello world" snap hello-world 6.3 canonical - The 'hello-world' of snaps hello-sergiusens 1.0 sergiusens - hello world example hello-gabriell 0.1 gabriell - Qt Hello World example hello-bluet 0.1 bluet - Qt Hello World example so-hello-world 0.2 shadowen - the old classic hello-huge 1.0 noise - a really big snap
snap find <search terms>
will query the store and list the results with their version number, developer names and description.
Install and execution
As you can see, a number of developers uploaded snaps related to “hello world”. Let’s just install one of them.
$ sudo snap install hello hello (stable) 2.10 from 'canonical' installed
To run the command, simply type hello in the command line (which is a command provided by the hello
snap):
$ hello Hello, world!
This is obviously just a simple example, what it has in common with all other snaps though, is that it runs fully confined and can only access its own data. A more advanced example would be running a kiosk-style device or use your imagination and design your own IOT device! Here are some ideas.