five minutes to study
In this text
Applies to: IoT Edge 1.1 IoT Edge 1.2 IoT Edge 1.three IoT Edge 1.four
The Azure IoT Edge for Linux on Windows (EFLOW) virtual gadget is remoted from gentoobr.org the Windows host OS and the virtual device would not have get admission to to the host document system. By default, the EFLOW virtual gadget has its very own report device and has no access to the folders or documents on the host pc. The EFLOW report and folder sharing mechanism provides a way to share Windows documents and folders to the CBL-Mariner Linux EFLOW VM.
This article shows you a way to permit the folder sharing between the Windows host OS and the EFLOW digital gadget.PrerequisitesAzure IoT Edge for Linux on Windows 220.127.116.11082 replace or higher. For greater data approximately EFLOW release notes, see EFLOW Releases.A machine with an x64/x86 processor.Windows eleven Sun Valley 2 (build 22621) or higher. To get Windows SV2 update, you must be part of Windows Insider Program. For more facts, see Getting started out with the Windows Insider Program. After installation, you can confirm your build version through walking winver on the command set off.
We plan to include guide for Windows 10 21H2 (model 19044) version, Windows Server 2019/2022, and ARM64 processors in the approaching months.
If you do not have an EFLOW tool equipped, you should create one before persevering with with this guide. Follow the steps in Create and provision an IoT Edge for Linux on Windows tool using symmetric keys to install, install and provision EFLOW.How it really works?
The Azure IoT Edge for Linux on Windows record and folder sharing mechanism is implemented the usage of virtiofs generation. Virtiofs is a shared report machine that shall we digital machines get admission to a listing tree on the host OS. Unlike other methods, it is designed to provide neighborhood record system semantics and performance. Virtiofs is not a community record system repurposed for virtualization. It’s designed to take advantage of the locality of virtual machines and the hypervisor. It takes advantage of the digital device’s co-region with the hypervisor to keep away from overhead associated with community document structures.
Only Windows folders may be shared to the EFLOW Linux VM and no longer the alternative manner. Also, for security motives, while putting the folder sharing mechanism, the user have to provide a root folder and all the shared folders need to be under that root folder.
Before beginning with the adding and eliminating proportion mechanisms, permit’s outline 4 principles:Root folder: Windows folder this is the root route containing subfolders to be shared to the EFLOW VM. The root folder is not shared to the EFLOW VM. Only the subfolders below the foundation folder are shared to the EFLOW VM.Shared folder: A Windows folder this is beneath the basis folder and is shared with the EFLOW VM. All the content material inside this folder is shared with the EFLOW VM.Mounting factor: Path within the EFLOW VM where the Windows folder content material is placed.Mounting option: Read-handiest or examine and write access. Controls the report access of the set up folder in the EFLOW VM.
The following steps provide example EFLOW PowerShell instructions to percentage one or greater Windows host OS folders with the EFLOW digital gadget.
Start by using growing a brand new root shared folder. Go to File Explorer and pick a area for the root folder and create the folder.
For example, create a root folder underneath C:\Shared named EFLOW-Shared.
Create one or extra shared folders to be shared with the EFLOW digital device. Shared folders need to be created below the root folder from the preceding step.
For example, createfolders one named Read-Access and one named Read-Write-Access.
Within the Read-Access shared folder, create a pattern record that we will later read inside the EFLOW digital system.
For example, the use of a text editor, create a record named Hello-World.txt inside the Read-Access folder and store a few textual content inside the document.
Using a textual content editor, create the shared folder configuration record. This document contains the information approximately the folders to be shared with the EFLOW VM including the mounting points and the mounting alternatives. For extra facts approximately the JSON configuration record, see PowerShell capabilities for IoT Edge for Linux on Windows.
For example, the usage of the preceding situation, we’ll percentage the two shared folders we created below the foundation folder.Read-Access shared folder might be mounted in the EFLOW digital machine underneath the direction /tmp/host-study-get entry to with study-most effective get right of entry to.Read-Write-Access shared folder will be set up inside the EFLOW virtual machine underneath the route /tmp/host-examine-write-get right of entry to with examine and write access.
Create the JSON configuration report named sharedFolders.json in the root folder EFLOW-Shared with the subsequent contents:[“sharedFolderRoot”: “C:\\Shared\\EFLOW-Shared”,”sharedFolders”: [“hostFolderPath”: “Read-Access”,”readOnly”: actual,”targetFolderOnGuest”: “/tmp/host-read-get entry to”,”hostFolderPath”: “Read-Write-Access”,”readOnly”: false,”targetFolderOnGuest”: “/tmp/host-read-write-get right of entry to”]]
Open an multiplied PowerShell consultation with the aid of starting with Run as Administrator.
Create the shared folder assignation the use of the configuration document (sharedFolders.json) previously created.Add-EflowVmSharedFolder -sharedFoldersJsonPath “C:\Shared\EFLOW-Shared\sharedFolders.json”
Once the cmdlet completed, the EFLOW digital machine have to have get entry to to the shared folders. Connect to the EFLOW virtual machine and take a look at the folders are efficiently shared.Connect-EflowVm
Go to the Read-Access shared folder (installed under /tmp/host-read-get entry to) and check the content of the Hello-World.txt report.
By default, all shared folders are shared below root possession. To get entry to the folder, you must log in as root using sudo su or exchange the folder ownership to iotedge-user using chown command.sudo sucd /tmp/host-study-accesscat Hello-World.txt
If everything became a hit, you have to be able to see the contents of the Hello-World.txt record within the EFLOW digital gadget. Verify write get admission to by growing a document in the /tmp/host-read-write-get right of entry to and then checking the contents of the brand new created record inside the Read-Write-Access Windows host folder.
The following steps provide example EFLOW PowerShell instructions to test the Windows shared folders and alternatives (get admission to permissions and mounting factor) with the EFLOW virtual system.
Open an multiplied PowerShell consultation by beginning with Run as Administrator.
List the information of the Windows shared folders under the root folder.For example, the usage of the situation inside the previous segment, we are able to list the statistics of both Read-Access and Read-Write-Access shared folders.Get-EflowVmSharedFolder -sharedfolderRoot “C:\Shared\EFLOW-Shared” -hostFolderPath @(“Read-Access”, “Read-Write-Access”)
For greater records about the Get-EflowVmSharedFolder cmdlet, see PowerShell features for IoT Edge for Linux on Windows.
The following steps offer instance EFLOW PowerShell instructions to prevent sharing a Windows shared folder with the EFLOW virtual gadget.
Open an expanded PowerShell consultation via beginning with Run as Administrator.
Stop sharing the folder named Read-Access under the Root folder with the EFLOW digital device.Remove-EflowVmSharedFolder -sharedfolderRoot “C:\Shared\EFLOW-Shared” -hostFolderPath “Read-Access”
For greater records approximately the Remove-EflowVmSharedFolder cmdlet, see PowerShell features for IoT Edge for Linux on Windows.Next steps
Follow the stairs in Common troubles and resolutions for Azure IoT Edge for Linux on Windows to troubleshoot any troubles encountered while putting in place IoT Edge for Linux on Windows.