Failed Mounting VirtualBox Shared Folders in an Ubuntu 17.04 Guest

19,685

Solution 1

You must log out, and log back in, for the vboxsf group to be enabled.

No implicit mount is required. If your Windows folder shows up in the Shared Folder icon at the bottom of the VB window, you just need to open a Nautilus window and click on the shared folder name in the left pane, or, in the Shared Folder setting, indicate that it should auto-mount.

Before doing your implicit mount, did you create the directory /mnt/the-scraper?

Solution 2

What seems to have helped in my case (I needed to remount automounted dir ws with proper user as owner):

  1. Create directory that I wanted to mount it to (/mnt/rews):

    sudo mkdir /mnt/rews
    
  2. Set max permissions to the created dir:

    sudo chown artyhedgehog:artyhedgehog /mnt/rews
    sudo chmod 777 /mnt/rews
    
  3. Got this error when tried mounting:

    $ sudo mount -t vboxsf -o remount,gid=1000,uid=1000,rw ws /mnt/rews     
    /sbin/mount.vboxsf: mounting failed with the error: Invalid argument
    
  4. So I unmounted automount by VirtualBox and mounted back manually - and it worked:

    sudo umount ws
    sudo mount -t vboxsf -o gid=1000,uid=1000,rw ws /mnt/rews        
    

P.S. Windows 10 on host, VirtualBox 6.0.8, Ubuntu 18.04 LTS on VM, VirtualBox Guest Additions installed via VirtualBox instance menu, Shared Folder set up with "Folder Name": ws, "Auto-mount": checked, "Make Permanent": checked.

Share:
19,685

Related videos on Youtube

Nyxynyx
Author by

Nyxynyx

Updated on September 18, 2022

Comments

  • Nyxynyx
    Nyxynyx over 1 year

    I have a folder in my Windows 10 host that needs to be shared with the Ubuntu 17.04 Virtualbox Guest.

    Here's what I did:

    1. Added the windows folder to the VM's Shared Folders Folder Lst (Name: scraper, Auto-mount: Yes, Access: Full, Machine Folder)

    2. Added user to vboxsf group

      sudo usermod -a -G vboxsf scraper

    3. sudo mount -t vboxsf -o uid=1000,gid=1000 scraper /mnt/the-scraper

    and encountered this

    /sbin/mount.vboxsf: mounting failed with the error: No such file or directory
    

    Why is this error happening? How can we solve this?

    • GTRONICK
      GTRONICK almost 7 years
      Add your user to the vboxusers group, then reboot the Host machine. If this doesn't work, try mounting the folder as root, inside the guest.
  • Nyxynyx
    Nyxynyx almost 7 years
    I have not created the directory /mnt/the-scraper. Is this simply mkdir /mnt/the-scraper?
  • Boris Hamanov
    Boris Hamanov almost 7 years
    Yes. Or use sudo if you want the drive mounted as root. And you should probably be using the /media/the-scraper rather than /mnt.
  • Nyxynyx
    Nyxynyx almost 7 years
    After restarting the VM, I dont see the shared folder name in the left panel of Nautilus window.
  • Nyxynyx
    Nyxynyx almost 7 years
    However, after creating the directory /media/the-scraper, the initial mount command that I tried successfully mounted the shared foler
  • Boris Hamanov
    Boris Hamanov almost 7 years
    You can also tell the Shared Folder to auto-mount in the settings.
  • Boris Hamanov
    Boris Hamanov almost 7 years
    In Nautilus, it's called something like sf_scraper.
  • Stephen Boston
    Stephen Boston over 6 years
    It is not necessary to logout. To acquire the group membership just added enter ` $ su - <username>` This will apply only to the terminal session in which you enter the command. To use the rights for other terminal sessions you must repeat the su command. To acquire the rights for the gui session and for all subsequent terminal sessions you must logout/in