lavabit / robox

The tools needed to robotically create/configure/provision a large number of operating systems, for a variety of hypervisors, using packer.
620 stars 139 forks source link

Unable to mount virtualbox shared folders in ubuntu2004 guests #216

Closed eugmes closed 2 years ago

eugmes commented 2 years ago

Trying to mount a shared folder inside an ubuntu2004 guest (version 3.4.2) fails with the following message:

Vagrant was unable to mount VirtualBox shared folders. This is usually
because the filesystem "vboxsf" is not available. This filesystem is
made available via the VirtualBox Guest Additions and kernel module.
Please verify that these guest additions are properly installed in the
guest. This is not a bug in Vagrant and is usually caused by a faulty
Vagrant box. For context, the command attempted was:

mount -t vboxsf -o uid=1000,gid=1000 minicoin /minicoin

The error output from the command was:

/sbin/mount.vboxsf: mounting failed with the error: Invalid argument

The vboxsf module is loaded inside the guest, but it seems outdated. It seems to be included into kernel packages:

$ dpkg --search vboxsf.ko
linux-modules-5.4.0-42-generic: /lib/modules/5.4.0-42-generic/kernel/virtualbox-guest/vboxsf.ko
linux-modules-5.4.0-81-generic: /lib/modules/5.4.0-81-generic/kernel/virtualbox-guest/vboxsf.ko

Installing virtualbox-guest-dkms fixes the problem after reboot:

$ sudo apt install virtualbox-guest-dkms
timschumi commented 2 years ago

Seems like this was an issue with Ubuntu's kernel build.

According to the matching bug report the issue got fixed with kernel 5.4.0-83, and 5.4.0-84 is already in the public repository, so this will be fixed when the next set of boxes is built.

ladar commented 2 years ago

Yup, this broke my packer build process at one point and was fixed. Please reopen if it's still an issue.