Share a folder from a host Mac OS to a VirtualBox Linux guest

If you’re using VirtualBox to run a VM on your Mac OS, you may already see that the /Users folder of the Mac is by default shared to the guest system. But you may need to share a different folder of the host Mac OS to the guest. In that case, follow these quick steps:

– In VirtualBox, select the VM instance of the guest system then click on Settings

– Click on Shared Folders icon

– Add a new item for Machine Folders list

– In Folder Path, enter or Click on the dropdown list to browse the folder of the Mac OS you want to share. Eg: <host-folder-path>

– In the Folder Name box, enter the name for that folder. Eg: <host-folder>

– Check Auto-mount and Make Permanent boxes

– SSH to the Linux guest system. Eg: If you’re using docker machine:

$ docker-machine ssh default (default is the name of the VM)

– Create a folder on the guest system:

$ mkdir -p /path/on/guest 

– Then do the mount:

 $ sudo mount -t vboxsf <host-folder> /path/on/guest 
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s