Device deployment with chroot

There are different ways to provision and deploy devices with qbee. One possible option is to use a script that handles the qbee bootstraping. 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 Rasberry 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 qbee in the chroot: wget https://cdn.qbee.io/software/qbee-agent/qbee-agent_1.2.1_armhf.deb && sudo dpkg -i qbee-agent_1.2.1_armhf.deb
  6. Run the qbee bootstrap: /opt/qbee/bin/qbee-bootstrap -k <bootstrap_key> and wait for it to finish
  7. Exit the chroot, unmount /proc and unmount ./sd_card_mount
  8. Run sync to flush the SD card
  9. Put the new SD card into another Raspberry Pi and turn it on. It should now come back online in the qbee UI.
  10. Please note that the VPN (remote access) needs two agent runs to come online (ca. 10 minutes). This will be accelerated eventually.