流浪错误:无法在Linux guest虚拟机中挂载文件夹


277

我对Vagrant共享文件夹有一些问题,我的基本系统是Ubuntu 13.10桌面。

我不明白为什么我有此错误,但配置不正确?是NFS问题还是Virtualbox Guest Additions?我尝试使用不同的许多盒子,但问题相同。

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

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

以下是完整的过程vagrant up

$ vagrant up
Bringing machine 'default' up with 'virtualbox' provider...
==> default: Importing base box 'u131032'...
==> default: Matching MAC address for NAT networking...
==> default: Setting the name of the VM: vagrant_default_1396020504136_46442
==> default: Clearing any previously set forwarded ports...
==> default: Clearing any previously set network interfaces...
==> default: Preparing network interfaces based on configuration...
    default: Adapter 1: nat
    default: Adapter 2: hostonly
==> default: Forwarding ports...
    default: 22 => 2222 (adapter 1)
==> default: Running 'pre-boot' VM customizations...
==> default: Booting VM...
==> default: Waiting for machine to boot. This may take a few minutes...
    default: SSH address: 127.0.0.1:2222
    default: SSH username: vagrant
    default: SSH auth method: private key
    default: Error: Connection timeout. Retrying...
    default: Error: Remote connection disconnect. Retrying...
    default: Error: Remote connection disconnect. Retrying...
    default: Error: Remote connection disconnect. Retrying...
    default: Error: Remote connection disconnect. Retrying...
    default: Error: Remote connection disconnect. Retrying...
    default: Error: Remote connection disconnect. Retrying...
    default: Error: Remote connection disconnect. Retrying...
    default: Error: Remote connection disconnect. Retrying...
    default: Error: Remote connection disconnect. Retrying...
    default: Error: Remote connection disconnect. Retrying...
    default: Error: Remote connection disconnect. Retrying...
    default: Error: Remote connection disconnect. Retrying...
==> default: Machine booted and ready!
GuestAdditions versions on your host (4.3.10) and guest (4.2.16) do not match.
 * Stopping VirtualBox Additions
   ...done.
Reading package lists...
Building dependency tree...
Reading state information...
The following packages were automatically installed and are no longer required:
  dkms libdrm-intel1 libdrm-nouveau2 libdrm-radeon1 libfontenc1
  libgl1-mesa-dri libglapi-mesa libice6 libllvm3.3 libpciaccess0 libpixman-1-0
  libsm6 libtxc-dxtn-s2tc0 libxaw7 libxcomposite1 libxdamage1 libxfixes3
  libxfont1 libxkbfile1 libxmu6 libxpm4 libxrandr2 libxrender1 libxt6
  x11-common x11-xkb-utils xfonts-base xfonts-encodings xfonts-utils
  xserver-common xserver-xorg-core
Use 'apt-get autoremove' to remove them.
The following packages will be REMOVED:
  virtualbox-guest-dkms* virtualbox-guest-utils* virtualbox-guest-x11*
0 upgraded, 0 newly installed, 3 to remove and 0 not upgraded.
After this operation, 11.1 MB disk space will be freed.
(Reading database ... 65615 files and directories currently installed.)
Removing virtualbox-guest-dkms ...

-------- Uninstall Beginning --------
Module:  virtualbox-guest
Version: 4.2.16
Kernel:  3.11.0-18-generic (i686)
-------------------------------------

Status: Before uninstall, this module version was ACTIVE on this kernel.

vboxguest.ko:
 - Uninstallation
   - Deleting from: /lib/modules/3.11.0-18-generic/updates/dkms/
 - Original module
   - No original module was found for this module on this kernel.
   - Use the dkms install command to reinstall any previous module version.


vboxsf.ko:
 - Uninstallation
   - Deleting from: /lib/modules/3.11.0-18-generic/updates/dkms/
 - Original module
   - No original module was found for this module on this kernel.
   - Use the dkms install command to reinstall any previous module version.


