What to do when the VirtualBox shared folder cannot be mounted
![]()
table of contents
Hello.
I'm Mandai, in charge of Wild on the development team.
The VirtualBox shared folder is very convenient and I find it very useful.
However, sometimes I suddenly can't mount it, and I don't know what to do, so I end up exchanging files in various other ways.
Recently, I finally found the cause, so I'd like to write down the method I used to deal with
it. When developing game APIs, the production environment is often Linux, so I use a Windows machine, but I still get by by using a VM to create a similar environment.
As for the VM environment, we use VirtualBox, and the VM OS image is generally CentOS
Reinstall the tools from the Level 1 Guest Additions CD
This is the first thing that comes to mind
Although it's a bit old, as mentioned in the article VirtualBox Shared Folder Memo | dark_green's Diary | Slad , this issue often occurs when updating kernel modules using yum etc.
Since it's a VM, can I treat it more roughly?
Select "Insert CD Image" from the "Devices" menu in VirtualBox, and the installation tool will start automatically.
If the CD is already mounted on your desktop, simply double-click the CD icon.
I know it may seem strange to say this after introducing this product, but if it can cure the problem, I wouldn't be so worried
Level 2 Reconfiguring shared folders
This is the solution that has been used in cases in the past where the problem has become visible
This can be done in the VM settings in the VirtualBox Manager,
or if you're in the VM UI, click on the folder icon in the bottom right.
If the directories on both the host and guest sides are set correctly, it may be possible to mount it
Level 3: Replace the mount.vboxsf symbolic link
Finally, the solution that worked this time was to change the destination of the mount.vboxsf symbolic link
What was happening was that the actual entity of mount.vboxsf, which is the mount command for creating a shared folder, was actually different
which mount.vboxsf /sbin/mount.vboxsf ls -al | grep vboxsf mount.vboxsf -> /usr/lib64/VBoxGuestAdditions/mount.vboxsf
This does not mean that the file does not exist; it does exist in the path /usr/lib64/VBoxGuestAdditions/mount.vboxsf
So, what to do about this is,
# cd /sbin sudo ln -sf /usr/lib/VBoxGuestAdditions/mount.vboxsf mount.vboxsf
Simply change the destination of the symbolic link to mount.vboxsf under VBoxGuestAdditions, which is also located under /usr/lib
If it is set to mount automatically, restart the VM and you will see that it is mounted properly using the df command
Since I'm using the 64-bit version of CentOS, I thought /usr/lib64 would be fine, but it seems that's not the case.
I think this might be a problem with the Guest Additions CD installer, but what do you think, Oracle?
This seems to have happened after I updated the kernel module
It seems that updating the VM kernel is risky in many ways
That's it.
3