How to install and configure Azure IoT Edge on QNAP NAS

This tutorial provides step-by-step guidance to install Azure IoT edge runtime on QNAP NAS.

  • For x86(Intel/AMD) models – using Linux Station
  • For ARM models – using Container Station(LXC)

Steps for x86 models – using Linux Station

  1. Please go to App Center and install Linux Station. Intall and configure Ubuntu 16.04 in Linux Station.
  2. Connect to NAS via SSH
  3. Access to Ubuntu 16.04 Console by the following command:
    lxc-console -P `/sbin/getcfg ubuntu-hd Install_Path -f /etc/config/qpkg.conf`/lxc -n ubuntu_1604 -t 0
  4. log in to NAS with admin account/password
  5. Install Docker-ce 17.09.1 with the following commands :
    sudo apt-get update
    sudo apt-get install apt-transport-https ca-certificates curl software-properties-common nano -y
    curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
    sudo add-apt-repository "deb [arch=amd64]  https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
    sudo apt-get update
    sudo apt-get install docker-ce=17.09.1~ce-0~ubuntu -y
  6. Refer to Microsoft documents Quickstart: Deploy your first IoT Edge module to a Linux x64 device for Azure IoT Edge runtime installation. (Please skip Install a container runtime section,since Docker envirnoment has been installed in previous step )

Steps for ARM models – using Container Station(LXC)

  1. Please go to App Center and install Container Station.
  2. Launch Container Station,then click Create tab. Scroll to bottom of the page, select and Install Ubuntu 16.04.
  3. Pleae click Create after completing container settiong.
  4. Container installation is in progress
  5. Connect to NAS via SSH
  6. Access to Ubuntu 16.04 Console by the following command: (please replace with the name which you use to create container in previous steps) :
    lxc-console --name=ubuntu-xenial-armhf-1
  7. Install Docker-ce 17.09.1 with the following commands. (default account/password are ubuntu/ubuntu)
    sudo apt-get update
    sudo apt-get install apt-transport-https ca-certificates curl software-properties-common nano -y
    curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
    sudo add-apt-repository "deb [arch=armhf]  https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
    sudo apt-get update
    sudo apt-get install docker-ce=17.09.1~ce-0~ubuntu -y
  8. Link libssl.so.1.0.0 and libcrypto.so.1.0.0
    cd /lib/arm-linux-gnueabihf/
    sudo ln -s libssl.so.1.0.0 libssl.so.1.0.2
    sudo ln -s libcrypto.so.1.0.0 libcrypto.so.1.0.2
  9. Refer to Microsoft documents Quickstart: Deploy your first IoT Edge module to a Linux x64 device for Azure IoT Edge runtime installation. (Please skip Install a container runtime section,since Docker envirnoment has been installed in previous step )

Other installation options

  1. If you want to install Azure IoT Edge with Container Station(LXC) on x86 models,Please edit file /usr/local/container-station/lxc/share/lxc/config/common.conf on NAS Host. Please comment out the line #lxc.mount.auto = cgroup:mixed proc:mixed sys:mixed.
  2. If you want to use moby container runtime recommended by Microsoft document,please edit the file /etc/rc.local in Container (instead of NAS Host). Please append the following commands to the file.
    mount -o remount,rw /sys/fs/cgroup/
    mkdir /sys/fs/cgroup/cpu
    mkdir /sys/fs/cgroup/cpuacct
    mount -t cgroup cgroup -o cpu /sys/fs/cgroup/cpu
    mount -t cgroup cgroup -o cpuacct /sys/fs/cgroup/cpuacct

Related posts

Leave a Reply