38

I have an Ubuntu 12.04 machine on which I have installed VirtualBox with Ubuntu 12.04 as the guest OS.

How can I share files between the host and guest?

I have installed the guest additions also but still it’s not able to mount the sf_shared folders if even it’s mounted. This means I'm unable to retrieve the file from the host.

Melebius
  • 11,750
prabha
  • 391

5 Answers5

45

I do not believe its possible to share files between the host and the guest without installing the extension pack first though I could be wrong on this.

You can find that here: https://www.virtualbox.org/wiki/Downloads

Check that the version of Virtualbox you have. Mine is 4.2.18 and double click the link

You should see something like this

enter image description here

Click OK and let it install.

Next step create a folder on your host machine as as share area

I've created one called VboxShare in my home directory.

enter image description here

First, make sure that your virtual machine is powered off.

machine-state-powered-off-image

Then, go into settings for your virtual machine, select shared folders then the plus icon to create a shared folder and fill in the details set it to auto mount.

enter image description here

Click OK then start your guest.

Job Done the shared folder appears on you guest machine as

/media/sf_Vboxshare

enter image description here

There is only one more step add any user in your guest system that needs access to the folder to the group vboxsf:

sudo adduser $USER vboxsf

Log out and back in, everything should work fine now.

Shon
  • 103
Warren Hill
  • 22,412
  • 28
  • 70
  • 88
10

On the VM settings in the Shared folders section, remember the name of your shared forlder!
After installing the VBox Guest additions on the guest OS fire up a terminal and type in

sudo mount -t vboxsf <share-name> /where/to/share

may wanna check https://forums.virtualbox.org/viewtopic.php?f=3&t=15868

3

Go to Devices option of your VM and click on the Shared Folders option and add the required_folder you want to share. Now in your file system (root) you can see media/sf_required_folder. But by default the Guest User won't have access to this folder. So to grant access to this folder you need to add Guest user to the group vboxsf. For this, sudo adduser Guest_user vboxsf to give access. Now have the access.

AJ.
  • 131
3

If you want to share files and folders you can use Vbox extensions as mentioned in other posts.

Alternatively you can use Nitroshare :

  1. Install Nitroshare (in host and in guest )

    sudo add-apt-repository ppa:george-edison55/nitroshare
    sudo apt-get update
    sudo apt-get install nitroshare
    

    There are four ways to install Nitroshare - reference : here

  2. Start Nitroshare (in guest and host) from the dash or from a terminal command nitroshare

    You will see the tray icon on top right corner :

    Imgur

  3. By default the destination folder is ~/Desktop. You can modify it in settings.

    Imgur

  4. Sending files and folders:

    Select _send files/Directory _ from the tray icon, select the file /directory you want to share, click on open.

    Then select the VM device from the menu and click OK.

    Imgur

cl-netbox
  • 31,491
Ravan
  • 9,567
1

Try this combo. I used this as I am using AMD64 CPU.

virtualbox-4.3_4.3.6-91406~Ubuntu~precise_amd64 with extenstion pack -
Oracle_VM_VirtualBox_Extension_Pack-4.3.6-91406

It works. Also Make sure

After installing the VBox Guest additions on the guest OS (VM) fire up a terminal on Guest server and type in

mount -t vboxsf  /shared-name /where/to/share

Example

sudo mount -t vboxsf /home/myshare /mnt

where /home/myshare is a folder on Host Server and /mnt is a folder on guest server.

Start dumping files on host folder /home/myshare and see the same on guest /mnt

BuZZ-dEE
  • 14,533
Prinson
  • 11