vboxvideo.ko:
 - Uninstallation
   - Deleting from: /lib/modules/3.11.0-18-generic/updates/dkms/
 - Original module
   - No original module was found for this module on this kernel.
   - Use the dkms install command to reinstall any previous module version.

depmod....

DKMS: uninstall completed.

------------------------------
Deleting module version: 4.2.16
completely from the DKMS tree.
------------------------------
Done.
Removing virtualbox-guest-x11 ...
Purging configuration files for virtualbox-guest-x11 ...
Removing virtualbox-guest-utils ...
Purging configuration files for virtualbox-guest-utils ...
Processing triggers for ureadahead ...
Processing triggers for man-db ...
Reading package lists...
Building dependency tree...
Reading state information...
dkms is already the newest version.
dkms set to manually installed.
linux-headers-3.11.0-18-generic is already the newest version.
linux-headers-3.11.0-18-generic set to manually installed.
The following packages were automatically installed and are no longer required:
  libdrm-intel1 libdrm-nouveau2 libdrm-radeon1 libfontenc1 libgl1-mesa-dri
  libglapi-mesa libice6 libllvm3.3 libpciaccess0 libpixman-1-0 libsm6
  libtxc-dxtn-s2tc0 libxaw7 libxcomposite1 libxdamage1 libxfixes3 libxfont1
  libxkbfile1 libxmu6 libxpm4 libxrandr2 libxrender1 libxt6 x11-common
  x11-xkb-utils xfonts-base xfonts-encodings xfonts-utils xserver-common
  xserver-xorg-core
Use 'apt-get autoremove' to remove them.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Copy iso file /usr/share/virtualbox/VBoxGuestAdditions.iso into the box /tmp/VBoxGuestAdditions.iso
mount: block device /tmp/VBoxGuestAdditions.iso is write-protected, mounting read-only
Installing Virtualbox Guest Additions 4.3.10 - guest version is 4.2.16
Verifying archive integrity... All good.
Uncompressing VirtualBox 4.3.10 Guest Additions for Linux............
VirtualBox Guest Additions installer
Copying additional installer modules ...
Installing additional modules ...
Removing existing VirtualBox DKMS kernel modules ...done.
Removing existing VirtualBox non-DKMS kernel modules ...done.
Building the VirtualBox Guest Additions kernel modules ...done.
Doing non-kernel setup of the Guest Additions ...done.
Starting the VirtualBox Guest Additions ...done.
Installing the Window System drivers
Could not find the X.Org or XFree86 Window System, skipping.
An error occurred during installation of VirtualBox Guest Additions 4.3.10. Some functionality may not work as intended.
In most cases it is OK that the "Window System drivers" installation failed.
==> default: Checking for guest additions in VM...
==> default: Setting hostname...
==> default: Configuring and enabling network interfaces...
==> default: Exporting NFS shared folders...
==> default: Preparing to edit /etc/exports. Administrator privileges will be required...
nfsd running
sudo: /usr/bin/exportfs: command not found
==> default: Mounting NFS shared folders...
==> default: Mounting shared folders...
    default: /vagrant => /home/me/Documents/Work/project/vagrant
Failed to mount folders in Linux guest. This is usually because
the "vboxsf" file system is not available. Please verify that
the guest additions are properly installed in the guest and
can work properly. The command attempted was:

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

我的Vagrantfile配置为:

# -*- mode: ruby -*-
# vi: set ft=ruby :

# Vagrantfile API/syntax version. Don't touch unless you know what you're doing!
VAGRANTFILE_API_VERSION = "2"

