VirtualBox - Sharing a folder

I'm a Windows 10 user, running macOS High Sierra 10.13 via VirtualBox 5.1.28.
I didn't fully understand how to share a folder.
The part that I did understand and did, is:

  1. Devices → Insert Guest Additions CD image...

But then, in macOS, I type in the terminal:

sudo mount -t vboxsf release_builds ~/Downloads/SteamCMD-GUI

And I get the error:

mount: exec /Library/Filesystems/vboxsf.fs/Contents/Resources/mount_vboxsf for /Users/avi12/Downloads/SteamCMD-GUI: No such file or directory

Later, I checked the directory /Library/Filesystems, and found that:

Which means that, there's actually no directory vboxsf.fs, so there would obviously be an error.

The question is then, what part am I missing?


Solution 1:

There are no guest additions for macOS in VirtualBox. The shared folder feature of VirtualBox won't work here.

You have to configure a share on the host system and access it from inside the guest with one of the common methods:

  1. Finder > Go > Connect to server... cmdK
  2. Terminal: mount -t smbfs //username:password@server/share .../mountpoint
  3. Finder window > sidebar > Shared > choose share >

Some network connection between host and guest is required (e.g NAT or bridged adapter). Using the latter requires to set up an IP-address in macOS in the same network as the host's adapter.


To set up a bridged adapter for a guest (which has to be shut down) do the following:

  1. Choose the VM > Settings > Network > Adapter 1 > Check Enable Network Adapter > Attached to > Bridged Adapter > choose a network interface of the host (usually either Ethernet or Wi-Fi)
  2. Check the IP config of this interface in the host (e.g. IP= 192.168.0.2 Netmask= 255.255.255.0 Gateway=192.168.0.1 DNS=8.8.8.8)
  3. Use the same config in the guest but choose a different IP (e.g. 192.168.0.111)
  4. Connect from the guest to the host with cmdK > enter smb://192.168.0.2/Share_name > enter the credentials