When you start a Windows 10 guest machine in VirtualBox on your workstation, you can set up shared folders to seamlessly copy files between your workstation and the Windows 10 guest machine.
The shared folder appears in Windows Explorer as a mapped network location.
For more on this see Configure the Windows virtual machine in VirtualBox
On a Windows 7 guest machine the Git Bash, Command Prompt, and PowerShell windows all can see the mapped E: network drive, so you can change the working directory with
cd E:
and execute commands in the shared folders.
On a Windows 10 guest machine, only the PowerShell window can see the shared folder as a mapped network drive, E:
Command prompt will display the error message
The system cannot find the drive specified
When you try to start the Git Bash window with Git Bash Here, nothing happens.
If you start Git Bash from the menu and try to change the working directory to the E: drive, you get the error message
bash: cd: /e: No such file or directory
Map the shared drive
If you need to use the Command prompt or the Bash terminal, you can temporarily map the shared folder
- Open the Command Prompt on the Windows 10 guest machine
- Execute the command
net use x: \\vboxsvr\Users
Automate the drive mapping
Mapped drives are user-specific so if you want to use a mapped drive as an Administrator, you have to map is as Administrator.
Enable the visibility of the mapped drives
- Start Regedit
- Navigate to HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System
- Create a DWORD value EnableLinkedConnections with the value 1
- Restart the computer
Create the automated process to map the drive of the host computer
- Create a new batch file in your Documents folder: map_drive.bat
net use x: \\vboxsvr\Users
- Create a new scheduled task: Map the Mac file system to X
- Set the user account to SYSTEM
- Run with highest privileges
- Configure for Windows 10
- Set the trigger to startup
- Create a new action
To use the Bash terminal
- Open the Bash terminal in a directory on the C: drive
- Change to the shared directory with
cd /x/...
To use the command prompt
- Open the command prompt
- Change to the shared directory with
x: cd ...