I installed Ubuntu under Virtualbox in MacBook Pro with OS X El Capitan.
To share my OS X home directory /Users/tli
folder with the guest Ubuntu, I downloaded the Virtualbox Guest Addition iso file to /Users/tli/Downloads/virtualbox/VBoxGuestAdditions_5.0.16.iso
, specified it under the virtual machine's Settings -> Storage -> Optical Drive (see the screenshot below), and installed it under the guest Ubuntu.
Then the shared directory worked: my OS X home directory /Users/tli
folder is mounted as /media/sf_tli
, and I could access the content in my OS X home directory from guest Ubuntu.
But after restarting the guest Ubuntu and virtualbox maybe abnormally or maybe not (I forgot), the content of the shared directory became empty in the guest Ubuntu. To solve the problem, I tried to reinstall the Guest Addition, by clicking Devices -> Insert Guest Addition CD Image, but got the following error:
Unable to insert the virtual optical disk /Applications/VirtualBox.app/Contents/MacOS/VBoxGuestAdditions.iso into the machine Ubuntu14.04.
Would you like to try to force insertion of this disk?
Details:
Could not mount the media/drive '/Applications/VirtualBox.app/Contents/MacOS/VBoxGuestAdditions.iso' (VERR_PDM_MEDIA_LOCKED).
Result Code: NS_ERROR_FAILURE (0x80004005) Component: ConsoleWrap Interface: IConsole {872da645-4a9b-1727-bee2-5585105b9eed} Callee: IMachine {f30138d4-e5ea-4b3a-8858-a059de4c93fd}
Also see the following screenshot:
I feel it strange to look for the Guest Addition under /Applications/VirtualBox.app/Contents/MacOS/VBoxGuestAdditions.iso
of my OS X, rather than /Users/tli/Downloads/virtualbox/VBoxGuestAdditions_5.0.16.iso
which I specified earlier.
By the way, my user account under the guest Ubuntu is a member of group vboxsf
.
What shall I do to make the shared directory work under the Guest Ubuntu?
Thanks.