Your submission was sent successfully! Close

Thank you for signing up for our newsletter!
In these regular emails you will find the latest updates from Canonical and upcoming events where you can meet our team.Close

Thank you for contacting our team. We will be in touch shortly.Close

  1. Blog
  2. Article

Scott Moser
on 10 December 2014

Snappy Ubuntu Core and uvtool


Earlier this week, Ubuntu announced the Snappy Ubuntu Core . As part of the announcement, a set of qemu based instructions were included for checking out a snappy image on your local system.  In addition to that method, we’ve been working on updates to bring support for the transactional images to uvtool. Have you used uvtool before?  I like it, and tend to use for day to day kvm images as it’s pretty simple. So let’s get to it.

Setting up a local Snappy Ubuntu Core environment with uvtool

As I’ve already mentioned Ubuntu has a very simple set of tools for creating virtual machines using cloud images, called ‘uvtool‘.  Uvtool offers a easy way to bring up images on your system in a kvm environment. Before we use uvtool to get snappy on your local environment, you’ll need install the special version that has snappy supported added to it:

$ sudo apt-add-repository ppa:snappy-dev/tools
$ sudo apt-get update
$ sudo apt-get install uvtool
$ newgrp libvirtd

You only need to do ‘newgrp libvirtd‘ during the initial setup, and only if you were not already in the libvirtd group which you can check by running the ‘groups’ command. A reboot or logout would have the same effect.

uvtool uses ssh key authorization so that you can connect to your instances without being prompted for a password. If you do not have a ssh key in ‘~/.ssh/id_rsa.pub‘, you can create one now with:

$ ssh-keygen

We’re ready to roll.  Let’s download the images:

$ uvt-simplestreams-libvirt sync –snappy flavor=core release=devel

This will download a pre-made cloud image of the latest Snappy Core image from http://cloud-images.ubuntu.com/snappy/. It will download about 110M, so be prepared to wait a little bit.

Now let’s start up an instance called ‘snappy-test‘:

$ uvt-kvm create –wait snappy-test flavor=core

This will do the magic of setting up a libvirt domain, starting it and waiting for it to boot (via the –wait flag).  Time to ssh into it:

$ uvt-kvm ssh snappy-test

You now have a Snappy image which you’re sshd into.

If you want to manually ssh, or test that your snappy install of xkcd-webserver worked, you can get the IP address of the system with:

$ uvt-kvm ip snappy-test
192.168.122.136

When you’re done playing, just destroy the instance with:
$ uvt-kvm destroy snappy-test

Have fun!

Related posts


Canonical
20 March 2024

Canonical’s Ubuntu Core receives Microsoft Azure IoT Edge Tier 1 supported platform status

Canonical announcements Canonical News

London, 20 March 2024. Canonical has announced that Ubuntu Core, its operating system optimised for the Internet of Things (IoT) and edge, has received Microsoft Azure IoT Edge Tier 1 supported platform status from Microsoft.  This collaboration brings computation, storage, and artificial intelligence (AI) capabilities in the cloud closer ...


lizzieepton
5 March 2024

Create an Ubuntu Core image with Landscape Client included

Internet of Things Ubuntu Pro

Canonical recently released the Landscape Client snap which, along with the new snap management features in the Landscape web portal, allows for device management of Ubuntu Core devices. In this blog we will look at how this can be deployed at scale by building a custom Ubuntu Core image that includes the Landscape Client snap ...


lizzieepton
13 February 2024

Simplify IoT device management: How to add Ubuntu Core devices to Landscape

Internet of Things Article

Landscape has been a member of the Canonical product list for almost as long as Canonical has existed. Landscape allows administrators to manage their desktop and server instances from a single centralised portal. With the latest release of Landscape Server (23.10), we’ve introduced the ability to manage snap packages from Landscape – and ...