a mkosi build for Ubiquity Controller
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Vincent Batts 4090a65622
initial commit
4 years ago
mkosi.cache initial commit 4 years ago
LICENSE initial commit 4 years ago
Makefile initial commit 4 years ago
README.md initial commit 4 years ago
mkosi.build initial commit 4 years ago
mkosi.default initial commit 4 years ago
mkosi.nspawn initial commit 4 years ago



This is an image/container build for ubiquity UniFi controller


This uses mkosi which is packaged for some distros, or easy-enough to install from source.

git clone git://github.com/vbatts/ubnt-box
cd ./ubnt-box
sudo mkosi


systemd-nspawn -bni $(pwd)/image.raw -M ubnt-box

This boots the container up, but gives you a login prompt with no root passwd set. The container is on private network with a veth to the host. This expects systemd-networkd.service on the host to be configured and running. Also, this may conflict with the firewalld.service, so disable that or tamper at your own will.

To get a shell inside this container, do:

machinectl shell ubnt-box
Connected to machine ubnt-box. Press ^] three times within 1s to exit session.
sh-4.4# curl ifconfig.co/json

From here you can run passwd if you'd like, to set a password for root.

Start on boot

The resulting image.raw and image.nspawn files can be installed and enabled like services on a host.

sudo mv ./image.raw /var/lib/machines/ubnt-box.raw
sudo mkdir -p /etc/systemd/nspawn
sudo mv ./image.nspawn /etc/systemd/nspawn/ubnt-box.raw.nspawn
sudo sudo systemctl start systemd-nspawn@ubnt-box.raw
sudo sudo systemctl status systemd-nspawn@ubnt-box.raw

Likewise you can enable it to start on-boot with:

sudo sudo systemctl enable systemd-nspawn@ubnt-box.raw

(this requires systemd-machined so systemctl enable --now machines.target on the host.)