If you are messing around with Vagrant and VirtualBox, you will sometimes end up with a vm where the /vagrant shared file system does not mount properly. Vagrant complains that the vboxsf kernel module is not loaded properly and gives you a mount command to run manually. When you try to mount it manually with
sudo mount -t vboxfs -o uid=500,gid=500 vagrant /vagrantYou get this error:
/sbin/mount.vboxsf: mounting failed with the error: No such deviceAccording to this page, you have to reinstall the VBox guest additions with this command:
cd /opt/VBoxGuestAdditions-*/initHowever, for a generic box, it fails because gcc and the kernel sources are not installed. So when you run into this problem on a Centos 6 box (specifically, a vm based on the bento/centos-6.8 vagrant box), here is the exact sequence of commands that fixes the problem:
sudo ./vboxadd setup
cd /opt/VBoxGuestAdditions-*/initThen rerun the special mount command to mount the /vagrant file system.
sudo yum install gcc make kernel-devel
sudo ./vboxadd setup
No comments:
Post a Comment