LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Virtualization and Cloud (https://www.linuxquestions.org/questions/linux-virtualization-and-cloud-90/)
-   -   Can't mount shared folder - Virtualbox - Ubuntu 18 Guest OS - With Guest Addition (https://www.linuxquestions.org/questions/linux-virtualization-and-cloud-90/cant-mount-shared-folder-virtualbox-ubuntu-18-guest-os-with-guest-addition-4175644844/)

swilsy 12-23-2018 03:20 PM

Can't mount shared folder - Virtualbox - Ubuntu 18 Guest OS - With Guest Addition
 
Hello all,

I am having trouble mounting a shared folder on my guest OS using Virtualbox. My host OS is Windows 10 and my guest OS is Ubuntu 18 Desktop. I created the shared folder in the Virtualbox settings. I tried both automount and not. Virtualbox Guest Addition 5.2.22 is installed on the guest OS and appears to be working. When I run
Code:

sudo mount -t vboxsf sharedfoldername ~/Desktop/sharedfolder
I get the following error.
Code:

wrong fs type, bad option, bad superblock on VirtualShared, missing codepage or helper program, or other error.
I found this error all over the internet, but the solution is always to install the guest addition which I already have. I've tried updating my guest OS, but no luck.

michaelk 12-23-2018 07:02 PM

Is vboxfs a valid filesystem i.e check the output of the command.

cat /proc/filesystems

Have you restarted the guest?

swilsy 12-24-2018 10:56 AM

Yes, vboxsf is listed in /proc/filesystems.

Yes, I have tried restarting the guest OS several times.

michaelk 12-24-2018 12:30 PM

Forgot to ask if vboxadd-service is running. I just installed Ubuntu 18.04 as a guest under Windows 7 running VirtualBox 5.2.22 and shared folders works. Without knowing exactly how your system is configured from the default it is difficult to determine why isn't working.

Just as a side note the latest Windows 10 update laptop appears to have broken the guest dhcp clients in networking bridged mode but shares folders still works.

swilsy 12-24-2018 02:45 PM

I tried running
Code:

service --status-all
and I do not see vboxadd or anything like it listed.

I tried
Code:

sudo service vboxadd start
and
Code:

sudo service vboxadd-service start
Both of these return
Code:

Failed to start vboxadd-service.service: Unit vboxadd-service.service not found.
It sounds like this is might be my problem. Any idea how to get the service installed and running? My graphics are adjusted properly and I see the VBox_GAs_5.2.22 mounted as a cd on the desktop.

michaelk 12-24-2018 02:59 PM

Open a terminal window and cd to the directory which should be /media/VBox_GAs_5.2.22 (or something like that). Run the command
sudo ./VboxGuestAdditions.run (whatever its named...) and see what happens.

You need to install the gcc, kernel headers and dkms first in order for Guest Additions to compile and install.
sudo apt install build-essential dkms linux-headers-$(uname -r)

swilsy 12-24-2018 06:54 PM

That did it. After running ./VboxGuestAdditions.run the share is working. I turned off auto-mount in the Virtualbox options and added an entry to fstab to mount the shared directory to a folder on my desktop with my uid and gid. Without this, it automatically mounts with the user and group as root. I also had trouble editing with gedit one a text file was altered on the host OS. To solve this, I installed Notepad3. This seems to work great.


All times are GMT -5. The time now is 03:18 PM.