personalization = File.expand_path("../Personalization", __FILE__)
load personalization

Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
  config.vm.box = $base_box
  config.vm.box_url = $base_box_url

  config.vm.hostname = $vhost + ".dev"

  config.hostsupdater.aliases = ["api." + $vhost + ".dev", "mysql." + $vhost + ".dev"]
  config.hostsupdater.remove_on_suspend = true

  # set auto_update to ture to check the correct 
  # additions version when booting the machine
  config.vbguest.auto_update = true
  config.vbguest.auto_reboot = true

  config.vm.network :private_network, ip: $ip

  config.vm.synced_folder "../", "/srv/www/vhosts/" + $vhost + ".dev", type: "nfs"

  config.vm.provider :virtualbox do |v|
    v.customize ["modifyvm", :id, "--memory", 2048]
    v.customize ["modifyvm", :id, "--cpus", "1"]
    v.customize ["modifyvm", :id, "--cpuexecutioncap", "100"]
    v.customize ["modifyvm", :id, "--ioapic", "off"]
    v.customize ["modifyvm", :id, "--natdnshostresolver1", "on"]
  end

  config.vm.provision "shell" do |s|
    s.path = "vagrant-bootstrap.sh"
    s.args = $vhost + " " + $mysql_password + " " + $application_database
  end
end

个性化文件为:

# Name of the vhost to create
$vhost = "project"

# Use the Ubunut 32bit or 64bit
$base_box_url = "http://cloud-images.ubuntu.com/vagrant/saucy/current/saucy-server-cloudimg-i386-vagrant-disk1.box"

# VM IP
$ip = "192.168.7.7"

# Base box name
$base_box = "u131032"

# MySQL
$mysql_password = "admin"
$application_database = "project"

在Vagrant中启用了以下插件:

$ vagrant plugin list
vagrant-hostsupdater (0.0.11)
vagrant-login (1.0.1, system)
vagrant-share (1.0.1, system)
vagrant-vbguest (0.10.0)

