Open Source

How to enable the Canonical live-patch service in Ubuntu 16.04

If you've ever wanted live kernel patching on your Ubuntu systems, it is now incredibly simple to enable. Here's how.

ubuntuhero.jpg
Image: Jack Wallen

One of the greatest achievements in Linux over the last few years has been live kernel patching. Nearly every distribution offers their own take on this and now, with the help of Snap, Canonical has finally made it incredibly easy to enable live kernel patching on Ubuntu.

If you've not heard of live kernel patching, the explanation is simple: The ability to modify the running kernel code without having to reboot the system. That's right. Thanks to kernel livepatch your kernel can always be updated without ever having to reboot your system. The main benefit of this system? In a word:

Uptime.

This livepatching system is intended to address high and critical severity Linux kernel security vulnerabilities (as identified by Ubuntu Security Notices and the CVE database). Thanks to an easy to install snap package, you can add live kernel patching to your Ubuntu systems. Let me show you how.

System requirements

Canonical Livepatch Service is available for both the generic and low latency flavors of the 64-bit Intel/AMD kernel on Ubuntu 16.04 LTS (Xenial) servers and desktops. You will also need the latest version of snapd (at least version 2.15).

First things first

Before you do anything with Snap, you must first update your system. If you attempt to enable livepatch prior to updating, it will fail. To take care of this, open up a terminal window and issue the following command:

sudo apt-get upgrade

Next, make sure snapd is updated with the command:

sudo apt-get install snapd

Once your system is fully updated, you're ready to begin.

Installing the snap package

The livepatching system is handled through a snap package. You can install this snap package with a single command:

sudo snap canonical-livepatch

Once the snap is installed, your next step is to retrieve your livepatch token from the Canonical livepatch site. You'll have to log into your Ubuntu One account in order to retrieve this token. The token will be in the form of a 32-character string. You will be required to copy that token into the next command.

Enabling the service

You are ready to enable livepatching on your system. To do this, issue the command below:

sudo canonical-livepatch enable TOKEN

Where TOKEN is your 32-character livepatch token. Once the command completes, you should see that the device has been successfully enabled (Figure A).

Figure A

Figure A

A successful livepatch via snap.

To find the status of your livepatched machine, issue the command sudo canonical-livepatch status. The command will report the status of your system's kernel (Figure B).

Figure B

Figure B

The status of a livepatched system.

You can issue that same command with the —verbose flag to get more information (Figure C).

Figure C

Figure C

The verbose status of a livepatched system.

Many benefits

Besides uptime on your servers, and always having the latest security patches at the ready, livepatching will benefit all of your container hosts (as they will all share the same kernel). Thanks to Canonical and snap, enjoying the amazing benefits of live kernel patching is now incredibly simple.

Also see

About Jack Wallen

Jack Wallen is an award-winning writer for TechRepublic and Linux.com. He’s an avid promoter of open source and the voice of The Android Expert. For more news about Jack Wallen, visit his website jackwallen.com.

Editor's Picks

Free Newsletters, In your Inbox