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 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 qbee in the chroot: wget && sudo dpkg -i qbee-agent_1.2.1_armhf.deb

    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/

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

  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.