How to transfer files from Windows to Ubuntu on Virtualbox?
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
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.
- Before starting your Guest
- Go to VirtualBox Manager
- Select your interested Guest
- Go to Guest Settings
- In Guest Settings, scroll the left side-menu, and go to Shared Folders
- In Shared Folders, add your interested folder in the Host machine
- 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
. - Click OK and save your changes.
- Start your Guest machine
- In Guest machine, create a new folder, e.g.
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 installvirtualbox-guest-utils
.sudo apt-get install virtualbox-guest-utils
Then run the
mount
command againYou shall find your stuffs in this
GUEST_SHARE
folder.
sudo mount -t vboxsf SHARENAME /media/vboxshared
- create your shared folder at your PC. for example "c:\SharedBoth"
- 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. - start the ubuntu terminal, type in command above,
sudo mount -t vboxsf SharedBoth /media
- 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"