jueves, 20 de diciembre de 2007

Sharing Folders with VirtualBox

Here is a step by step on how to set up shared folders for accessing Windows folders in a Linux guest.

1. Assign the host folders to share through the VM settings in VirtualBox. No need to setup shares in Windows Explorer itself.

2. Create mount points for the shares in the guest (as root):
mkdir /mnt/share
mkdir /mnt/share/music
mkdir /mnt/share/videos
mkdir /mnt/share/pix
mkdir /mnt/share/dox
mkdir /mnt/share/down

3. Setup sudo (as root):
Add the following at the end of /etc/sudoers:
user ALL = NOPASSWD : ALL
Replace "user" with your username.

4. Create a script to mount your shares:
mkdir ~/scripts
nano scripts/shared-folders
#!/bin/sh
sudo mount -t vboxsf music /mnt/share/music
sudo mount -t vboxsf videos /mnt/share/videos
sudo mount -t vboxsf pix /mnt/share/pix
sudo mount -t vboxsf dox /mnt/share/dox
sudo mount -t vboxsf down /mnt/share/down
The names after "vboxsf" are the ones you set for your shared folders in step 1.
Make shared-folders script executable:
chmod +x shared-folders

5. Add the script to Gnome startup programs:
Desktop > Preferences > Sessions > Startup Programs
Now your shared folders will be ready as soon as your Gnome desktop loads.

BEWARE: currently the content at the root of shared Windows Vista folders featuring a "Location" tab in their properties window cannot be deleted or edited from the guest, neither new files or folders can be created at that level. Anyway, these limitations do not apply for their subfolders.

10 comentarios:

Sven dijo...

Good Job! :)

Sven dijo...

good Job! :)

Anónimo dijo...

Thanks!!! Very helpfull, clear description one can work with.

ridvan dijo...

thank you!

Anónimo dijo...

thanx you very muchess hahahahahahaa

Jacob dijo...

Thank you! But there is another way; http://tuxtweaks.com/2009/06/share-folders-linux-host-linux-virtual-machine-virtualbox/comment-page-1/#comment-2392

Glendaajackson dijo...

Thank you for your nice post i feel very happy while i visit your post thank you for your nice post.




rss

Anónimo dijo...

Succeeded in mounting my partitions so many thanks for the article. One problem though: if you mount the partitions as root (using sudo) the owner will be root. No way I could change that using chown tool. But if you make that script mounting the shares without the sudo command, you can actually access them.
Dan

humpy dijo...

woohoo!

Nistha adhikari dijo...

This is the step by step description on how to set up shared folders for accessing Windows folders in a Linux guest and extremely useful for me.