更新虚拟盒子后,这个问题也发生在我身上5.1.20。这种情况让我每次更新VM时都感到担心,因为这不是第一次:(
GusDeCooL

@GusDeCooL你可能会关闭客户附加的自动更新与config.vbguest.auto_update = false在Vagrantfile
亨里克

Answers:


356

插件vagrant-vbguest 解决了我的问题:的GitHub 红宝石

$ vagrant plugin install vagrant-vbguest

输出:

$ vagrant reload
==> default: Attempting graceful shutdown of VM...
...
==> default: Machine booted and ready!
GuestAdditions 4.3.12 running --- OK.
==> default: Checking for guest additions in VM...
==> default: Configuring and enabling network interfaces...
==> default: Exporting NFS shared folders...
==> default: Preparing to edit /etc/exports. Administrator privileges will be required...
==> default: Mounting NFS shared folders...
==> default: VM already provisioned. Run `vagrant provision` or use `--provision` to force it

只要确保您正在运行最新版本的VirtualBox


我正在使用vagrant-vbguest插件,但这在我更新为VirtualBox-4.3.12-9之前并没有为我解决任何问题。
mkirk

5
这是唯一为我解决的问题。完成此操作后,来宾VboxAdditions将更新,并与我的主机匹配。而且我们一切顺利。我只需要在来宾和主机上维护相同的版本。感谢指针@karlingen
Rixhers Ajazi 2014年

1
安装插件后,我开始遇到此问题。卸载它不能解决问题。
Yamiko

13
jee通过发布这种单线飞机,我本可以节省大约20个小时的谷歌搜索,重新配置等工作……您的“只要给我买个啤酒纽扣”就在哪里?
Yordan Georgiev

1
当心,如果您允许该插件(几乎默认),它将导致几乎相同的问题github.com/dotless-de/vagrant-vbguest/issues/141config.vbguest.auto_update = true
KCD

231

我发现这个问题在这里流浪了。有两种方法:

  1. 在guest虚拟机上运行此程序(即,通过ssh进入vbox之后vagrant ssh

    sudo ln -s /opt/VBoxGuestAdditions-4.3.10/lib/VBoxGuestAdditions /usr/lib/VBoxGuestAdditions
    

    然后运行vagrant reload以正确安装文件夹。

  2. 正如@klang指出的那样,更新Mac上的VBoxGuestAdditions.iso文件:

    wget https://www.virtualbox.org/download/testcase/VBoxGuestAdditions_4.3.11-93070.iso‌​
    sudo cp VBoxGuestAdditions_4.3.11-93070.iso /Applications/VirtualBox.app/Contents/MacOS/VBoxGuestAdditions.iso
    

更新(2014年5月16日)

由于iso不再可用,因此可以使用4.3.12之一(http://dlc.sun.com.edgesuite.net/virtualbox/4.3.12/VBoxGuestAdditions_4.3.12.iso

注意:os X的二进制vbox4.3.12目前不可用


5
之后,您可能只需要重新进行流浪汉重新加载共享文件夹
d4nt 2014年

3
有谁知道将其包含在VagrantFile中的方法,以便在安装驱动器之前执行它?
杰森·奥斯汀

3
@JasonAustin github.com/mitchellh/vagrant/issues/3341 wget https://www.virtualbox.org/download/testcase/VBoxGuestAdditions_4.3.11-93070.iso; sudo cp VBoxGuestAdditions_4.3.11-93070.iso /Applications/VirtualBox.app/Contents/MacOS/VBoxGuestAdditions.iso ..之后,您照常营业。
巴生2014年

5
使用Win 7带有Vagrant 1.3.5和的框VirtualBox 4.3.10,答案1对我不起作用。我仍然遇到unable to mount ...错误
Kevin Meredith 2014年

3
推荐的修补程序是方法一,如最初在此处发布。该URL在方案二的ISO文件不再有效和404抛出
colinhoernig

49

我到达此页面时正在寻找相同的错误消息。对我来说,原因是不同的:我在yum update安装了新内核的系统上运行过。来宾添加项已过期,因此无法加载它们。

我用

sudo /etc/init.d/vboxadd setup 

vagrant reload后来我的客人是重新启动和运行。

我只是在这里添加它,以防其他人以与我相同的方式到达这里。

编辑(根据KCD的评论):
您可能会收到一条错误消息:

找不到当前正在运行的内核的标头

可以通过安装kernel-develyum install kernel-devel)来解决


3
谢谢。我忘了我跑了yum update。我保留此评论,以便Future Austin在再次发生这种情况时可以找到它。
奥斯汀2015年

1
而且我在ubuntu中运行了apt-get更新,并在以后再次发生这种情况时留下评论:-)
skift 2015年

现在和未来的卢瓦克只是感谢你:)(忘了我跑了yum update太)
卢瓦克米

它可能无法说出来The headers for the current running kernel were not found并询问您要yum install kernel-devel进行的工作
KCD

1
我还必须安装gcc才能使其正常工作。总结一下:1)yum install kernel-devel-$(uname -r) 和2)yum install gcc; 最后,退出VM并执行vagrant reload。这是在Centos 7 Vagrant盒子上(bento / centos-7.1)
JDS 2015年

29

逐步解决:

如果您没有vbguest插件,请安装它:

$ vagrant plugin install vagrant-vbguest

游民游

显示错误。

$ vagrant up

登录虚拟机

$ vagrant ssh

固定!

在来宾中(已记录VM)。

$ sudo ln -s /opt/VBoxGuestAdditions-4.3.10/lib/VBoxGuestAdditions /usr/lib/VBoxGuestAdditions

返回主机,重新加载Vagrant

$ vagrant reload

我认为这是最好,最透明的解决方案
Mateusz Odelga

这是可行的,但是在Fedora 22中,我不得不vagrant ssh进入包装盒并做sudo ln -s /etc/dnf/dnf.conf /etc/yum.conf,因为Fedora从yum切换到dnf。这样,事情就完成了(我想!)。谢谢@dadaso。
JZ

14

2016年2月更新

这花了我几个小时来独立解决。是的,最新的Vagrant和Virtual Box安装仍然存在此问题:

