You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The Azure IoT Edge for Linux on Windows (EFLOW) virtual machine is isolated from the Windows host OS and the virtual machine doesn't have access to the host file system. By default, the EFLOW virtual machine has its own file system and has no access to the folders or files on the host computer. The *EFLOW file and folder sharing mechanism* provides a way to share Windows files and folders to the CBL-Mariner Linux EFLOW VM.
18
+
19
+
This article shows you how to enable the folder sharing between the Windows host OS and the EFLOW virtual machine.
20
+
21
+
## Prerequisites
22
+
- Azure IoT Edge for Linux on Windows 1.3.1.30082 update or higher. For more information about EFLOW release notes, see [EFLOW Releases](https://aka.ms/AzEFLOW-Releases).
23
+
- A machine with an x64/x86 processor.
24
+
- Windows 11 Sun Valley 2 (build 22621) or higher. To get Windows SV2 update, you must be part of Windows Insider Program. For more information, see [Getting started with the Windows Insider Program](https://insider.windows.com/en-us/getting-started). After installation, you can verify your build version by running `winver` at the command prompt.
25
+
26
+
>[!NOTE]
27
+
>We plan to include support for Windows 10 21H2 (version 19044) version, Windows Server 2019/2022, and ARM64 processors in the upcoming months.
28
+
29
+
If you don't have an EFLOW device ready, you should create one before continuing with this guide. Follow the steps in [Create and provision an IoT Edge for Linux on Windows device using symmetric keys](how-to-provision-single-device-linux-on-windows-symmetric.md) to install, deploy and provision EFLOW.
30
+
31
+
## How it works?
32
+
33
+
The Azure IoT Edge for Linux on Windows file and folder sharing mechanism is implemented using [virtiofs](https://virtio-fs.gitlab.io/) technology. *Virtiofs* is a shared file system that lets virtual machines access a directory tree on the host OS. Unlike other approaches, it's designed to offer local file system semantics and performance. *Virtiofs* isn't a network file system repurposed for virtualization. It's designed to take advantage of the locality of virtual machines and the hypervisor. It takes advantage of the virtual machine's co-location with the hypervisor to avoid overhead associated with network file systems.
34
+
35
+

36
+
37
+
Only Windows folders can be shared to the EFLOW Linux VM and not the other way. Also, for security reasons, when setting the folder sharing mechanism, the user must provide a _root folder_ and all the shared folders must be under that _root folder_.
38
+
39
+
Before starting with the adding and removing share mechanisms, let's define four concepts:
40
+
41
+
-**Root folder**: Windows folder that is the root path containing subfolders to be shared to the EFLOW VM. The root folder isn't shared to the EFLOW VM. Only the subfolders under the root folder are shared to the EFLOW VM.
42
+
-**Shared folder**: A Windows folder that's under the _root folder_ and is shared with the EFLOW VM. All the content inside this folder is shared with the EFLOW VM.
43
+
-**Mounting point**: Path inside the EFLOW VM where the Windows folder content is placed.
44
+
-**Mounting option**: *Read-only* or *read and write* access. Controls the file access of the mounted folder inside the EFLOW VM.
45
+
46
+
## Add shared folders
47
+
The following steps provide example EFLOW PowerShell commands to share one or more Windows host OS folders with the EFLOW virtual machine.
48
+
49
+
1. Start by creating a new root shared folder. Go to **File Explorer** and choose a location for the *root folder* and create the folder.
50
+
51
+
For example, create a *root folder* under _C:\Shared_ named **EFLOW-Shared**.
1. Create one or more *shared folders* to be shared with the EFLOW virtual machine. Shared folders should be created under the *root folder* from the previous step.
56
+
57
+
For example, create two folders one named **Read-Access** and one named **Read-Write-Access**.
1. Within the _Read-Access_ shared folder, create a sample file that we'll later read inside the EFLOW virtual machine.
62
+
63
+
For example, using a text editor, create a file named _Hello-World.txt_ within the _Read-Access_ folder and save some text in the file.
64
+
65
+
1. Using a text editor, create the shared folder configuration file. This file contains the information about the folders to be shared with the EFLOW VM including the mounting points and the mounting options. For more information about the JSON configuration file, see [PowerShell functions for IoT Edge for Linux on Windows](reference-iot-edge-for-linux-on-windows-functions.md).
66
+
67
+
For example, using the previous scenario, we'll share the two *shared folders* we created under the *root folder*.
68
+
-_Read-Access_ shared folder will be mounted in the EFLOW virtual machine under the path _/tmp/host-read-access_ with *read-only* access.
69
+
-_Read-Write-Access_ shared folder will be mounted in the EFLOW virtual machine under the path _/tmp/host-read-write-access_ with *read and write* access.
70
+
71
+
Create the JSON configuration file named **sharedFolders.json** within the *root folder**EFLOW-Shared* with the following contents:
1. Once the cmdlet finished, the EFLOW virtual machine should have access to the shared folders. Connect to the EFLOW virtual machine and check the folders are correctly shared.
102
+
```powershell
103
+
Connect-EflowVm
104
+
```
105
+
106
+
1. Go to the _Read-Access_ shared folder (mounted under _/tmp/host-read-access_) and check the content of the _Hello-World.txt_ file.
107
+
108
+
>[!NOTE]
109
+
>By default, all shared folders are shared under *root* ownership. To access the folder, you should log in as root using `sudo su` or change the folder ownership to *iotedge-user* using `chown` command.
110
+
111
+
```bash
112
+
sudo su
113
+
cd /tmp/host-read-access
114
+
cat Hello-World.txt
115
+
```
116
+
If everything was successful, you should be able to see the contents of the _Hello-World.txt_ file within the EFLOW virtual machine. Verify write access by creating a file inside the _/tmp/host-read-write-access_ and then checking the contents of the new created file inside the _Read-Write-Access_ Windows host folder.
117
+
118
+
## Check shared folders
119
+
The following steps provide example EFLOW PowerShell commands to check the Windows shared folders and options (access permissions and mounting point) with the EFLOW virtual machine.
120
+
121
+
1. Open an elevated PowerShell session by starting with **Run as Administrator**.
122
+
123
+
1. List the information of the Windows shared folders under the *root folder*.
124
+
For example, using the scenario in the previous section, we can list the information of both _Read-Access_ and _Read-Write-Access_ shared folders.
For more information about the `Get-EflowVmSharedFolder` cmdlet, see [PowerShell functions for IoT Edge for Linux on Windows](reference-iot-edge-for-linux-on-windows-functions.md).
130
+
131
+
132
+
## Remove shared folders
133
+
The following steps provide example EFLOW PowerShell commands to stop sharing a Windows shared folder with the EFLOW virtual machine.
134
+
135
+
1. Open an elevated PowerShell session by starting with **Run as Administrator**.
136
+
137
+
1. Stop sharing the folder named _Read-Access_ under the **Root folder** with the EFLOW virtual machine.
For more information about the `Remove-EflowVmSharedFolder` cmdlet, see [PowerShell functions for IoT Edge for Linux on Windows](reference-iot-edge-for-linux-on-windows-functions.md).
143
+
144
+
## Next steps
145
+
Follow the steps in [Common issues and resolutions for Azure IoT Edge for Linux on Windows](troubleshoot-iot-edge-for-linux-on-windows-common-errors.md) to troubleshoot any issues encountered when setting up IoT Edge for Linux on Windows.
Copy file name to clipboardExpand all lines: articles/iot-edge/reference-iot-edge-for-linux-on-windows-functions.md
+98-3Lines changed: 98 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,7 +4,7 @@ description: Reference information for Azure IoT Edge for Linux on Windows Power
4
4
author: PatAltimore
5
5
6
6
ms.author: fcabrera
7
-
ms.date: 07/05/2022
7
+
ms.date: 07/28/2022
8
8
ms.topic: reference
9
9
ms.service: iot-edge
10
10
services: iot-edge
@@ -22,13 +22,38 @@ The commands described in this article are from the `AzureEFLOW.psm1` file, whic
22
22
23
23
If you don't have the **AzureEflow** folder in your PowerShell directory, use the following steps to download and install Azure IoT Edge for Linux on Windows:
24
24
25
+
<!-- 1.1 -->
26
+
:::moniker range="iotedge-2018-06"
25
27
1. In an elevated PowerShell session, run each of the following commands to download IoT Edge for Linux on Windows.
1. Install IoT Edge for Linux on Windows on your device.
34
59
@@ -38,7 +63,7 @@ If you don't have the **AzureEflow** folder in your PowerShell directory, use th
38
63
39
64
You can specify custom installation and VHDX directories by adding `INSTALLDIR="<FULLY_QUALIFIED_PATH>"` and `VHDXDIR="<FULLY_QUALIFIED_PATH>"` parameters to the install command.
40
65
41
-
1. Set the execution policy on the target device to `AllSigned` if it is not already.
66
+
1. Set the execution policy on the target device to at least `AllSigned`.
For more information, use the command `Get-Help Add-EflowVmSharedFolder -full`.
142
+
143
+
:::moniker-end
144
+
<!-- end iotedge-2020-11 -->
145
+
86
146
## Connect-EflowVm
87
147
88
148
The **Connect-EflowVm** command connects to the virtual machine using SSH. The only account allowed to SSH to the virtual machine is the user that created it.
@@ -140,7 +200,7 @@ The **Deploy-Eflow** command is the main deployment method. The deployment comma
140
200
| memoryInMB | Integer **even** value between 1024 and the maximum amount of free memory of the device |Memory allocated for the VM.<br><br>**Default value**: 1024 MB. |
141
201
| vmDiskSize | Between 21 GB and 2 TB | Maximum logical disk size of the dynamically expanding virtual hard disk.<br><br>**Default value**: 29 GB. <br><br>**Note**: Either _vmDiskSize_ or _vmDataSize_ can be used, but not both together. |
142
202
| vmDataSize | Between 2 GB and 2 TB | Maximum data partition size of the resulting hard disk, in GB.<br><br>**Default value**: 10 GB. <br><br>**Note**: Either _vmDiskSize_ or _vmDataSize_ can be used, but not both together. |
143
-
| vmLogSize |**Small** or **Large**|Specificy the log partition size. Small = 1GB, Large = 6GB.<br><br>**Default value**: Small. |
203
+
| vmLogSize |**Small** or **Large**|Specify the log partition size. Small = 1GB, Large = 6GB.<br><br>**Default value**: Small. |
144
204
| vswitchName | Name of the virtual switch | Name of the virtual switch assigned to the EFLOW VM. |
145
205
| vswitchType |**Internal** or **External**| Type of the virtual switch assigned to the EFLOW VM. |
146
206
| ip4Address | IPv4 Address in the range of the DCHP Server Scope | Static Ipv4 address of the EFLOW VM. |
@@ -150,6 +210,7 @@ The **Deploy-Eflow** command is the main deployment method. The deployment comma
150
210
| gpuPassthroughType |**DirectDeviceAssignment**, **ParaVirtualization**, or none (CPU only) | GPU Passthrough type |
151
211
| gpuCount | Integer value between 1 and the number of the device's GPU cores | Number of GPU devices for the VM. <br><br>**Note**: If using ParaVirtualization, make sure to set gpuCount = 1 |
152
212
| customSsh | None | Determines whether user wants to use their custom OpenSSH.Client installation. If present, ssh.exe must be available to the EFLOW PSM |
213
+
| sharedFoldersJsonPath | String | Path to the **Shared Folders** JSON configuration file. |
153
214
:::moniker-end
154
215
<!-- end iotedge-2020-11 -->
155
216
@@ -249,6 +310,26 @@ The **Get-EflowVmName** command returns the virtual machine's current hostname.
249
310
250
311
For more information, use the command `Get-Help Get-EflowVmName -full`.
251
312
313
+
<!-- iotedge-2020-11 -->
314
+
:::moniker range=">=iotedge-2020-11"
315
+
## Get-EflowVmSharedFolder
316
+
317
+
The **Get-EflowVmSharedFolder** command returns the information about one or more Windows host OS folders shared with the EFLOW virtual machine.
318
+
319
+
| Parameter | Accepted values | Comments |
320
+
| --------- | --------------- | -------- |
321
+
| sharedfolderRoot | String | Path to the Windows host OS shared root folder.|
322
+
| hostFolderPath | String or List | Relative path/paths (to the root folder) to the Windows host OS shared folder/s.|
323
+
324
+
It returns a list of objects that contains three properties:
325
+
-**hostFolderPath**: Relative path (to the parent root folder) of the folder shared with the EFLOW VM.
326
+
-**readOnly**: Defines if the shared folder is writeable or read-only from the EFLOW virtual machine - Values: **false** or **true**.
327
+
-**targetFolderOnGuest**: Folder path inside the EFLOW virtual machine where the Windows folder is mounted.
328
+
329
+
For more information, use the command `Get-Help Get-EflowVmSharedFolder -full`.
330
+
:::moniker-end
331
+
<!-- end iotedge-2020-11 -->
332
+
252
333
## Get-EflowVmTelemetryOption
253
334
254
335
The **Get-EflowVmTelemetryOption** command displays the status of the telemetry (either **Optional** or **Required**) inside the virtual machine.
@@ -316,6 +397,20 @@ The **Remove-EflowVmEndpoint** command removes an existing network endpoint atta
316
397
317
398
For more information, use the command `Get-Help Remove-EflowVmEndpoint -full`.
318
399
400
+
<!-- iotedge-2020-11 -->
401
+
:::moniker range=">=iotedge-2020-11"
402
+
## Remove-EflowVmSharedFolder
403
+
404
+
The **Remove-EflowVmSharedFolder** command stops sharing the Windows host OS folder to the EFLOW virtual machine. This command takes two parameters.
405
+
406
+
| Parameter | Accepted values | Comments |
407
+
| --------- | --------------- | -------- |
408
+
| sharedfolderRoot | String | Path to the Windows host OS shared root folder.|
409
+
| hostFolderPath | String or List | Relative path/paths (to the root folder) to the Windows host OS shared folder/s.|
410
+
411
+
For more information, use the command `Get-Help Remove-EflowVmSharedFolder -full`.
0 commit comments