Instructions for creating a shared folder via VirtualBox using a Windows host machine and an Ubuntu 16.04 Headless Server guest.
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.
- Start VM
- Devices > Insert Guest Additions CD Image...
sudo mount /dev/cdrom /media/cdrom
sudo apt-get install make gcc linux-headers-$(uname -r)
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.
- In your VM, create the folder you want to share:
sudo mkdir /path/to/ubuntu_share_folder
- E.g.:sudo mkdir /media/vboxshare
- Shudtown VM:
sudo shutdown now
- 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'
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
- 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