△  vagrant -v
Vagrant 1.8.1
△  vboxmanage -v
5.0.14r105127

对我来说,症状是类似以下消息:

Checking for guest additions in VM... The guest additions on this VM do not match the installed version of VirtualBox!

其次是无法挂载NFS驱动器。

1)。安装vagrant-vbguest插件。

根据您使用的Vagrant版本,发出以下命令之一:

# For vagrant < 1.1.5
$ vagrant gem install vagrant-vbguest

# For vagrant 1.1.5+
$ vagrant plugin install vagrant-vbguest

接下来,执行vagrant halt,然后执行vagrant up-可能还有问题。

2)。ssh进入您的访客,并设置一个指向正确版本的访客添加项(此处为5.0.14)的软链接。

$ vagrant ssh

$ sudo ln -s /opt/VBoxGuestAdditions-5.0.14/lib/VBoxGuestAdditions /usr/lib/VBoxGuestAdditions
$ exit

$ vagrant reload

你们一切都好。默认情况下,来宾上已安装的驱动器位于/vagrant

最后评论:

如果仍然存在与安装NFS驱动器有关的问题,那么这是对我有用的解决方法。我有一个vagrantfile类似的配置:

只需删除安装类型信息,并精简mount_options设置,它们就可以通用。现在,Vagrant将自动为您的环境选择最佳同步文件夹选项。


2
谢谢您的配合...您的vagrantfile配置丢失了,尽管在最后一段之前-您是否有机会将其重新添加?
Phil Gyford '16

这仍然对我不起作用。我下载了一个新的Vagrant。vboxmanage已经显示了上面的版本。OP推荐的软链接已经存在。
托尼·恩尼斯

1
您的Vagrantfile配置在哪里?您的答案中缺少它。
Aboelseoud

12

通过运行以下命令来安装vagrant-vbguest插件:

vagrant plugin install vagrant-vbguest

6

我认为Centos 7遇到了相同的问题,我认为这是由于内核已过时以及VirtualBox的更新版本所致。根据Blizz的更新,这对我有用(已经安装了vagrant-vbguest插件):

vagrant ssh
sudo yum -y install kernel-devel
sudo yum -y update
exit
vagrant reload --provision

5

对我来说,使用VBoxGuestAdditions 5.1.20,问题是/sbin/mount.vboxsf指向错误的位置。

sudo ln -sf /opt/VBoxGuestAdditions-5.1.20/lib/VBoxGuestAdditions/mount.vboxsf /sbin/mount.vboxsf

为我修复


我不是Vagrant用户,但是在OSX主机上运行的Fedora Core来宾上也遇到了同样的问题。我认为问题在于的位置mount.vboxsf已更改,但安装程序正在符号链接到旧位置。
Teddy

这是访客添加5.1.20中的一个已确认错误:virtualbox.org/ticket/16670
Max Smolens


3

