Skip to content

Instantly share code, notes, and snippets.

@William-Lake
Last active December 11, 2017 16:26
Show Gist options
  • Save William-Lake/d8ed90360340b6d8d213a041dc03aa51 to your computer and use it in GitHub Desktop.
Save William-Lake/d8ed90360340b6d8d213a041dc03aa51 to your computer and use it in GitHub Desktop.
VBox Windows Host / Ubuntu 16.04 Server Guest : Create Shared folder

HowTo

Instructions for creating a shared folder via VirtualBox using a Windows host machine and an Ubuntu 16.04 Headless Server guest.

1. Install Guest Additions

From StackOverflow question Why can't I access a shared folder from within my Virtualbox machine?, specifically the first half of Louis Matthijssen's answer.

  1. Start VM
  2. Devices > Insert Guest Additions CD Image...
  3. sudo mount /dev/cdrom /media/cdrom
  4. sudo apt-get install make gcc linux-headers-$(uname -r)
  5. sudo /media/cdrom/VBoxLinuxAdditions.run

Parts of 2 & 3 from Unix StackExchange question How to transfer files from Windows to Ubuntu on Virtualbox?, specifically 'Option 1' from Alvin Sim's answer.

2. Prepare Share Folders

  1. In your VM, create the folder you want to share: sudo mkdir /path/to/ubuntu_share_folder - E.g.: sudo mkdir /media/vboxshare
  2. Shudtown VM: sudo shutdown now
  3. In VirtualBox, create a shared folder: - Navigate to VM - Settings - Shared Folders - Add Button (Far right blue folder with green plus sign - Provide Folder Name (Recommend no spaces or special characters, E.g. Ubuntu_Server_Folder) - Provide Folder Path in Windows - Click 'Ok'

3. Connect Shared Folder

  1. sudo mount -t vboxsf Name_Of_Share_Folder_In_VBox /path/to/ubuntu_share_folder - E.g.: sudo mount -t vboxsf Ubuntu_Share_Folder /media/vboxshare
  2. Enter password when prompted

You will now be able to drop files into this folder in Windows and they will show up in the folder you created on your Ubuntu Server in step 2.1 E.g. /media/vboxshare

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