Install Ubuntu Core on the Raspberry Pi Compute Module 3
Install Ubuntu Core
We will walk you through the steps of flashing Ubuntu Core on a Compute Module 3. At the end of this process, you will have a board ready for production or testing snaps.
- An Ubuntu SSO account with an SSH key
- A Compute Module 3
- A Compute Module IO board
- A microSD card
- An Ubuntu Core image
- Two micro USB to USB cables (one for power, one to setup the CM from the host)
- An HDMI cable and a display
- A USB keyboard
- A USB to RJ45 adaptor or a WiFi dongle
- A USB hub to attach the keyboard and the RJ45 adaptor/WiFi dongle (note that the keyboard and display can be replaced with a serial cable connected directly to pins of the IO board)
Setup an Ubuntu SSO account
Download Ubuntu Core
Setup USBboot on your host system
On the host system: Ubuntu Desktop 16.04 or above:
In a terminal, download the USBboot tool you will use to setup the board, and install its build dependencies:
git clone --depth=1 https://github.com/raspberrypi/usbboot.git sudo apt install libusb-1.0-0-dev
cdmake and start the resulting binary as root:
cd usbboot make sudo ./rpiboot
- Once started, it will wait for the Compute Module to be attached to the machine.
Setup the Compute Module IO board
On the Compute Module IO board:
- Position the Compute Module on the IO board.
- Attach the USB hub, RJ45 adaptor, keyboard and monitor (HDMI) to the board.
USB SLAVE BOOT ENABLE) on the IO board is in the EN position.
With the first micro USB to USB cable, plug the host machine into the IO Board USB slave port (
- With the second micro USB to USB cable, power on the IO board.
Flash the board from your host system
On your host system:
- The USBboot tool should have recognized the attached Compute Module and mounted the EMMC partition as a new device.
- Identify the device by opening the "Disks" application:
- Locate the EMMC partition of the Compute Module in the left pane.
- Note down its "Device" address on the right pane.
- If the partition is mounted, unmount it by clicking the square icon below the partition diagram or the eject icon in a file manager
- Download the Ubuntu Core image. When this is done you should have an
ubuntu-core-18-armhf+cm3.img.xzfile in your
Flash Ubuntu Core on the EMMC partition with:
xzcat ~/Downloads/<image file .xz> | sudo dd of=<device address> bs=32M; sync
- This process will take some time. After completion, you can reboot your Compute Module IO board and follow the first boot process with the display, keyboard and RJ45/WiFI dongle attached to it.
6 First boot setup
- 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.
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>
Your 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-confwill download the SSH key registered with your Store account and configure it so you can log into the device via
ssh <Ubuntu SSO account name>@<device IP address>without a password.
- There is no default
ubuntuuser on these images, but you can run
sudo passwd <account name>to set a password if you need a local console login.
Before you start, get your IoT security story straight
A recent Canonical survey of 2,000 consumers suggests that a shockingly high percentage of connected devices may be vulnerable to botnets, hackers and cyber attacks:
- Only 31% of consumers update the firmware on their connected devices as soon as updates become available.
- 40% of consumers have never performed firmware updates on their connected devices
- 40% of consumers believe that performing firmware updates on their connected devices is the responsibility of either software developers or the device manufacturer