About mount errors in vagrants

Asked 2 years ago, Updated 2 years ago, 82 views

When I do vagarntssh, I get the following error:

Failed to mount folders in Linux guest. This is useful cause
The "vboxsf" file system is not available. Please verify that
The guest additions are professionally installed in the guest and
can work properly.The command attempted was:

mount-t vboxsf-ouid=`id-u vagrant`, gid=`getent group vagrant | cut-d:-f3` vagrant/vagrant
mount-t vboxsf-ouid=`id-uvagrant`,gid=`id-g vagrant`vagrant/vagrant

The error output from the last command was:

/sbin/mount.vboxsf:mounting failed with the error:No such device

The following troubleshooting in Qiita does not solve the problem, but
Please let me know if there is anyone else who knows the solution.
http://qiita.com/murachi1208/items/1dea1416ec5729d03632

Terminal

vagrant

2022-09-30 16:54

3 Answers

As far as the error message goes, I thought that some of the gcc and kernel source code were not installed.Why don't you run the following commands on the guest operating system?

 yum-y install gcc kernel-develop-2.6.32-573.7.1.el6.x86_64


2022-09-30 16:54

There are a few possible points.

First, the Vagrant box is supposed to be disposable.If you have trouble, vagrant destroy may be able to solve this problem easily by discarding the current box and re-creating a new one.

Second, try to use the box that is used by as many people as possible.problem prone with little information if you make an out-of-mainstream choice.It is recommended that you choose the mainstream one, especially when you don't know exactly what you are doing.Currently, the most important box in Vagrant is ubuntu/trusty64, and vagrant init ubuntu/trusty64 automatically creates the required Vagrantfile.Unless there is a particular reason, it is recommended to use it.

Third, in principle, install the package from the official leposidori of the dystro you are using. As far as I can see, I have specified a URL starting with http at sudo yum install, which is very dangerous.Typically, package managers like yum automatically install the appropriate version of the package for your environment, but if you specify a URL directly, the package may not fit your environment and the entire system may be corrupted.This time you were trying to install kernel-devel, but this is meaningless if the version does not match the Linux kernel you are using, so it is correct as sudo yum install kernel-devel.Perhaps the guest operating system is CentOS or Fedora, but according to CentOS' official wiki, the following commands can install the required packages:

 sudo yum install dkms
sudo yum group install "Development Tools"
sudo yum install kernel-develop

Fourthly, the contents written on blogs are reference.For better or worse, blogs are posted by people of various levels of knowledge.Therefore, it is possible that the written method may seem to be ad hoc or just accidentally successful.Avoid executing magic spells written on blogs and so on for now.

Finally, important, if you are asking questions such as stack overflow, it is recommended that you describe the environment in which the problem occurred in as much detail as possible.The most important information for this issue is how you created the Vagrantfile.This is as important as the screen when an error occurs.Without this information, other people cannot reproduce the same problem, making it difficult to resolve the problem.Also include the following information as much information as much as possible.

  • Host OS and its version
  • Vagrant Version
  • Virtualbox Version


2022-09-30 16:54

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.