When you follow the docs of Azure IoT Edge to setup it on an Linux machine there is the point when installing the Azure IoT Edge control scripts require
sudo permissions. I’ll show you a way without that
First of all the
iotedgectl script is Python based and I’ll leverage
virtualenv to keep the scripts in one virtual environment I will work with.
I assume that you have already the latest version of
pip installed, if not just follow these instructions.
Let’s install the virtual python environment tooling.
To use the commands
rmvirtualenv add the following to your bash initialization script.
Source or restart the bash and start using the virtual environment. As the Azure IoT Edge CLI will be used on different projects there is no need to associate the virtual environment with a specific directory. To create the virtual environment type
This will install a new python executable and the basic tools for distribution. Also the environment is now active. You can simple type in
deactivate to leave the virtual environment and to use it again just activate it via
To install now the Azure IoT Edge CLI simply install it using pip while working in the azure-iot-edge environment
You can verify that the script is installed correctly in your virtual environment with the
To setup the edge device you still need two additional parameters in order to be able to run it without
sudo permissions. The edge configuration and home directory has to be a path where your user account has permission to. In my case I just remapped it to
$HOME/.iotedgectl for the configuration and
$HOME/.iotedgehome for the home directory.
The setup command would look like this
Now your device is setup without the need of admin permissions. Everytime you want to activate the enviroment again all you have to do is to execute