Skip to content

Contact sales

By filling out this form and clicking submit, you acknowledge our privacy policy.
  • Labs icon Lab
  • A Cloud Guru
Google Cloud Platform icon

Initializing LXD Using a Preseed File

When configuring multiple LXD hosts, either to work alongside a remote or as isolated environments, it saves time to bypass the prompt and instead use a preseed file for LXD configuration. In this lab, we generate our preseed file, then create two identical dev environments using our newly-created file.

Google Cloud Platform icon

Path Info

Clock icon Beginner
Clock icon 15m
Clock icon Apr 03, 2020

Contact sales

By filling out this form and clicking submit, you acknowledge our privacy policy.

Table of Contents

  1. Challenge

    Generate the Preseed File

    1. Configure LXD on the first host:
    lxd init
    Would you like to use LXD clustering? (yes/no) [default=no]:
    Do you want to configure a new storage pool? (yes/no) [default=yes]:
    Name of the new storage pool [default=default]:
    Name of the storage backend to use (btrfs, ceph, dir, lvm, zfs) [default=zfs]:
    Create a new ZFS pool? (yes/no) [default=yes]:
    Would you like to use an existing block device? (yes/no) [default=no]: yes
    Path to the existing block device: /dev/nvme1n1
    Would you like to connect to a MAAS server? (yes/no) [default=no]:
    Would you like to create a new local network bridge? (yes/no) [default=yes]:
    What should the new bridge be called? [default=lxdbr0]:
    What IPv4 address should be used? (CIDR subnet notation, “auto” or “none”) [default=auto]:
    What IPv6 address should be used? (CIDR subnet notation, “auto” or “none”) [default=auto]:
    Would you like LXD to be available over the network? (yes/no) [default=no]: yes
    Address to bind LXD to (not including port) [default=all]:
    Port to bind LXD to [default=8443]:
    Trust password for new clients:
    Would you like stale cached images to be updated automatically? (yes/no) [default=yes]
    Would you like a YAML "lxd init" preseed to be printed? (yes/no) [default=no]: yes
    1. Copy the provided preseed output and save it to a file in the home directory called preseed.yaml:
    vim preseed.yaml
      core.https_address: '[::]:8443'
      core.trust_password: pinehead
    - config:
        ipv4.address: auto
        ipv6.address: auto
      description: ""
      managed: false
      name: lxdbr0
      type: ""
    - config:
        source: /dev/nvme1n1
      description: ""
      name: default
      driver: zfs
    - config: {}
      description: ""
          name: eth0
          nictype: bridged
          parent: lxdbr0
          type: nic
          path: /
          pool: default
          type: disk
      name: default
    cluster: null
  2. Challenge

    Configure the Second Server

    1. Copy over the preseed file:
    scp [email protected]:/home/cloud_user/preseed.yaml preseed.yaml
    1. Configure LXD:
    cat preseed.yaml | lxd init --preseed
  3. Challenge

    Configure the Third Server

    Repeat the steps from the second server, or try with a single command:

    scp [email protected]:/home/cloud_user/preseed.yaml preseed.yaml | cat preseed.yaml | lxd init --preseed

The Cloud Content team comprises subject matter experts hyper focused on services offered by the leading cloud vendors (AWS, GCP, and Azure), as well as cloud-related technologies such as Linux and DevOps. The team is thrilled to share their knowledge to help you build modern tech solutions from the ground up, secure and optimize your environments, and so much more!

What's a lab?

Hands-on Labs are real environments created by industry experts to help you learn. These environments help you gain knowledge and experience, practice without compromising your system, test without risk, destroy without fear, and let you learn from your mistakes. Hands-on Labs: practice your skills before delivering in the real world.

Provided environment for hands-on practice

We will provide the credentials and environment necessary for you to practice right within your browser.

Guided walkthrough

Follow along with the author’s guided walkthrough and build something new in your provided environment!

Did you know?

On average, you retain 75% more of your learning if you get time for practice.

Start learning by doing today

View Plans