Getting Started With Snappy
21 Oct 2015 |
4 min. |
What is Snappy Ubuntu Core?
Snappy Ubuntu Core1 is the Ubuntu version for clouds and devices, featuring transactional updates on a minimal server image.
One of the first noticeable differences from the regular Ubuntu version is that there is no apt-* commands and you cannot install traditional
.deb packages; you manage your applications through the
snappy utility that lets you install and update snap packages.
Snap packages are the base for Ubuntu Core to provide stronger security guarantees (applications run confined using AppArmor), and it should be relatively easy to build (or port) your app and make it available in the Snappy store.
Running Ubuntu Core in Virtual Box
Let’s get our first contact with a running Ubuntu Core!
One quick way to get Ubuntu Core running for a first time and make the first experiments is to download an OVA container and plug it in using VirtualBox (or other capable hypervisor).
At this point you should be able to start your Ubuntu Core setup and try the Snappy tour!
Since we would like to access installed snaps and push our own, it is a good idea to enable network access to our Ubuntu Core machine. I just enabled the
Bridged Adapter as
lxcbr0 in Network settings (you could also set up port forwarding). That will allow you to get WebDM in your browser at <machine-ip>:4200, as well as your other installed packages’ exposed UIs or ssh from your terminal.
Installing tools and examples
To build our snaps we’ll need to install some tools in our host:
After this you should have the snappy utilities in your system. Try for example:
You can also branch the Snappy examples from Launchpad to get a first sight of how a snap package looks like:
More on package format later, when we build our snap from scratch.
Completing the cycle
To get a taste of the full experience, let’s build one of the examples and push it to our running instance.
(use your VirtualBox machine IP address instead of 10.0.3.202, of course).
The signature check is expected to fail because we are manually installing the package and not getting it from the store. Also note that the package is marked as
If you now check, in your Ubuntu Core instance, you should have
hello-world binaries available:
And that’s it, we have our initial development environment setup. Next steps will be:
- Build Transmission from source
- Manually snap packaging Transmission
- Build Transmission for ARM
- Build multi-architecture snap package
- Build Transmission using snapcraft