LXC/LXD Special Notes

Manage LDX (Canonical documentation)

LDX containers (Ubuntu documentation)

Use LDX Profiles to Manage Virtual Machines (YouTube)


Modify the default LXD profile

lxc profile edit default

The command opens the profile in your configured text editor (or nano if none is configured). The default profile cannot be deleted or renamed. It is automatically applied to new instances unless overridden by other profiles.

How to use profiles (ubuntu documentation)


LXD profile "stuff"

Show Default Profile

lxc profile show default

This command specifically targets the "default" profile and displays its configuration details. The output is a YAML representation of the profile's configuration. This includes:

Edit a Profile (default)

lxc profile edit default


network, ports, etc.

From: HERE.

DHCP server from LXD (not a system DHCP server).
If you have some other DHCP server on your host, it may conflict with the one by LXD. So, show us the output of

lxc network list lxc network show lxd0 sudo lsof -i :53 (on the host)


Using Macvlan

Create a macvlan network

lxc network create <network_name> type=macvlan parent=<host_interface>

To create a macvlan network. Replace <network_name> with a name for your network and <host_interface> with the name of your host's network interface (e.g., eth0).

Configure the container to use the macvlan network

Add the macvlan network to the container's configuration using

lxc config device add <container_name> <device_name> nic nictype=macvlan parent=<network_name>

Replace <container_name>, <device_name>, and <network_name> with the appropriate values.

Assign a static IP address to the container

The container will now be able to obtain an IP address from your DHCP server or you can assign it a static IP address using

lxc config device set <container_name> <device_name> ipv4.address=<container_ip>/<subnet_mask>

Verify connectivity

You should now be able to access the container directly using its IP address on the public network.

Routing Considerations