Skip to content

Instantly share code, notes, and snippets.

@chihchun
Last active August 23, 2016 08:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save chihchun/30fd95f9f906ab1e7731040eddc840ee to your computer and use it in GitHub Desktop.
Save chihchun/30fd95f9f906ab1e7731040eddc840ee to your computer and use it in GitHub Desktop.
How to use LXC/LXD images from Ubuntu SDK for Ubuntu Phone and Snappy
# How to use LXC/LXD images from Ubuntu SDK for Ubuntu Phone and Snappy
% sudo add-apt-repository ppa:ubuntu-sdk-team/tools-development
% sudo apt-get update
% sudo apt install ubuntu-sdk-tools
% lxc remote list
+-------------------+------------------------------------------+---------------+--------+--------+
| NAME | URL | PROTOCOL | PUBLIC | STATIC |
+-------------------+------------------------------------------+---------------+--------+--------+
| images | https://images.linuxcontainers.org | lxd | YES | NO |
+-------------------+------------------------------------------+---------------+--------+--------+
| local (default) | unix:// | lxd | NO | YES |
+-------------------+------------------------------------------+---------------+--------+--------+
| ubuntu | https://cloud-images.ubuntu.com/releases | simplestreams | YES | YES |
+-------------------+------------------------------------------+---------------+--------+--------+
| ubuntu-daily | https://cloud-images.ubuntu.com/daily | simplestreams | YES | YES |
+-------------------+------------------------------------------+---------------+--------+--------+
| ubuntu-sdk-images | https://sdk-images.canonical.com | simplestreams | YES | NO |
+-------------------+------------------------------------------+---------------+--------+--------+
% lxc image list ubuntu-sdk-images:
+--------------------------------------------------+--------------+--------+---------------------------------------------+--------+----------+-------------------------------+
| ALIAS | FINGERPRINT | PUBLIC | DESCRIPTION | ARCH | SIZE | UPLOAD DATE |
+--------------------------------------------------+--------------+--------+---------------------------------------------+--------+----------+-------------------------------+
| ubuntu-sdk-15.04-amd64-amd64-dev (3 more) | b8d7703533ba | yes | ubuntu vivid x86_64 (sdk-amd64) (20160725) | x86_64 | 457.00MB | Jul 25, 2016 at 12:00am (UTC) |
+--------------------------------------------------+--------------+--------+---------------------------------------------+--------+----------+-------------------------------+
| ubuntu-sdk-15.04-amd64-armhf-dev (3 more) | 3de402e733c5 | yes | ubuntu vivid x86_64 (sdk-armhf) (20160725) | x86_64 | 400.62MB | Jul 25, 2016 at 12:00am (UTC) |
+--------------------------------------------------+--------------+--------+---------------------------------------------+--------+----------+-------------------------------+
| ubuntu-sdk-15.04-armhf-armhf-dev/armv7l (1 more) | 9bd7e53223d3 | yes | ubuntu vivid armv7l (sdk-armhf) (20160726) | armv7l | 413.11MB | Jul 26, 2016 at 12:00am (UTC) |
+--------------------------------------------------+--------------+--------+---------------------------------------------+--------+----------+-------------------------------+
| ubuntu-sdk-15.04-i386-armhf-dev/i686 (1 more) | e0eeaf968640 | yes | ubuntu vivid i686 (sdk-armhf) (20160725) | i686 | 410.66MB | Jul 25, 2016 at 12:00am (UTC) |
+--------------------------------------------------+--------------+--------+---------------------------------------------+--------+----------+-------------------------------+
| ubuntu-sdk-15.04-i386-i386-dev/i686 (1 more) | 92d328ad2ec8 | yes | ubuntu vivid i686 (sdk-i386) (20160725) | i686 | 471.60MB | Jul 25, 2016 at 12:00am (UTC) |
+--------------------------------------------------+--------------+--------+---------------------------------------------+--------+----------+-------------------------------+
| ubuntu-sdk-16.04-amd64-amd64-dev (3 more) | 64b882c43bdb | yes | ubuntu xenial x86_64 (sdk-amd64) (20160725) | x86_64 | 378.24MB | Jul 25, 2016 at 12:00am (UTC) |
+--------------------------------------------------+--------------+--------+---------------------------------------------+--------+----------+-------------------------------+
| ubuntu-sdk-16.04-amd64-arm64-dev (3 more) | 55bd7cc53499 | yes | ubuntu xenial x86_64 (sdk-arm64) (20160725) | x86_64 | 393.97MB | Jul 25, 2016 at 12:00am (UTC) |
+--------------------------------------------------+--------------+--------+---------------------------------------------+--------+----------+-------------------------------+
| ubuntu-sdk-16.04-amd64-armhf-dev (3 more) | 111601957ded | yes | ubuntu xenial x86_64 (sdk-armhf) (20160804) | x86_64 | 403.22MB | Aug 4, 2016 at 12:00am (UTC) |
+--------------------------------------------------+--------------+--------+---------------------------------------------+--------+----------+-------------------------------+
| ubuntu-sdk-16.04-i386-arm64-dev/i686 (1 more) | d4db909b28ad | yes | ubuntu xenial i686 (sdk-arm64) (20160725) | i686 | 404.26MB | Jul 25, 2016 at 12:00am (UTC) |
+--------------------------------------------------+--------------+--------+---------------------------------------------+--------+----------+-------------------------------+
% sudo usdk-target create -n snappy-armhf -p 111601957ded4d4eb85e7723df3f0ed03d80789d3a5cb06682d561adcd5b4d5d
% lxc list
+---------------+---------+-------------------+------+------------+-----------+
| NAME | STATE | IPV4 | IPV6 | TYPE | SNAPSHOTS |
+---------------+---------+-------------------+------+------------+-----------+
| snappy-armhf | RUNNING | 10.0.8.104 (eth0) | | PERSISTENT | 0 |
+---------------+---------+-------------------+------+------------+-----------+
# install something in the container
% usdk-target maint snappy-armhf apt install device-tree-compiler
# build a project in any of your home folder.
% usdk-target exec snappy-armhf make
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment