Microsoft is enabling the ability to run Linux modules with Azure IoT Edge for Linux on Windows 10 IoT Enterprise.
This includes the ability to deploy pre-built Linux modules available in the Azure Marketplace from Microsoft as well as 3rd party publishers in addition to custom workloads built for a specific scenario. Running Linux modules on Windows just part of the solution.
In addition, Windows processes will be able to smoothly interact with Linux modules running on the same physical device. This will allow a Windows process that may provide UI as well as act as a proxy to data access or specific hardware to be backed by business logic or data inferencing provided by a Linux module.
This blog will allow you to experience Linux modules on Windows using Azure IoT Edge for Linux as demonstrated in the IoT Show: Linux modules on Windows 10 IoT Enterprise, as a developer.
Update: Nov 10, 2020
Additionally, we now have multiple sample code projects available at https://aka.ms/winiotsamples which demonstrates messaging interop between a Windows application and a Linux Edge Module running in a Linux virtual machine.
Keep an eye out for our Azure IoT Edge for Linux on Windows Public Preview coming soon
Additional information will be provided before 2020 end-of-year about an "official" offering to support Linux modules on Windows using a Linux environment provided by Microsoft specifically for running Azure IoT Edge for Linux in a production environment.
The following recipe will walk you through the setup and deployment of Azure IoT Edge for Linux as well as deploy one or more Linux modules from the Azure Marketplace on Windows.
For this exercise, you may use either a physical machine running Windows 10 or a virtual machine running Windows 10. If you choose to use a Windows 10 virtual machine for this exercise you will need to enable nested virtualization before continuing.
Windows Subsystem for Linux is designed to support developer workflows, however in this case we are using it to demonstrate a “Proof of Concept” for IoT workloads in production environments.
Note: Username and password will accept lower case letters [a-z] and numbers [0-9] only.
Now type the following command into PowerShell to confirm that you are ready to go to the next step.
wsl --list --verbose
You should see the following:
WSL 2, which uses a custom init to support integration with multiple Linux distributions, is nearly ready to install Azure IoT Edge for Linux, but first we need to provide a systemd process management environment. Systemd is preinstalled with the Ubuntu 18.04 LTS distribution that you installed previously but it is inactive. The following steps will create a new namespace running systemd then move into that namespace so that we can install Azure IoT Edge and the Moby container engine.
CAUTION: Invoking systemd in WSL 2 is considered an unsupported *HACK* that we are using to demonstrate a this developer scenario. This is NOT to be interpreted as an officially supported scenario and may cause odd behavior with other distributions that you may be using with WSL 2. It is also important to understand that this *HACK* is not persistent. If you reboot Windows, WSL 2 will revert to its default configuration using init.
You will enable systemd using a PowerShell administrator session.
sudo apt-get update -y sudo apt-get install -y daemonize
sudo daemonize /usr/bin/unshare --fork --pid --mount-proc /lib/systemd/systemd --system-unit=basic.target
exec sudo nsenter -t $(pidof systemd) -a su - $LOGNAME
Note: To return to this WSL session running systemd after a reboot or a new login, simply repeat steps 5 and 6 above.
Now that the WSL 2 environment is configured to allow Azure IoT Edge to install, please follow the instructions in each of the following articles to install Azure IoT Edge for Linux and deploy a Linux module from Azure IoT Hub.
IMPORTANT: Make sure that you choose the Ubuntu 18.04 or Ubuntu Server 18.04 path when there are multiple operating system choices presented so that your Azure IoT Edge runtime matches the Linux distribution installed earlier.
Stay tuned for a follow up to this blog in June/July 2020 which will demonstrate how you can build a solution that employs bidirectional communication between a native Windows process and a Linux module as demonstrated in the IoT Show: Linux modules on Windows 10 IoT Enterprise.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.