Recent Changes - Search:

edit SideBar

UbuntuCore

Summary

Ubuntu Core is a light weight Linux for IoT. It uses the concepts of snaps to provide functionality. One idea is to deploy snaps.

BeagleBone Black

Summary: As of 12/2016, BeagleBone Black was not directly supported under Ubuntu Core, but there is a .img file that can be downloaded and installed via a micro SD card. It looks like logging in requires console and keyboard so that the id_rsa.pub key from https://one.ubuntu.com/ is downloaded.

BBB How To

Required:

Procedure:

  1. Create an account at https://one.ubuntu.com/ and upload your id_rsa.pub key
  2. Download the image file, uncompress it and dd it to the micro sd. Note that we use the device for the entire sd card /dev/mmcblk0 not /dev/mmcblk0p1 or /dev/mmcblk0p2. Below is what I did on BB:

    wget http://people.canonical.com/~ogra/snappy/all-snaps/stable/current/ubuntu-core-16-beaglebone.img.xz

    ...

    root@beaglebone:~/src#  unxz ubuntu-core-16-beaglebone.img.xz
    root@beaglebone:~/src# file *.img
    ubuntu-core-16-beaglebone.img: x86 boot sector; partition 1: ID=0xc, active, starthead 32, startsector 2048, 262144 secto\
    rs; partition 2: ID=0x83, starthead 25, startsector 264192, 1064960 sectors, code offset 0x0
    root@beaglebone:~/src# ls /dev/mmc*
    /dev/mmcblk0    /dev/mmcblk0p2  /dev/mmcblk1boot0  /dev/mmcblk1p1
    /dev/mmcblk0p1  /dev/mmcblk1    /dev/mmcblk1boot1  /dev/mmcblk1p2
    root@beaglebone:~/src# dd if=ubuntu-core-16-beaglebone.img of=/dev/mmcblk0
    1330132+0 records in
    1330132+0 records out
    681027584 bytes (681 MB) copied, 330.053 s, 2.1 MB/s
    root@beaglebone:~/src# mkdir boot
    root@beaglebone:~/src# mount  /dev/mmcblk0p1 boot
    root@beaglebone:~/src# ls boot
    linux-generic-bbb_6.snap  MLO  uboot.env  u-boot.img
    root@beaglebone:~/src#
    Note that mounting /dev/mmcblk0p2 seemed not to work?
  3. Reboot
    1. Shutdown with shutdown -h now
    2. Turn off the power
    3. Plug in a Ethernet cable, keyboard and monitor (mouse seems to be optional)
    4. Insert the sd card
    5. Hold down the boot button (see https://github.com/linneman/planck/wiki/How-to-boot-the-BeagleBone-black-from-an-SD-Card)
    6. Turn on the power
      1. It is possible to get an ssh prompt, but the password is unknown. The ssh host key changed and I had to edit ~/.ssh/known_hosts and remove the duplicate key
    7. Configure the machine by updating the Ethernet information if necessary, then enter the email address of your Ubuntu Core account and password.
    8. Your public key will be downloaded.
    9. https://wiki.ubuntu.com/SecurityTeam/PublicationNotes#Generating_beaglebone_black_images_.2816.29 says: "Note 5: need to connect a keyboard and monitor for console-conf. It downloads your ssh key from LP for the email address you provide"
    10. Use ssh to connect. The username is a short username, not the email address used by Ubuntu Core. The console should tell you the user name and IP address.

BBB Resources

To create a microsd card with Ubuntu Core on it, I started following these steps, but gave up because we have a .img file which is used to overwrite the entire sd card. We are not creating individual partitions

NUC

NUC Access

For the Nuc, I installed core as a vm on swarmnuc1017.eecs.berkeley.edu

  1. Ask Christopher for an account on swarmnuc1017 and on the vm
  2. Use ssh username@swarmuc1017.eecs.berkeley.edu to connect to swarmnuc1017
  3. While logged on to swarmnuc1017, use ssh username@192.168.122.250 to connect to the vm

NUC Setup

For the Nuc, I installed core as a vm on swarmnuc1017.eecs.berkeley.edu

  1. Start with https://developer.ubuntu.com/en/snappy/start/, which prompts you to install qemu-kvm, download an Ubuntu Core Image and set up an account.
    1. I uploaded the ~root/.ssh/id_rsa.pub key as one of the keys so that ssh would work below
  2. When I tried to run the kvm command while logged in via ssh, I received an error:
    root@swarmnuc1017:~/src# kvm -smp 2 -m 1500 -netdev user,id=mynet0,hostfwd=tcp::8022-:22,hostfwd=tcp::8090-:80 -device virtio-net-pci,netdev=mynet0 -drive file=ubuntu-core-16-amd64.img,format=raw
    Could not initialize SDL(No available video device) - exiting
    My workaround was to vaguely follow http://opennodecloud.com/opennode-os/2013/01/01/howto-kvm-manager.html
    1. apt-get install virt-manager
    2. Add the public key of my account on my mac to the end of ~root/.ssh/authorized_keys
    3. Used ssh -Y root@swarmnuc1017 to connect. The -Y is compressed X11
  3. Started up virt-manager
  4. Created a new VM that uses the Ubuntu Core .img file that was downloaded above.
  5. To log in, from swarmnu1017, use ssh cxbrooks@192.168.122.250

Snap on the BBB

Serial Change in process

This seems stuck:

cxbrooks@localhost:~$ snap changes
ID   Status  Spawn                 Ready                 Summary
2    Done    2016-12-18T18:45:08Z  2017-01-13T23:57:10Z  Initialize device
3    Done    2017-01-13T23:40:26Z  2017-01-13T23:48:28Z  Refresh all snaps in the system
6    Done    2017-01-13T23:48:07Z  2017-01-13T23:48:12Z  Update kernel and core snap revisions
4    Done    2017-01-13T23:49:09Z  2017-01-13T23:49:15Z  Update kernel and core snap revisions
5    Doing   2017-01-13T23:57:10Z  -                     Initialize device

cxbrooks@localhost:~$ snap watch 5
2017-01-14T02:13:09Z ERROR cannot deliver device serial request: unexpected status 400
[|] Request device serial
cxbrooks@localhost:~$ snap change 5
Status  Spawn                 Ready                 Summary
Done    2017-01-13T23:57:10Z  2017-01-13T23:57:10Z  Generate device key
Doing   2017-01-13T23:57:10Z  -                     Request device serial

......................................................................
Request device serial

2017-01-14T02:07:50Z ERROR cannot deliver device serial request: unexpected status 400
2017-01-14T02:08:54Z ERROR cannot deliver device serial request: unexpected status 400
2017-01-14T02:09:58Z ERROR cannot deliver device serial request: unexpected status 400
2017-01-14T02:11:01Z ERROR cannot deliver device serial request: unexpected status 400
2017-01-14T02:12:05Z ERROR cannot deliver device serial request: unexpected status 400
2017-01-14T02:13:09Z ERROR cannot deliver device serial request: unexpected status 400
2017-01-14T02:14:13Z ERROR cannot deliver device serial request: unexpected status 400
2017-01-14T02:15:17Z ERROR cannot deliver device serial request: unexpected status 400
2017-01-14T02:16:21Z ERROR cannot deliver device serial request: unexpected status 400
2017-01-14T02:17:24Z ERROR cannot deliver device serial request: unexpected status 400

cxbrooks@localhost:~$
 

List and Find

Not much installed or available for this platform

cxbrooks@localhost:~$ snap list
Name               Version     Rev  Developer  Notes
bbb                16.04-1     1    ogra       -
core               16.04.1     716  canonical  -
linux-generic-bbb  4.4.0-59-1  8    ogra       -
cxbrooks@localhost:~$ snap find
Name               Version   Developer   Notes  Summary
docker             1.11.2-9  canonical   -      The docker app deployment mechanism
lxd                2.7       canonical   -      LXD - the container lightervisor
rocketchat-server  0.39.0    rocketchat  -      Group chat server for 100s,  installed in seconds.
cxbrooks@localhost:~$ snap info --verbose bbb
name:      bbb
summary:   "Beagle Bone Black"
publisher: ogra
description: |
  This package is used to setup a Beagle Bone Black

type:          gadget
notes:        
  private:     false
  confinement: strict
  devmode:     false
  jailmode:    false
  trymode:     false
  enabled:     true
  broken:      false
tracking:      
installed:     16.04-1 (1) 266kB
refreshed:     2016-09-18 20:54:02 +0000 UTC
channels:                  
  stable:      16.04-1 (1) 0B -
  candidate:   16.04-1 (1) 0B -
  beta:        16.04-1 (1) 0B -
  edge:        16.04-1 (1) 0B -
cxbrooks@localhost:~$ snap info --verbose core
name:      core
summary:   "snapd runtime environment"
publisher: canonical
description: |
  The core runtime environment for snapd
type:          core
notes:        
  private:     false
  confinement: strict
  devmode:     false
  jailmode:    false
  trymode:     false
  enabled:     true
  broken:      false
tracking:      stable
installed:     16.04.1 (716) 67MB
refreshed:     2016-12-16 04:41:44 +0000 UTC
channels:                    
  stable:      16.04.1 (716) 0B -
  candidate:   16.04.1 (716) 0B -
  beta:        16.04.1 (893) 0B -
  edge:        16.04.1 (893) 0B -
cxbrooks@localhost:~$ snap info --verbose linux-generic-bbb
name:      linux-generic-bbb
summary:   "The generic armhf kernel built for beaglebone"
publisher: ogra
description: |
  The Ubuntu linux-generic kernel package as a snap
type:          kernel
notes:        
  private:     false
  confinement: strict
  devmode:     false
  jailmode:    false
  trymode:     false
  enabled:     true
  broken:      false
tracking:      stable
installed:     4.4.0-59-1 (8) 124MB
refreshed:     2017-01-12 18:53:46 +0000 UTC
channels:                    
  stable:      4.4.0-59-1 (8) 0B -
  candidate:   4.4.0-59-1 (8) 0B -
  beta:        4.4.0-59-1 (8) 0B -
  edge:        4.4.0-59-1 (8) 0B -
cxbrooks@localhost:~$

See Also

Edit - History - Print - Recent Changes - Search
Page last modified on January 14, 2017, at 02:20 AM