Currently, the design desision is to provide any resources not installed by default on any target machines (containers, apt- and bsd packages) via the live OS. This requires the KVM host, currently a PiKVM v4, to serve these resources via itself.
Pre-provision resource on live OS
server {
listen 80 default_server;
liten [ :: ]:80 default_server;
location /apt/ {
root /srv/apt/;
autoindex on;
}
location /bsd/ {
root /srv/bsd/;
autoindex on;
}
}
Make live OS appear as a virtual eth device
# Assuming the KVM device uses 10.0.0.1
ip addr add 10.0.0.2/24 dev usb0
ip link set usb0 up
The KVM host should now see a new device, e.g. eth0. Access the live system on e.g. http://10.0.0.1/apt
Make KVM device act as an intermediary for target machines
echo 1 > /proc/sys/net/ipv4/ip_forward
# Assume eth0 = uplink to live repo, eth1 = target network
iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
interface=eth1
dhcp-range=192.168.100.50,192.168.100.100,12h
enable-tftp
tftp-root=/srv/tftp
pxe-service=x86PC, "Install Linux", pxelinux
Configure target machines
# This approach is recommended for automation
env REPO_URL="http://10.0.0.1/freebsd/packages-13.3-release/"
pkg -r /mnt -o REPOS_DIR=/tmp/repos install somepackage
deb [trusted=yes] http://10.0.0.1/debian bookworm main
provider_installation {
network_mirror {
url = "http://10.0.0.1/tf-providers"
}
}
Currently, the design desision is to provide any resources not installed by default on any target machines (containers, apt- and bsd packages) via the live OS. This requires the KVM host, currently a PiKVM v4, to serve these resources via itself.
Pre-provision resource on live OS
Make live OS appear as a virtual eth device
config.txtg_etherkernel moduleusb0The KVM host should now see a new device, e.g.
eth0. Access the live system on e.g.http://10.0.0.1/aptMake KVM device act as an intermediary for target machines
# Assume eth0 = uplink to live repo, eth1 = target network iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADEinterface=eth1 dhcp-range=192.168.100.50,192.168.100.100,12h enable-tftp tftp-root=/srv/tftp pxe-service=x86PC, "Install Linux", pxelinuxConfigure target machines
deb [trusted=yes] http://10.0.0.1/debian bookworm main