How do i set up shared folders in virtual box (windows 7 host, Ubuntu guest)?

2

1

I have windows 7 (host), virtual box, and BioLinux6 (a varient of Ubuntu) as the guest OS.

how can i set up the shared folders to be usable for read and write in both OS without having to re-mount them every time i start up.

I'm quite familiar with windows, but totally new to Linux, the virtual box documentation didn't make sense for me as a non-linux user, it was just a couple of lines of commands, which i think only mounted the shared folders until the next re-boot.

Kirt

Posted 2010-08-11T13:16:37.410

Reputation: 5 119

Answers

2

First, you have to install the VirtualBox Guest additions in your host system. You shouldn't be able to use shared folders without them, if you didn't do that yet.

Second, add the the shared folder as a permanent Folder.

On the guest system, add the /etc/fstab file. You will need to open it via sudo to have edit rights.

Now, add a line to the bottom of that file. If your shared folder has the name "shared", and you want to mount it to the location /home/bec/shared, add the following line (although normally folders should be mounted to /mnt/...):

shared /home/bec/shared vboxsf defaults 0 0

Now, after rebooting the machine, the mounted folder should be accessible in the /home/bec/shared folder you supplied.

private_meta

Posted 2010-08-11T13:16:37.410

Reputation: 2 204

thanks, that seems to have worked, but the two folders i tried to share seem to have both mounted as read only, when i wanted one read only and one full access, do i need to change the access privileges on the folder from the guest OS side, if so, how? – Kirt – 2011-01-07T06:57:08.973

In the "Shared Folders" option of VirtualBox you should be able, when adding or editing a specific share, to set the "Read-only"-flag. On the guest-system, when mounting the way I mentioned in my answer, the access rights should be set to "Full access" automatically. If, for whatever reason, it does not mount with write privileges, you can add mount options instead of defaults (comma separated, no-whitespace). To see what mount options are available, consult the man pages to "mount", most likely on line 296ff. You probably need auto,rw,user, but just look it up. – private_meta – 2011-01-10T10:52:59.487