What I learned: if you want full access to your shared folder on VirtualBox, do manual mounts.
System:
Host: Mac OSX 10.7 (a.k.a. "Lion")
Guest: Ubuntu 11.10 (a.k.a. "Oneiric Ocelot")
VirtualBox version: 4.1.10 r76795
VirtualBox Guest Addition version: 4.1.10
Shared Folder name: ~/sharedfolder
Case:
I need to rebuild a database in the guest OS. The database dump is stored in the shared folder (due to limited space in my .vdi), and I need to use it to rebuild the database.
Issue:
I used the command:
~$ sudo su postgres -c "psql -d
Result:
after entering root password, it returned:
"Permission denied"
I checked the permission on the shared folder and the dump file. The file's permission was:
-rwxr-x---
I tried changing the permission to no avail.
Solution: manual mount!
- Create a new folder in your HOST system. e.g. ~/sharedfolder
- Add the folder to your VirtualBox Guest OS shared folder list
- To access the Shared Folders option: select your guest OS > Settings > Shared Folders
- Add your shared folder. Make sure NOT to check "Auto-mount" (it's evil). Then click "OK".
- Run your guest OS. The following instructions are for Ubuntu only (sorry!).
- In your guest OS, create the directory you want the shared folder to be mounted to. For example: /mnt/shared
- Open a Terminal and mount your shared folder
- Et voila, your file (if you have any in the shared folder) will have the following permission:
-rwxr-xr-x 1 root root
No comments:
Post a Comment