我相信这是最新的答案,现在,它的工作对我来说(Guest Additions Version: 5.0.6VirtualBox Version: 4.3.16Ubuntu 14.04 LTS

https://github.com/mitchellh/vagrant/issues/3341#issuecomment-144271026

基本上我说:

Simple and Quick Solution for Failed to mount folders in Linux guest issue.

Add the following line to your Homestead/Vagrantfile:

config.vbguest.auto_update = false
Your Homestead/Vagrantfile should looks like this:

/...

Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|

   # To avoid install and uninstall VBoxGuessAdditions during vagrant provisioning.
    config.vbguest.auto_update = false

.../
Save it and execute

$ vagrant destroy --force
$ vagrant up

3
可能要注意的是,“无用销毁”会破坏您的VM,其中包括您在其中配置/安装的所有内容,除非我弄错了。
CargoMeister

这对我来说是唯一,最快的解决方案。从此处开始在“ Ubuntu精确64 VirtualBox”映像上出现问题。Windows上的VirtualBox 5.1.2和Vagrant 1.8.5。
Jamin

3

仅供参考,我使用Vagrant 1.7.4和VirtualBox 5.0.10 r104061发生了此问题,当时我在其中配置了共享文件夹/并创建了指向我的主文件夹的符号链接。像这样:

/folder
~/folder -> /folder

显然,出于安全目的,Vagrant不允许此操作,并且会抛出所描述的错误。

通过将所需的文件夹直接设置到我的主目录(例如)中,我解决了该问题/home/vagrant/folder


1
非常感谢。这也是我的问题。
Sarcastron '16

1
正确,/我的Vagrant版本(1.8.1)中都不允许使用共享文件夹
Amedee Van Gasse

2

就我之前使用的Ubuntu 16.04映像而言,在为另一个无用的映像安装vagrant-vbguest之后,启动Ubuntu VM之后,错误开始。它将来宾添加项升级到5.1.20,此后挂载开始失败。更新了该框,进行了apt update + upgrade,同样,vbguest将安装更新的5.1.20版本。

通过手动运行解决了该问题:

sudo apt-get update
sudo apt-get install virtualbox-guest-dkms 

config.vbguest.auto_update = false 为此虚拟机禁用:(可能没有必要)。


确实有完全一样的问题。忽略有关访客和主机版本不匹配的警告,并关闭自动更新。
Henrik

1

(根据我上面的评论)

将问题追根溯源:,特别是在注释中这样说的部分:

wget https://www.virtualbox.org/download/testcase/VBoxGuestAdditions_4.3.11-93070.iso‌​ 
sudo cp VBoxGuestAdditions_4.3.11-93070.iso /Applications/VirtualBox.app/Contents/MacOS/VBoxGuestAdditions.iso

完成之后,我所有的虚拟机(当然还有它们的当前Vagrantfile)都照常营业。

当您必须在新创建的虚拟机中执行某项操作以使其工作时,这是错误的。


1
如果您使用的是Linux,我想您必须将文件复制到/usr/share/virtualbox/VBoxGuestAdditions.iso。但是我没有测试!
tsusanka 2014年

1

在Windows是主机,Linux是来宾的配置中,我在其他地方发现了相同问题的解决方案。

同样,错误消息是“无法在Linux guest虚拟机中安装文件夹。这通常是因为“ vboxsf”文件系统不可用。(...)

这是由于我在来宾系统内部从/ vagrant到/ home / vagrant / vagrant进行了符号链接而犯了一个错误。关键是,目录/ vagrant是具有符号链接的正常linux目录(因此一切正常),但是通过“ vagrant up”启动时,它将尝试在该位置挂载Windows目录,而Windows目录无法像符号链接。Windows主机不支持linux符号链接。

因此,您可以做的就是将ssh转换为guest,在任何有符号链接的地方删除它,然后重新加载计算机。

在我的配置中,它是:Vagrant 1.7.2,VBoxGuestAdditions 4.3.28和VBox 4.3.28。


1

这是2017年。以防万一有人遇到相同的问题。

对于bento / centos-6.7,我遇到了同样的错误。通过添加插件vagrant-vbguest(0.13.0)解决了该问题。c:> vagrant插件安装vagrant-vbguest

方块网址:http//opscode-vm-bento.s3.amazonaws.com/vagrant/virtualbox/opscode_centos-7.0_chef-provisionerless.box

这个centos-7版本给了我同样的错误

错误:

==> build: Mounting shared folders...
    build: /vagrant => C:/projects/
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 vagrant /vagrant

The error output from the command was:

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

我的配置:

C:\projects>vagrant -v
Vagrant 1.9.1

C:\projects> vboxmanage -v
5.0.10r104061

C:\projects>vagrant plugin list
vagrant-cachier (1.2.1)
vagrant-hostmanager (1.8.5)
vagrant-hosts (2.8.0)
vagrant-omnibus (1.5.0)
vagrant-share (1.1.6, system)
vagrant-vbguest (0.13.0)
vagrant-vbox-snapshot (0.0.10)

由于我已经有了vagrant-vbguest插件,因此当主机5.0.10和guest虚拟机4.3.20中安装了不同版本的VBGuestAdditions时,它将尝试在centos-7中更新VBoxGuestAdditions。

我什至检查过符号链接是否存在。

[root@build VBoxGuestAdditions]# ls -lrt /usr/lib
lrwxrwxrwx.  1 root root   53 Jan 14 12:06 VBoxGuestAdditions -> /opt/VBoxGuestAdditions-5.0.10/lib/VBoxGuestAdditions
[root@build VBoxGuestAdditions]# mount -t vboxsf -o uid=1000,gid=1000 vagrant /vagrant
/sbin/mount.vboxsf: mounting failed with the error: No such device

这没有按照user3006381的建议工作

vagrant ssh
sudo yum -y install kernel-devel
sudo yum -y update
exit
vagrant reload --provision

centos-7的解决方案:如psychok7所述

禁用的自动更新。 config.vbguest.auto_update = false 然后vagrant destroy --force,然后vagrant up

结果:

javareport: Guest Additions Version: 4.3.20
javareport: VirtualBox Version: 5.0
==> javareport: Setting hostname...
==> javareport: Configuring and enabling network interfaces...
==> javareport: Mounting shared folders...
javareport: /vagrant => C:/projects

C:\project>

对我来说是2017年,但仍然有此错误。您的修复看起来很有希望。我会尽力回报。
Eric Hepperle-CodeSlayer2010 '17

1

到目前为止,安装可以在某些机器上(ubuntu)进行,而在某些机器上(centos 7)可以,但是安装插件可以解决问题

vagrant plugin install vagrant-vbguest

无需在此之上做任何其他事情,

vagrant reload

0

您的日志抱怨没有找到exportfs: sudo: /usr/bin/exportfs: command not found

exportfs使本地目录可供NFS客户端挂载。


1
我已经sudo: /usr/bin/exportfs: command not found通过使用命令将符号链接设置为实际路径来解决有关问题sudo ln -s /usr/sbin/exportfs /usr/bin/exportfs,但是Failed to mount folders in Linux guest即使在此之后,仍然存在错误。
Ek Kosmos 2014年

0

这似乎是由于与vbguest vagrant插件和vagrant的最新版本不兼容。它正在尝试更新来宾添加项,但没有完全/正确地执行此操作。


2
据我所知,vagrant-vbguest可以正确地将虚拟机更新为最新的(4.3.10)GuestAdditions-不幸的是,最新的GuestAdditions对于Linux guest虚拟机有一个错误。
iheggie 2014年

0

尝试一下:

vagrant plugin install vagrant-vbguest

在Vagrantfile中添加:

config.vbguest.iso_path = "http://download.virtualbox.org/virtualbox/VERSION/VBoxGuestAdditions_VERSION.iso"
config.vbguest.auto_update = false
config.vbguest.installer_arguments = %w{--nox11 -- --force}

跑:

vagrant vbguest --do install -f -b

vagrant reload

0

我在VirtualBox 5.1.X上运行Vagrant,不得不降级到VirtualBox 5.0.40,然后安装vbguest插件来解决此问题。

我的步骤是:

  • 卸载VirtualBox 5.1.X
  • 安装Vagrant 5.0.40
  • 重新启动我的机器
  • vagrant up为我的游民奔跑。它会失败。
  • vagrant plugin install vagrant-vbguest在我的VM 运行时运行,以安装vagrant插件。这可以管理主机和来宾之间的VirtualBox来宾版本同步。
  • 运行vagrant reload以重新加载我的虚拟机
  • 魔法!

-1

在遵循kenzie提出的第一个建议之后,我还必须完成一个步骤,即使用Ubuntu命令行[14.04 Server] 运行mount错误消息中列出sudo的命令。在那之后,一切都很好!


相反,应该运行vagrant reload
杰罗德
By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.