Skip to content

Instantly share code, notes, and snippets.

@TG9541
Last active February 22, 2024 05:21
Show Gist options
  • Save TG9541/3d5f484a5bc5cd9142c493018d4fa65d to your computer and use it in GitHub Desktop.
Save TG9541/3d5f484a5bc5cd9142c493018d4fa65d to your computer and use it in GitHub Desktop.
Ubuntu Server an an Futro S720 with LXD and Docker - setup notes

LXD on Futro S720, basic installation

The following notes assume a Futro S720 "thin client" with a dual core AMD GX-217GA SOC, 2GiB DDR3 RAM and the standard "2GB" MSATA SDD. There is no way to install Ubuntu 22.04 Server on the 2GB SDD (the attempt to install "Ubuntu Server minimal" resulted in a crash), I connected a 5V SATA power supply cable to pins 1 and 7 of the "2xUSB" header and installed a HDD. The 10 pin 2xUSB header, next to MSATA, has the following pinout: 1/2: 5V, 7/8: Gnd, 9:(key), 10: 3.3V.

What we have is:

  • Ubuntu Server 22.04.3 on a 4GB thumb drive
  • Normal installation on HDD
  • Disk partitioning:
    • 2GB MSATA disk partitioned as
      • /boot (auto size)
      • swap (rest)
    • 500GB 2.5" HDD WD partitioned as:
      • / /dev/sda1 20GB
      • /dev/sda2 rest (unformated partition) for ZFS pool default in lxc init
  • USB WLAN dongle for WAN Network wlx4ce676b72edd (Sony)
  • GB Ethernet enp1s0
  • disable cloud-init service with sudo touch /etc/cloud/cloud-init.disabled

Test a bit and then reboot.

The installation was done using a 4GiB DDR3 S0-DIMM but later operation was tested with the original 2GiB RAM module: playing with LXD works (e.g., running a few LXC containers with a single Ubuntu VM). I assume that the installation works fine with the original 2GiB module. Any real workload, e.g., running Canonical MAAS with its Postgres DB, requires at least 4GiB RAM.

LXD configuration

Bridging

lxc init afforts creating a bridge device, by default that's lxdbr0:

root@s720-1:/etc/netplan# networkctl 
IDX LINK            TYPE     OPERATIONAL SETUP      
  1 lo              loopback carrier     unmanaged
  2 enp1s0          ether    no-carrier  configuring
  3 wlx4ce676b72edd wlan     routable    configured 
  4 lxdbr0          bridge   routable    unmanaged
  6 veth904f4461    ether    carrier     unmanaged

Understandig bridging

First of all, it's important to know what a bridge is.

There are potentially outdated (and misleading) explainations of lxd bridging out there (e.g., netplan generate is included in netplan apply, and netplan try might be more appropriate). LXD networking: lxdbr0 explained helps to understand what's really intended.

When settings need to be changed that's likely to happe with the lxc network set <network> <key> <value>. The keys are explained in the LXD network-bridge configuration docs.

Bridging notes

I tried to re-run the bridge configuration in lxc init. Sinc lxdbr0 was already in use I created a new bridge lxdbr1:

root@s720-1:/etc/default# lxc network show lxdbr1
config:
  ipv4.address: 10.55.62.1/24
  ipv4.nat: "true"
  ipv6.address: fd42:3473:56a5:c29c::1/64
  ipv6.nat: "true"
description: ""
name: lxdbr1
type: bridge
used_by:
- /1.0/profiles/default
managed: true
status: Created
locations:
- none

Removing the bridge required "un-using" it first:

root@s720-1:/etc/default# lxc network detach-profile lxdbr1 default
root@s720-1:/etc/default# lxc network delete lxdbr1
Network lxdbr1 deleted

Bridging WIFI limitations (?)

Bridging using WIFI might be limited as the tutorial on using Ubuntu Fan, a kernel based network mapping between internal (LXD) and external (hosts in a network) IP addresses (effectively providing a poor-man's SDN): Easy overlay networking in LXD with the Ubuntu Fan.

Reading up on Netplan

The netplan tutorial uses a LXD provisioned VM with a bridge device on the host level.

The netplan apply docs mention that netplan only works in the "yaml-to-backend" directon regarding virtual devices (e.g., bridges or bonds). It can create bridges but they need to be removed manually using "network backend" commands (e.g., ip link delete dev bond0) or the system/VM needs to be restarted.

@TG9541
Copy link
Author

TG9541 commented Feb 22, 2024

Various incus notes

Create storage pool on device and use it

incus storage create sddpool zfs source=/dev/sda
incus launch images:debian/12 -s sddpool

Mounting a host directory

incus config device add debian32 home disk source=/home/thomas/ path=/mnt/home

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment