Skip to content

Instantly share code, notes, and snippets.

@Lemmings19
Created February 12, 2017 06:36
Show Gist options
  • Save Lemmings19/26bc8675c84d86576a92f7366d733f4c to your computer and use it in GitHub Desktop.
Save Lemmings19/26bc8675c84d86576a92f7366d733f4c to your computer and use it in GitHub Desktop.
How to share a folder between Ubuntu inside VirtualBox (the guest) and Windows (the host)

For example:

I have a folder on my Windows installation named C:/shared_stuff.

I have Ubuntu running inside VirtualBox on my Windows installation.

I want to access that folder inside Ubuntu under the path /mnt/shared_stuff (this could be anything you like; it doesn't have to match the name of the folder in Windows).

  • Inside settings for the VM, go to Shared Folders.
  • Add a Machine Folder (or check Make Permanent).
  • Give a Folder Path of C:/shared_stuff.
  • Give a Folder Name of stuff.
  • Hit 'Okay'.
  • sudo mkdir /mnt/shared_stuff
  • sudo mount -t vboxsf stuff /mnt/shared_stuff

There you go. Now you have a folder on your Windows installation that you can access within your Ubuntu virtual machine.

For my use case, I am installing a project to that shared folder (installing it using Ubuntu) and editing the contents of that project in Windows.

@Lemmings19
Copy link
Author

Lemmings19 commented Apr 23, 2017

You might need to chmod the /mnt/shared_stuff directory if you have mounting issues down the road.

I had some issues upon rebooting Linux where it wasn't mounting properly. chmodding shared_stuff and then re-mounting sudo mount -t vboxsf projects /mnt/shared_stuff did the trick.

@Lemmings19
Copy link
Author

Edge case: If you're using npm and are getting a symlink error, add --no-bin-links to your npm install commands. The error is because it's actually a Windows folder as I understand it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment