How to mirror images locally

Errors or typos? Topics missing? Hard to read? Let us know!

Struggling with a slow or unreliable internet connection? Use MAAS with SimpleStreams to have images ready on-demand. You can choose between two image streams—‘candidate’ and ‘stable’—both loaded with Ubuntu, CentOS images, bootloaders, and release alerts.

Install SimpleStreams

Start by installing SimpleStreams:

sudo apt install simplestreams

Define helper variables

Define these variables for cleaner CLI commands:

KEYRING_FILE=/usr/share/keyrings/ubuntu-cloudimage-keyring.gpg
IMAGE_SRC=https://images.maas.io/ephemeral-v3/stable
IMAGE_DIR=/var/www/html/maas/images/ephemeral-v3/stable

Mirror your kernels

Mirror your kernels with these commands:

sudo sstream-mirror --keyring=$KEYRING_FILE $IMAGE_SRC $IMAGE_DIR 'arch=amd64' 'release~(bionic|focal)' --max=1 --progress
sudo sstream-mirror --keyring=$KEYRING_FILE $IMAGE_SRC $IMAGE_DIR 'os~(grub*|pxelinux)' --max=1 --progress

Use --dry-run to preview your selection. Remove it to begin the download.

MAAS saves images to the directory defined by ‘IMAGE_DIR’. The new boot source URL will be http://<myserver>/maas/images/ephemeral-v3/stable/.

You should verify image availability at the URL above. Regularly update your mirror with cron to fetch the latest images.


Last updated 4 days ago.