Device deployment with chroot

Legacy agent version instructions (qbee-agent version < 2023.XX)

Instructions for the legacy version of qbee-agent can be found here

There are different ways to provision and deploy devices with qbee. One possible option is to use a script that handles the qbee bootstrapping. Another option is to use chroot to setup an image. In this example it is shown how a Raspberry Pi is provisioned on a master device.

Please do not have qbee running on the master device during the provisioning

If there is an active instance of qbee running on the master device the VPN might not work.

These are the steps:

  1. Flash an SD card with your OS. In this case we use a Raspberry Pi OS.
  2. Mount that SD card rootfs from another Raspberry Pi, e.g. sudo mount /dev/sdb2 ./sd_card_mount
  3. Also mount /proc into the rootfs e.g. sudo mount -t proc /proc ./sd_card_mount /proc
  4. Chroot into the SD card rootfs e.g. sudo chroot ./sd_card_mount
  5. Install and bootstrap qbee in the chroot: wget -O /tmp/qbee-agent-installer.sh https://raw.githubusercontent.com/qbee-io/qbee-agent-installers/main/qbee-agent-installer.sh && sudo bash /tmp/qbee-agent-installer.sh --bootstrap-key <bootstrap_key>

    qbee-agent service might not be enabled

    Depending on your deployment setup it might occur that the qbee-agent service cannot be enabled. That means that after restarting your system, the qbee-agent will not be invoked and your device appears as offline. Either create a script that is run on first time with the command

    sudo systemctl enable qbee-agent.service

    or create the symlink manually during the image creation

    ln -s /etc/systemd/system/qbee-agent.service /etc/systemd/system/multi-user.target.wants

    Please note that the paths might vary depending on your OS. Please contact us if you run into any problems.

    1. Exit the chroot, unmount /proc and unmount ./sd_card_mount
    2. Run sync to flush the SD card
    3. Put the new SD card into another Raspberry Pi and turn it on. It should now come back online in the qbee UI.