12

I was trying to see if there was a way to access my files that reside on the current users PC inside the sandboxed environment by opening File Explorer and opening the C:\Users folder.

This is what I'm presented with:

sandboxed user folder

There is no sign of my standard folders that are present on my local machine even when the show hidden files is checked.

How can I access the files and folders that are on my physical device?

Ste
  • 1,352

3 Answers3

16

Fortunately, there is a way.

It involves creating a .wsb file on your local install of windows.

  1. Close any sandboxed environments you may have open.

  2. On your local machine, start notepad and paste the code:

<Configuration>
  <MappedFolders>
    <MappedFolder>
      <HostFolder>C:\Users\yourusername</HostFolder>
      <ReadOnly>true</ReadOnly>
    </MappedFolder>
  </MappedFolders>
</Configuration>
  1. Change the path between where it says <HostFolder>...</HostFolder> that you want to have access to in the Sandboxed environment. You can also change the ReadOnly tag to whatever you want but be advised it is best set to true.
  2. Go to file > save as. Choose, Save as type to All files (*) and type Run Sandbox.wsb into the File name box and save to a location on your physical device.

This file should not reside in the Sandboxed environment 5. Click save, then close notepad. 6. Click on this file to open it and you will then chose to open with Windows Sandbox

You should be greeted with the following two UIs'.

Open with

User account control

  1. The desktop of the opened Sandbox should look a little something like this.

    enter image description here


Example code for the .wsb file if you want more than one folder shown in the Sandboxed environment.

<Configuration>
  <MappedFolders>
    <MappedFolder>
      <HostFolder>C:\Users\yourusername</HostFolder>
      <ReadOnly>true</ReadOnly>
    </MappedFolder>
    <MappedFolder>
      <HostFolder>C:\Users\anotherusername</HostFolder>
      <ReadOnly>true</ReadOnly>
    </MappedFolder>
  </MappedFolders>
</Configuration>

Other than the above you can also copy and paste files from your physical device to the Sandboxed one with the normal methods.


Offical MS documentation here:

https://docs.microsoft.com/en-us/windows/security/threat-protection/windows-sandbox/windows-sandbox-configure-using-wsb-file

Ste
  • 1,352
3

It is also possible to copy & paste individual files from the File Explorer in the real O/S to the File Explorer within the sandbox. This appears to work bidirectionally by default.

Not as efficient for a large # of items but for just a quick solution for a couple of files, works great.

StayOnTarget
  • 1,494
0

Small addition to the @Ste answer. If you need to test an application that uses Internet connection, don't forget to enable Network Discovery in a Sandbox environment:

Go to your Sandbox Windows -> Click "Network and internet settings" -> "Advanced network settings" -> "Advance sharing settings" -> Enable Private and Public Network Discovery.

t7e
  • 760