Introduction
This article demonstrates to new users how to install Ubuntu* Core on an UP Squared* Grove* IoT Development Kit. The UP Squared board is a low-power and high performance platform ideal for Internet of Things (IoT) applications. The UP Squared board based on either the Intel® Celeron® processor (N3350) or Intel® Pentium® processor (N4200). For more information, visit http://www.up-board.org/upsquared. Ubuntu* Core is a lightweight, transactional version of Ubuntu* designed for IoT and cloud usage. Snaps are universal Linux packages that are available to install on Ubuntu* Core to work on IoT devices and more. For more information on the Ubuntu* Core, go to https://www.ubuntu.com/core.
Hardware Requirements
The hardware components used in this project are listed below:
- UP Squared board
- 2 USB 2.0 or 3.0 flash drives with at least 2GB free space available
- A monitor with an HDMI interface
- USB keyboard and mouse
- A VGA or HDMI cable
- A network connection with Internet access or Wi-Fi kit for UP Squared
- An existing Linux* system is required to generate the RSA key (see Figure-1 below) and to login with SSH into the Ubuntu Core (Figure-14 below).
Software Requirements
The software requirements used in this project are listed below:
- Go to http://releases.ubuntu.com/xenial/ubuntu-16.04.4-desktop-amd64.iso and download the Ubuntu Desktop 16.04.4 LTS image
- Download Ubuntu Core image
- Rufus USB installer (optional)
Steps
Download Images
- Download Ubuntu Core Image 16.04.4
Setup the Ubuntu SSO Account
- Create an Ubuntu Account
- Generate Keyss
- Import Key
Write the USB Drives
- Download Ubuntu Core Image 16.04.4
Installation
- Install Live Flash
- Install Ubuntu Core
Generate a Host SSH Key
mkdir ~/.ssh chmod 700 ~/.ssh ssh-keygen –t rsa
Figure 1: Generate an SSH key on the Linux shell
Your public key is now available as .ssh/id_rsa.pub in your home folder /home/Ubuntu/.ssh/id_rsa.pub.
- Click on the SSH keys and insert the contents of your public key /home/Ubuntu/.ssh/id_rsa.pub, then click on Import SSH key.
Figure 2: Submitted the SSH keys successfully
Create a Live USB Ubuntu* Flash Drive
- Go to http://releases.ubuntu.com/xenial/ubuntu-16.04.4-desktop-amd64.iso and download the Ubuntu Desktop 16.04.4 LTS image.
- Visit https://rufus.akeo.ie and download the Rufus USB installer. Using the Rufus USB installer to put the Ubuntu image onto the USB flash drive is one of the methods.
- Follow instructions in this link https://www.ubuntu.com/download/desktop/create-a-usb-stick-on-windows to create a live USB Ubuntu flash drive.
Booting from the Live USB Flash Drive
- Connect the USB hub, keyboard, mouse and the monitor to the Up Squared.
Figure 3: Up Squared board
- Insert the Live USB Ubuntu Desktop flash drive you created earlier in to the Up Squared board.
- Select "Try Ubuntu without installing”.
Figure 4: Try Ubuntu without installing
Install Ubuntu* Core Image on the Up Squared
- Insert the second USB flash drive containing the Ubuntu Core image file into the Up Squared board.
- Check for directories mounted on the internal eMMC storage. Umount any directory mounted on the internal eMMC storage. Open a terminal and type:
mount | grep mmcblk umount /media/ubuntu/writable
- Check for the name of the drives of the Up Squared:
sudo fdisk -l
- Assume /dev/sda is the second USB flash drive containing the Ubuntu Core image, mount it to /media/usb1.
sudo mkdir /media/usb1 sudo mount /dev/sda /media/usb1
- Decompress the Ubuntu Core image and flash it into the Up Squared internal memory:
xzcat /media/usb1/ubuntu-core-16-amd64.img.xz | sudo dd of=/dev/mmcblk0 bs=32M status=progress; sync
Figure 5: Flash Ubuntu Core
- Remove the Live USB Ubuntu Desktop flash drive and reboot the Up Squared board. The Up Squared will reboot from the internal memory where the Ubuntu Core has been flashed.
Configure the UP Squared* Board
After the Up Squared has rebooted, you will see a prompt below.
- Select Start to configure your network.
- Select wlan0, then select Configure WIFI settings.
- Enter Network name and Password, then select Done.
- Highlight Done and press Enter.
- Highlight Done and press Enter again.
Figure 10: Network connections configuration complete
- Now, DHCPv4 is enabled for wlan0, select Done.
- Enter the Ubuntu One email address that was set up earlier, select Done then Enter.
Figure 11: Profile setup
- Once the configuration complete, the Ubuntu SSO username and Up Squared localhost IP address will be displayed on the screen. Use this Up Squared localhost IP address to login from a different Ubuntu machine later in Figure 14.
- Select Finish then Enter. Ubuntu Core login will be prompted as follow:
First User login on a Different Ubuntu* Machine
- First, add RSA identities to the authentication agent by running ssh-add on the shell.
- Next, login with SSH into the Ubuntu Core from a different Ubuntu machine on the same network. The user name is your Ubuntu SSO username and the password is not required.
ssh <your Ubuntu SSO username>@<Ubuntu Core IP address>
Figure 14: ssh into Ubuntu Core from a different Ubuntu machine
- Set a password in case you want to login from the local console on the Up Squared board. On the different Ubuntu machine console, type:
sudo passwd <your Ubuntu SSO username>
Now, using your Ubuntu SSO username and password just set in Figure 15 to log in to the Up Squared board from the its local console:
Run Hello World Snap on localhost
- Sign in to a Snap store using an Ubuntu SSO account:
- Install the Hello Snap package using the snap name:
Figure 18: Install hello snap
- Run the Hello Snap:
- List all snaps:
Figure 20: List all snaps
Refresh the Hello snap:
Figure 21: Refresh hello snap
Refresh all snaps:
Figure 22: Refresh all snaps
Remove the Hello snap:
Summary
Key References
- Intel® Developer Zone: https://software.intel.com/en-us/iot/home
- Up Squared: http://www.up-board.org/upsquared
- Ubuntu Core: https://www.ubuntu.com/core
- Generate an SSH Key: https://help.ubuntu.com/community/SSH/OpenSSH/Keys
- Create a bootable USB stick on Windows*: https://www.ubuntu.com/download/desktop/create-a-usb-stick-on-windows
- Download Rufus USB Installer: https://rufus.akeo.ie
- Get started with the snap command: https://developer.ubuntu.com/core/get-started/intel-nuc, https://docs.snapcraft.io/core/usage
- Build snaps: https://snapcraft.io/docs/build-snaps
About the Author