Windows Sandbox gives you a temporary environment to test your programs or utilities. However, at times, one needs to access folders on the host devices. In this post, we will learn how you can share a host folder with Sandbox in Windows 11.
How to Share Host Folder with Sandbox in Windows 11?
Here’s how to share a Host Folder with Windows Sandbox in Windows 11.
- Share Host Folder with Sandbox at runtime
- Share Host Folders with Windows Sandbox using the WSB file
Let’s explore how to share Host Folder with Windows Sandbox in detail.
Share Host Folder with Sandbox at runtime
One quick and secure method of sharing host folders with Sandbox is at runtime. This method enables users to interact with specific files during the session while ensuring that no permanent changes are made to the host system. Furthermore, it enables users to do so without restarting the Sandbox.
- Launch the Windows Sandbox app, and click on the three vertical dots from the top right corner.
- Select the Share Folder option, and navigate to the folder you want to share.
- Click the folder, follow it by clicking on the Select Folder option, and repeat the process for more folders.
Doing so will make the shared folders appear on the desktop of the Windows Sandbox until it is closed.
Share Host Folders with Windows Sandbox using the WSB file
We can also use WSB files to share host folders with Windows Sandbox. By configuring the WSB file, users can specify folders from the host system that need to be shared. This method allows users to define read-only permission, ensuring that the shared content remains safe and unaltered. To do the same, follow the steps mentioned below.
- Go to the main system, not the Windows Sandbox environment, create a new text file, and shift its extension from .txt to .wsb.
Note: Changing the file extension from .txt to .wsb is necessary. - Right-click on the newly created wsb file, and select the Edit in Notepad option.
- Paste the following code for read-only shared host folders into the wsb file opened in the Notepad:
<Configuration> <MappedFolders> <MappedFolder> <HostFolder>Full path to folder</HostFolder> <ReadOnly>true</ReadOnly> </MappedFolder> </MappedFolders> </Configuration>
- If you don’t just want read-only shared host folders,
<Configuration> <MappedFolders> <MappedFolder> <HostFolder>Full path to folder</HostFolder> <ReadOnly>false</ReadOnly> </MappedFolder> </MappedFolders> </Configuration>
- Make sure to change the Full Path to folder with the actual path of the folder of the host folder that needs to be shared.
- For sharing more than one or two folders, users can follow this line of coding:
<MappedFolder> <HostFolder>Full path to folder</HostFolder> <ReadOnly>false</ReadOnly> </MappedFolder>
- Or, you can use the following script to do the same thing but with Read-only option turned on.
<MappedFolder> <HostFolder>Full path to folder</HostFolder> <ReadOnly>true</ReadOnly> </MappedFolder>
- Once done with editing the code, go to the File menu bar and click on the Save button.
That’s how users can share the host folders and access them anytime.
Read: How to transfer Files to Windows Sandbox?
How do I share files in Windows Sandbox?
There are several ways to share files between the main Windows system and the Windows sandbox. One classic method is to drag and drop files. Users simply need to launch the Windows Sandbox app, copy the host files, and paste them into the Windows Sandbox windows. Additionally, users can opt for sharing host files using the WSB files. This method allows users to share files with read-only permission to guarantee the safety of the content in the file.
Read: Enable or disable Clipboard Sharing with Windows Sandbox
How to give a Shared folder access?
To give Shared folder access, follow the steps mentioned below:
- Right-click on the folder that needs to be shared, and select Properties.
- In the Properties windows, go to the Sharing tab, and click on Advanced Sharing.
- Check the Share this folder box, and click on the Permissions option.
- Now, add specific groups or users, set the desired permission such as Read for viewing only or full control for modifying contents, and lastly, select the Ok button to apply the changes.
Hopefully, this will do the job for you.
Also Read: Windows Sandbox failed to initialize.