Skip to content

Remote LXD Management

References

Introduction

To allow for easier management of LXD containers on remote hosts, those remote hosts can be added to the local workstation.

Set-up of Remote Host

$ lxc config set core.https_address "[::]"
$ lxc config set core.trust_password (some-password)

Adding Remote Host

$ lxc remote add (some-name) <IP>
  • This will prompt you to confirm the remote server fingerprint and then ask you for the password.

Usage Examples

  • listing LXD containers on remote host
$ lxc list starbug:

+-----------+---------+----------------------+------+-----------+-----------+
|   NAME    |  STATE  |         IPV4         | IPV6 |   TYPE    | SNAPSHOTS |
+-----------+---------+----------------------+------+-----------+-----------+
| delans    | RUNNING | 192.168.x.xx (eth0)  |      | CONTAINER | 0         |
+-----------+---------+----------------------+------+-----------+-----------+
| lxdmosaic | RUNNING | 192.168.x.xx (eth0)  |      | CONTAINER | 0         |
+-----------+---------+----------------------+------+-----------+-----------+
| nbtwiki   | RUNNING | 192.168.x.xxx (eth0) |      | CONTAINER | 0         |
+-----------+---------+----------------------+------+-----------+-----------+
| pihole1   | RUNNING | 192.168.x.xx (eth0)  |      | CONTAINER | 0         |
+-----------+---------+----------------------+------+-----------+-----------+
  • attaching to container on remote host
$ lxc exec starbug:delans bash

root@delans:~#

Created: 2021-06-10 14:43
Last update: 2021-09-01 02:37