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?
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. It only takes a minute to sign up.
Sign up to join this communityHow 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?
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
/sbin/mount.vboxsf: mounting failed with the error: No such device
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.
HOST_SHARE
.GUEST_SHARE
In Guest terminal, type
sudo mount -t vboxsf HOST_SHARE GUEST_SHARE`
If you see the error mount: wrong fs type, bad option, bad superblock on …
, this means you first need to install virtualbox-guest-utils
.
sudo apt-get install virtualbox-guest-utils
Then run the mount
command again
You shall find your stuffs in this GUEST_SHARE
folder.
virtualbox-guest-utils
Jan 23, 2019 at 12:36
virtualbox-guest-utils
package everything works fine.
sudo mount -t vboxsf SHARENAME /media/vboxshared
c:\SharedBoth
at virtualbox menu "settings" - "shared folders" - "add" -"permanent/automount", before you start the ubuntu virtual machine.sudo mount -t vboxsf SharedBoth /media
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:
Cleanly unmount the USB from windows by clicking on the corresponding icon in the bottom right corner and selecting the "safely remove ..." option.
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
Shared folder as stated in laebshade's and Alvin Sim's answers. But that can be slow.
FTP etc... as also stated in Alvin Sim"s answer (assumes you have an ftp server on your Windows host).
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
For small volumes and frequent synchronisation, open a dropbox account.
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.