First steps with Ubuntu Core

The Ubuntu Core environment is much like a vanilla Ubuntu server environment managed remotely via SSH.

To connect to Ubuntu Core, use your Ubuntu SSO username and the Ubuntu Core device IP address, as provided by Ubuntu Core if it’s connected to a display:

$ ssh <sso-username>@<device-ip-address>

You may need to specify the location of the private SSH key linked to your Ubuntu SSO registered public key:

$ ssh -i <path-to-private-key> <sso-username>@<device-ip-address>

The main difference between a classic Ubuntu installation and Ubuntu Core is that Ubuntu Core’s system configuration, package management, and update control is governed entirely by snapd, the snap daemon.

Snap features are explained comprehensively in the Snap documentation, but we’ll cover some basic operations below:

You can list which snaps are installed on your Ubuntu Core system with snap list:

$ snap list
Name       Version        Rev   Tracking     Publisher   Notes
core20     20             768   latest/beta  canonical✓  base
pc         20-0.4         108   20/beta      canonical✓  gadget
pc-kernel  5.4.0-47.51.1  598   20/beta      canonical✓  kernel
snapd      2.46.1         9279  latest/beta  canonical✓  snapd

The above shows the standard (and initial) set of snaps in a default Ubuntu Core 20 installation. For more details on what these do, see Snaps in Ubuntu Core.

As Ubuntu Core is a minimal installation, one of the first things you might want to install is a text editor. You can search for snaps using snap find, or consult the Snap Store. Nano-strict is a good choice because it’s strictly confined, as required for Ubuntu Core, and useful:

$ snap install nano-strict

By default, Ubuntu Core defaults to disabling access to most resources, including writing files to your home directory.

Permissions in snap and Ubuntu Core are handled by interfaces. You can see which interfaces nano-strict needs with the snap connections command:

$ snap connections nano-strict

Interface        Plug                         Slot  Notes
home             nano-strict:home             -     -
removable-media  nano-strict:removable-media  -     -

Connecting the home interface between Ubuntu Core and nano-strict will allow you to save files to your home directory. This is accomplished with the snap connect command:

$ snap connect nano-strict:home :home

after which you can verify that you are connected to your home directory:

$ snap connections nano-strict
Interface        Plug                         Slot   Notes
home             nano-strict:home             :home  manual
removable-media  nano-strict:removable-media  -      -

After running the above command, you will be able use the nano-strict command to create and edit text files in your home directory!

The :home syntax denotes the home slot on Ubuntu Core. For more information on how to work with interfaces, see Interface management in the snap documentation.

To remove a snap from your system, along with its internal user, system and configuration data, use the snap remove command (add the --purge option to avoid making a snapshot of the snap’s data):

$ snap remove [--purge] nano-strict
nano-strict removed

For more information on how to work with snaps, including how to control daemons/servers, how to make data snapshots and how to install specific revisions, see the Snap Documentation .


Installing nano-strict already has the :home interface connection, but I don’t want to tweak that until someone else verifies that the user does not have to set that connection manually.

I’ve just tested this, and the :home connection is not set by default.

:home is explicitly never connected by default on UC …

1 Like

Thanks for this. I’ll make a more prominent note for this on the home interface docs page.

Since there is a How-to page on testing with QEMU, perhaps a short explanation (or link) on how to connect to a QEMU session; AIUI, you’d just ssh to a given port at localhost.

Update page to UC22?

When I install nano-strict, it appears that the home interface is now auto-connect. Please confirm and update page.

Hi All,

I am new to this discourse and thanks for including me in the community.
I am trying to install ubuntu core on a plain vm using MAAS and it is not simple as it depends on various factors which are not documented. Can you share hands-on documentation of ubuntu core on a qemu vm for reference ?