Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

How should I transfer files from Windows to Ubuntu installed on Virtualbox? When I plugged in a USB, it only pops up in Windows.

How can I see it in Ubuntu?

share|improve this question
up vote 15 down vote accepted

There are 2 ways, which I normally use

Option 1: Before booting up Ubuntu, inside Virtualbox Ubuntu VM settings, specify a share folder. Then after logged in to Ubuntu, create a new directory for example /media/vboxshared and mount that drive using the command sudo mount -t vboxsf SHARENAME /media/vboxshared. Enter your password when it prompts for the password.

Option 2: Before booting up Ubuntu, add a new Network adapter and select 'Bridged Adapter'. Then after logged in to Ubuntu, run the command ifconfig -a | more to get the ip address of that new network adapter. In Windows, use WinSCP or FileZilla to transfer the file to Ubuntu

share|improve this answer
Option 1 is not working for me! I get /sbin/mount.vboxsf: mounting failed with the error: No such device – Ciwan Jan 29 '15 at 11:59

In any case, you can easily make the USB key visible in the guest. From your question I imagine you run Ubuntu in a guest and the host is Windows.

Whenever you insert an USB key, if you want to see it in the guest proceed as follows:

  1. Cleanly unmount the USB from windows by clicking on the corresponding icon in the bottom right corner and selecting the "safely remove ..." option.

  2. In your VirtualBox window select the "Devices => usb devices" menu item on the top left guest window menu and select your USB key. It should appear in Ubuntu now.

This operation is equivalent to physically inserting your USB key in a USB port of your guest machine.

Otherwise, the other options are

  1. Shared folder as stated in laebshade's and Alvin Sim's answers. But that can be slow.

  2. FTP etc... as also stated in Alvin Sim"s answer (assumes you have an ftp server on your Windows host).

  3. A simple samba mount from the guest:

    mount -t cifs //winhost/share /home/yourname/mntpoint -o user=winusr%paswd,uid=0,gid=0,file_mode=0777,dir_mode=0777
  4. For small volumes and frequent synchronisation, open a dropbox account.

share|improve this answer

Which is the host, and which is the guest? Either way, Virtualbox has a sharing mechanism you can use; just install the Guest Additions as described in the documentation then setup a share in the VirtualBox configuration.

share|improve this answer
I went through that but when I tried to mount that I got an 'only root can do that' error. – GTyler Jul 7 '11 at 1:20
@laebshade: The OP already stated which way around this was in his question. Windows is the host, Ubuntu is the guest. – Caleb Jul 7 '11 at 12:07
sudo mount -t vboxsf SHARENAME /media/vboxshared 
  1. create your shared folder at your PC. for example "c:\SharedBoth"
  2. make sure you have selected your shared folder c:\SharedBoth at virtualbox menu "settings" - "shared folders" - "add" -"permanent/automount", before you start the ubuntu virtual machine.
  3. start the ubuntu terminal, type in command above,
    sudo mount -t vboxsf SharedBoth /media
  4. then check if folder sf_SharedBoth created in media folder Before you do the step 3, you need to make sure you have installed "guest additions"
share|improve this answer
  1. In virtual box, login to Ubuntu.
  2. In menu bar click devices -> USB devices -> Select your device (Pendrive).
  3. Then go to the Home folder. On the left you'll see your device.
share|improve this answer

Thank you for Alvin Sim's answer. Though it is clear, I still spend some time to do everything correct. OK, here are my detailed steps using Alvin Sim's Option 1.

  1. Before starting your Guest
  2. Go to VirtualBox Manager
  3. Select your interested Guest
  4. Go to Guest Settings
  5. In Guest Settings, scroll the left side-menu, and go to Shared Folders
  6. In Shared Folders, add your interested folder in the Host machine
  7. After adding your Host folder path, you will see an updated Folders List in Shared Folders. Remember your newly folder Name shown in this list. Say it is HOST_SHARE.
  8. Click OK and save your changes.
  9. Start your Guest machine
  10. In Guest machine, create a new folder, e.g. GUEST_SHARE
  11. In Guest terminal, type

    sudo mount -t vboxsf HOST_SHARE GUEST_SHARE

  12. You shall find your stuffs in this GUEST_SHARE folder.

share|improve this answer

protected by Community Oct 3 '15 at 11:19

Thank you for your interest in this question. Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site (the association bonus does not count).

Would you like to answer one of these unanswered questions instead?

Not the answer you're looking for? Browse other questions tagged or ask your own question.