0

I have a VirtualBox installed on Ubuntu 18.04 and within VirtualBox Ubuntu 18.04 is also installed i.e. both host and guest machine are the same OS. Now I need to transfer some files from host machine to guest machine, I followed instructions mentioned here.

But while issuing the following command in guest machine

$ sudo mount -t vboxsf -o uid=$UID,gid=$(id -g) share ~/host

I am getting an error

mount: /home/atinesh/host: mount point does not exist

How can I transfer files from host machine to guest machine

Update: I have created home directory in Guest OS, Now while Issuing the same command as mentioned above getting this error

mount: /home/atinesh/host: wrong fs type, bad option, bad super block on share, missing codepage or helper program, or other error.

5
  • You didn't create ~/host.
    – Pilot6
    Feb 27, 2019 at 13:06
  • 1
    If it is about simple transferring files and not keeping the shared volume - what about the scp?
    – h__
    Feb 27, 2019 at 13:27
  • @Pilot6 I have updated the post please have a look
    – Atinesh
    Feb 27, 2019 at 13:37
  • In guest OS try to run sudo chmod 777 /home/atinesh/host - Did you try the troubleshooting section of the document you referring to ?
    – cmak.fr
    Feb 27, 2019 at 15:18
  • The shared folder did not mount properly even after installing guest additions. After several hours of searching, I realized that I can simply drag/drop folders from Windows to Ubuntu - so the need for the shared folder is gone.
    – Nazar
    Aug 21, 2019 at 15:36

5 Answers 5

4

Easiest to use VirtualBox Shared Folders.

Make sure that Guest Additions is installed in your VM.

In the Shared Folder setting for your VM... ie: using my Desktop folder...

enter image description here

In your VM...

In terminal...

sudo adduser $USER vboxsf # add user to vboxsf group

Log out, log in so that vboxsf is available.

Open a Files window and open the shared Desktop (in my example) folder. You may also see a sf_Desktop folder icon on the desktop.

2
  • Getting error while issuing command you mentioned addUser: The group 'vboxsf' does not exist
    – Atinesh
    Feb 28, 2019 at 5:17
  • @Atinesh Make sure you're in the VM, and do the sudo adduser $USER vboxsf, and if that still fails, then try sudo addgroup vboxsf first, to add the missing group.
    – heynnema
    Feb 28, 2019 at 14:32
3

I solved my issue by first adding my username to vboxsf

sudo adduser $USER vboxsf

And then I still had to install this package to see the shared folder

sudo apt install virtualbox-guest-utils
1
  • Exactly! Thanks. I can say the same solution works for Ubuntu 20.04. 1. sudo apt install virtualbox-guest-utils 2. sudo adduser $USER vboxsf 3. log out / log in
    – DmitryDzz
    Apr 29, 2021 at 17:36
0

I also faced problem in sharing folders on ubuntu 18.04. I degraded the version and installed ubuntu 16.04. Problem got solved. No need to separately mount the folder. Just adding name to group vboxsf and then restart VM worked.

1
  • This is not a solution for Ubuntu 18.04 that you mentioned in here, you just started using a totally different version of Ubuntu... Sep 11, 2019 at 7:20
0

I solved my issue by first adding my username to vboxsf

sudo adduser USER_NAME vboxsf And then I still had to install this package to see the shared folder sudo apt install virtualbox-guest-utils

almost worked, BUT although I wanted to be mounted at /mnt/mydir, as configured in virtualbox I ended up getting it mounted on /media/sf_mydir

1
  • If you disable automount (for the share via the Virtualbox Manager), you can mount the share wherever you want. On that note, automounting works great so I usually leave it alone. Sep 18, 2019 at 23:28
0
  1. On guest and Host machine both folder permission

    chmod 777 /shared_dir_name

  2. On Guest machine:

    sudo apt install virtualbox-guest-utils

    sudo adduser $USER vboxsf

  3. Now check on guest machine

    df -h

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .