LXD Desktop CI

Status: Verified

These steps document how to install LXD Desktop CI to generate desktop images using distrobuilder on Ubuntu 18.04 LTS.


Install CI Scripts

Add a new user to execute CI commands with:

sudo useradd --create-home --groups sudo,lxd lxdadm

Install git:

sudo apt install git

Configure git to use your name and email address:

git config --global "Mona Lisa"
git config --global ""

Generate a new SSH key and add it to your GitHub account:

ssh-keygen -t rsa -b 4096 -C ""
cat ~/.ssh/
git clone
sudo chown -R lxdadm:lxdadm lxc-ci
sudo mv lxc-ci /
cd /lxc-ci

Make sure to add your user to the lxdadm group, to avoid permission issues:

# make sure you logout and login after
# adding the lxdadm group to your user:
sudo usermod -a -G lxdadm <username>

Make sure the correct branch is checked out:

cd /lxc-ci
git checkout desktop-lxc

Configure weekly execution of the update-image job using cron.weekly:

sudo ln -s /lxc-ci/desktop-lxc/update-images /etc/cron.weekly/desktop-lxc-update-images

Next, configure the SSH connection to be used to upload the images:

On the client machine which should upload the LXD image, make sure we can connect to the LXD Image Server via ssh. For this to work, we first need to create a new SSH key and upload it to our LXD Image Server:

sudo su --login lxdadm
ssh-copy-id lxdadm@lxd-image-server

# test the connection from the client machine:
ssh lxdadm@lxd-image-server

# logout as lxdadm if everything is fine:

Install distrobuilder

Install the required dependencies:

sudo apt install golang-go debootstrap rsync gpg squashfs-tools make git
sudo su --login lxdadm
go get -d -v
cd ~/go/src/

Allow sudo without password for lxdadm:

sudo visudo
+ lxdadm    ALL=(ALL) NOPASSWD:ALL

Test Everything

Make sure everything is set up correctly by manually executing the cron job (this runs quite long):

sudo /lxc-ci/desktop-lxc/update-image ubuntu focal amd64 xfce &
sudo tail -f /var/log/lxc-ci/ubuntu-focal-amd64-xfce.out