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
+
The Azure IoT Edge for Linux on Windows (EFLOW) virtual machine is isolated from the Windows host OS, and the virtual machine can't access the host file system. By default, the EFLOW virtual machine has its own file system and can't access folders or files on the host computer. The *EFLOW file and folder sharing mechanism*lets you share Windows files and folders with the CBL-Mariner Linux EFLOW VM.
19
19
20
-
This article shows you how to enable the folder sharing between the Windows host OS and the EFLOW virtual machine.
20
+
This article shows you how to share a folder between the Windows host OS and the EFLOW virtual machine.
21
21
22
22
## Prerequisites
23
23
- Azure IoT Edge for Linux on Windows 1.4.4 LTS update or higher. For more information about EFLOW release notes, see [EFLOW Releases](https://aka.ms/AzEFLOW-Releases).
24
-
- A machine with an x64/x86 processor.
25
-
- Windows 10/11 (21H2) or higher with [November 2022](https://support.microsoft.com/topic/november-15-2022-kb5020030-os-builds-19042-2311-19043-2311-19044-2311-and-19045-2311-preview-237a9048-f853-4e29-a3a2-62efdbea95e2) update applied.
24
+
- A machine with an x64 or x86 processor.
25
+
- Windows 10 or 11 (21H2) or higher with the[November 2022](https://support.microsoft.com/topic/november-15-2022-kb5020030-os-builds-19042-2311-19043-2311-19044-2311-and-19045-2311-preview-237a9048-f853-4e29-a3a2-62efdbea95e2) update applied.
26
26
27
-
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.
27
+
If you don't have an EFLOW device ready, create one before you continue 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.
28
28
29
-
## How it works?
29
+
## How it works
30
30
31
-
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.
31
+
Azure IoT Edge for Linux on Windows uses [virtiofs](https://virtio-fs.gitlab.io/) technology for file and folder sharing. *Virtiofs* is a shared file system that lets virtual machines use a directory tree on the host OS. Unlike other approaches, it's designed for local file system semantics and performance. *Virtiofs* isn't a network file system repurposed for virtualization. It uses the locality of virtual machines and the hypervisorto avoid the overhead of network file systems.
32
32
33
-
:::image type="content" source="media/how-to-share-windows-folder-to-vm/folder-sharing-virtiofs.png" alt-text="Screenshot of a Windows folder shared with the EFLOW virtual machine using Virtio-FS technology.":::
33
+
:::image type="content" source="media/how-to-share-windows-folder-to-vm/folder-sharing-virtiofs.png" alt-text="Screenshot of a Windows folder shared with the EFLOW virtual machine by using Virtio-FS technology.":::
34
34
35
-
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*.
35
+
You can only share Windows folders to the EFLOW Linux VM, not the other way. For security, when you set up folder sharing, you need to provide a *root folder*, and all shared folders must be under that *root folder*.
36
36
37
-
Before starting with the adding and removing share mechanisms, let's define four concepts:
37
+
Before you add or remove shared folders, review these four concepts:
38
38
39
-
-**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.
40
-
-**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.
41
-
-**Mounting point**: Path inside the EFLOW VM where the Windows folder content is placed.
42
-
-**Mounting option**: *Read-only* or *read and write* access. Controls the file access of the mounted folder inside the EFLOW VM.
39
+
-**Root folder**: The Windows folder that is the root path for subfolders you share with the EFLOW VM. The root folder itself isn't shared. Only subfolders under the root folder are shared.
40
+
-**Shared folder**: A Windows folder under the *root folder*that you share with the EFLOW VM. All content in this folder is shared with the EFLOW VM.
41
+
-**Mounting point**: The path inside the EFLOW VM where the Windows folder content appears.
42
+
-**Mounting option**: *Read-only* or *read and write* access. This setting controls file access for the mounted folder inside the EFLOW VM.
43
43
44
44
## Add shared folders
45
-
The following steps provide example EFLOW PowerShell commands to share one or more Windows host OS folders with the EFLOW virtual machine.
45
+
These steps show example EFLOW PowerShell commands to share one or more Windows host OS folders with the EFLOW virtual machine.
46
46
47
47
>[!NOTE]
48
-
>If you're using Windows 10, ensure to reboot your Windows host OS after your fresh MSI installation or update before adding the Windows shared folders to the EFLOW VM.
48
+
>If you're using Windows 10, reboot your Windows host OS after a fresh MSI installation or update before adding the Windows shared folders to the EFLOW VM.
49
49
50
-
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
+
1.Create a new root shared folder. Go to **File Explorer**, choose a location for the *root folder*, and create the folder.
51
51
52
-
For example, create a *root folder*under *C:\Shared*named **EFLOW-Shared**.
52
+
For example, create a *root folder*named *EFLOW-Shared*under *C:\Shared*.
53
53
54
-
:::image type="content" source="media/how-to-share-windows-folder-to-vm/root-folder.png" alt-text="Screenshot of the C:\Shared folder that includes EFLOW-Shared folder.":::
54
+
:::image type="content" source="media/how-to-share-windows-folder-to-vm/root-folder.png" alt-text="Screenshot of the C:\Shared folder that shows the EFLOW-Shared folder.":::
55
55
56
-
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
+
1. Create one or more *shared folders* under the *root folder*to share with the EFLOW virtual machine.
57
57
58
-
For example, create two folders one named **Read-Access** and one named **Read-Write-Access**.
58
+
For example, create two folders: one named **Read-Access** and one named **Read-Write-Access**.
59
59
60
60
:::image type="content" source="media/how-to-share-windows-folder-to-vm/shared-folders.png" alt-text="Screenshot of Windows shared folders Read-Access and Read-Write-Access.":::
61
61
62
62
1. Within the *Read-Access* shared folder, create a sample file that we'll later read inside the EFLOW virtual machine.
63
63
64
-
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
+
For example, use a text editor to create a file named *Hello-World.txt*in the *Read-Access* folder and save some text in the file.
65
65
66
-
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
+
1.Use a text editor to create the shared folder configuration file. This file has information about the folders to share with the EFLOW VM, including the mount points and 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).
67
67
68
-
For example, using the previous scenario, we'll share the two *shared folders*we created under the *root folder*.
69
-
-*Read-Access* shared folder is mounted in the EFLOW virtual machine under the path */tmp/host-read-access* with *read-only* access.
70
-
-*Read-Write-Access* shared folder is mounted in the EFLOW virtual machine under the path */tmp/host-read-write-access* with *read and write* access.
68
+
For example, in this scenario, share the two *shared folders*you created under the *root folder*.
69
+
-The *Read-Access* shared folder is mounted in the EFLOW virtual machine under the path */tmp/host-read-access* with *read-only* access.
70
+
-The *Read-Write-Access* shared folder is mounted in the EFLOW virtual machine under the path */tmp/host-read-write-access* with *read and write* access.
71
71
72
-
Create the JSON configuration file named **sharedFolders.json** within the *root folder**EFLOW-Shared* with the following contents:
72
+
Create a JSON configuration file named *sharedFolders.json* in the *root folder**EFLOW-Shared* with the following contents:
73
73
74
74
```json
75
75
[
@@ -91,30 +91,27 @@ The following steps provide example EFLOW PowerShell commands to share one or mo
91
91
]
92
92
```
93
93
94
-
1. Open an elevated *PowerShell* session by starting with **Run as Administrator**.
94
+
1. Open an elevated *PowerShell* session by selecting **Run as Administrator**.
95
95
96
-
1. Create the shared folder assignation using the configuration file (*sharedFolders.json*) previously created.
96
+
1. Create the shared folder assignment by using the configuration file (*sharedFolders.json*) you created earlier.
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.
103
-
```powershell
104
-
Connect-EflowVm
105
-
```
102
+
1. After the cmdlet finishes, the EFLOW virtual machine can access the shared folders. Connect to the EFLOW virtual machine and check that the folders are shared correctly.
106
103
107
-
1. Go to the *Read-Access* shared folder (mounted under */tmp/host-read-access*) and check the content of the *Hello-World.txt* file.
104
+
1. Go to the *Read-Access* shared folder (mounted under */tmp/host-read-access*) and check the contents of the *Hello-World.txt* file.
108
105
109
106
>[!NOTE]
110
-
>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.
107
+
>By default, all shared folders are owned by *root*. To access the folder, sign in as root using `sudo su` or change the folder ownership to *iotedge-user* using the `chown` command.
111
108
112
109
```bash
113
110
sudo su
114
111
cd /tmp/host-read-access
115
112
cat Hello-World.txt
116
113
```
117
-
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.
114
+
If everything was successful, you see the contents of the *Hello-World.txt* file in the EFLOW virtual machine. To verify write access, create a file in */tmp/host-read-write-access* and then check the contents of the new file in the *Read-Write-Access* Windows host folder.
118
115
119
116
## Check shared folders
120
117
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.
@@ -131,7 +128,7 @@ For more information about the `Get-EflowVmSharedFolder` cmdlet, see [PowerShell
131
128
132
129
133
130
## Remove shared folders
134
-
The following steps provide example EFLOW PowerShell commands to stop sharing a Windows shared folder with the EFLOW virtual machine.
131
+
The following steps provide example EFLOW PowerShell commands to stop sharing a Windows shared folder with the EFLOW virtual machine.
135
132
136
133
1. Open an elevated PowerShell session by starting with **Run as Administrator**.
137
134
@@ -143,4 +140,4 @@ The following steps provide example EFLOW PowerShell commands to stop sharing a
143
140
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).
144
141
145
142
## Next steps
146
-
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.
143
+
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 issues you encounter when setting up IoT Edge for Linux on Windows.
0 commit comments