This article will tell you how to share folders between VirtualBox Host and Guest virtual machines to copy files between the 2 machine OS. The host OS is Windows10, and the guest OS can be Windows10 & macOS.
1. Prerequisites For Share Folders Between Host & Guest Virtual Machine.
1.1 Make Host & Guest OS Use Bridged Adapter.
- Before you can share folders between host & guest virtual machine, you should first make sure your virtual machine network adapter is bridged adapter, this can make the host & guest virtual machine’s IP exist in the same subnetwork.
- Shut down the VirtualBox virtual machine.
- Select the virtual machine in the Oracle VM VirtualBox Manager window left panel.
- Right-click the virtual machine, click the Settings menu item in the popup menu list to open the virtual machine’s Settings window.
- Click the Network item on the Settings window left panel.
- Click the Adapter 1 tab on the right side Network panel.
- Make sure to check the Enable Network Adapter checkbox.
- Select the Bridged Adapter item from the Attached to drop-down list.
- Click the OK button to save the changes.
- Start the virtual machine.
- Open a terminal window and run the command ipconfig (Windows) or ifconfig (macOS or Linux ) in both the Host & Guest virtual machine, you will find the 2 virtual machine’s IPs are in the same subnetwork.
C:\Users\zhaosong>ipconfig Windows IP Configuration Ethernet adapter VirtualBox Host-Only Network: Connection-specific DNS Suffix . : Link-local IPv6 Address . . . . . : fe80::5dcc:84ca:af3d:7e36%17 IPv4 Address. . . . . . . . . . . : 192.168.56.1 Subnet Mask . . . . . . . . . . . : 255.255.255.0 Default Gateway . . . . . . . . . :
1.2 Make Sure The Host & Guest OS Can Ping Each Other.
- But when you ping one virtual machine’s IP from another virtual machine, you may find that the 2 virtual machines can not ping each other.
- This is because the virtual machine’s Firewall is enabled, so you should turn off the virtual machine’s Firewall.
- For Windows, you can click the Windows Start icon —> Settings menu at the Windows screen bottom left corner.
- Input the keyword firewall in the Find a setting input text box.
- Click the Windows Defender Firewall in the popup item list, it will popup the Windows Defender Firewall dialog window.
- Click the Turn Windows Defender Firewall on or off link on the left side.
- Click the Turn off Windows Defender Firewall radio button in the Private network settings area.
- Now you can ping the virtual machine from another virtual machine.
2. Share Folders Between Host ( Windows10) & Guest (Windows 10).
2.1 Share Guest Windows Folder.
- Open a Windows Explorer in the Host virtual machine.
- Right-click the Network item on the Windows Explorer window left side.
- Click the Properties item in the popup menu list, it will open the Network and Sharing Centre window.
- Click the Change advanced sharing settings link in the popup window left side.
- Click the radio button Turn on network discovery and Turn on file and printer sharing to select them.
- Now go to the guest virtual machine and right-click the folder that you want to share.
- Click the Properties menu item in the popup menu list to open the folder’s Properties window.
- Click the Sharing tab on the Properties window.
- Then click the Share… button to open the Network access window.
- Click the drop-down list to select an existing user or create a new user.
- Then click the Add button to add the user to the list, and click the Done button in the next windows dialog.
- Now when you click the Network item in the Host machine’s Windows Explorer, you can find the Guest virtual machine on the right side.
- When you click the Guest virtual machine for the first time, you need to provide the username and password to log in to it.
- After you successfully log in to the guest virtual machine, you can find the guest VM shared folders and copy the files between the Host and the Guest virtual machine.
- You can also open a windows file explorer on the host machine and input the guest virtual machine’s IP address in starts with \\ ( for example \\192.168.31.172 ) in the file explorer address input box, then press the enter key.
2.2 Share Host Windows Folder Use The Virtual Machine’s Shared Folders Feature.
- You can also use the method in section 2.1 to share the host machine’s folder with the guest virtual machine.
- You can also use the virtual machine’s Shared Folders feature to share the host folder with the guest folder.
- Shut down the guest virtual machine.
- Right-click the virtual machine on VirtualBox Manager’s left side.
- Click the Settings… menu item on the popup menu list to open the virtual machine’s Settings dialog window.
- Click the Shared Folders item on the Settings window left side.
- Click the Machine Folders item on the right side.
- Then click the Add button to open the Add Share dialog.
- Select the shared folder from the Folder Path drop-down list.
- You can set the shared folder permission as read-only by checking the Read-only checkbox.
- Click the OK button to save the changes.
- Now in the guest windows virtual machine, open a file explorer, click the Network icon on the left side, click the host machine, and then you can see the shared folder you just configured.
3. Share Folders Between Host ( Windows10) & Guest ( macOS ).
3.1 Share The Guest ( macOS ) Folder.
- On the guest macOS virtual machine, click the Apple logo —> System Preferences… menu item on the screen top left corner.
- Then click the Sharing icon in the popup System Preferences window.
- Check the File Sharing checkbox in the left Service list.
- Click the + icon on the right side Shared Folders list to select the folder that you want to share.
- Then you can assign the user permission to this folder on the Users list besides the Shared Folders list.
- Click the Options… button, then you can choose whether share this folder through SMB or AFP protocol.
- After your configuration, you can go back to your host machine and open a file explorer window, input the macOS IP starts with \\ ( for example: \\192.168.31.191), press the enter key.
- Now it will popup a dialog to let you input the username and password to login.
- After you successfully login, you can see the shared folder in it.
- Now you can transfer files between the Windows10 (host) & macOS ( guest ).