OSx - VirtualBox v5.2 - Vagrant 无法挂载 VirtualBox 共享文件夹

OSx - VirtualBox v5.2 - Vagrant 无法挂载 VirtualBox 共享文件夹

vagrant up在安装新任务附加内容期间

安装 Virtualbox Guest Additions 5.2.0 - 客户版本为 5.1.30

但它显示了这个错误:

安装 VirtualBox Guest Additions 5.2.0 时发生错误。某些功能可能无法按预期工作。在大多数情况下,“Window 系统驱动程序”安装失败是正常的。

如何解决这个问题?

使用以下设置:

  • Mac OS-X Sierra 版本 10.12.6
  • VirtualBox 版本 5.2.0 r118431(Qt5.6.3)
  • Vagrant 版本 2.0.0

另请参阅这些详细信息

$ vagrant --version
Vagrant 2.0.0
$ vagrant plugin list
vagrant-aws (0.7.2)
  - Version Constraint: > 0
vagrant-share (1.1.9, system)
  - Version Constraint: > 0
vagrant-vbguest (0.15.0)
  - Version Constraint: > 0

输出的完整详细信息如下。

$ vagrant up --provider=virtualbox
Bringing machine 'default' up with 'virtualbox' provider...
==> default: Importing base box 'bento/ubuntu-16.04'...
==> default: Matching MAC address for NAT networking...
==> default: Checking if box 'bento/ubuntu-16.04' is up to date...
==> default: Setting the name of the VM: vagrant-ubuntu-1604_default_1509481785760_74033
==> default: Fixed port collision for 22 => 2222. Now on port 2200.
==> default: Clearing any previously set network interfaces...
==> default: Preparing network interfaces based on configuration...
    default: Adapter 1: nat
==> default: Forwarding ports...
    default: 22 (guest) => 2200 (host) (adapter 1)
==> default: Booting VM...
==> default: Waiting for machine to boot. This may take a few minutes...
    default: SSH address: 127.0.0.1:2200
    default: SSH username: vagrant
    default: SSH auth method: private key
    default: Warning: Remote connection disconnect. Retrying...
    default: Warning: Connection reset. Retrying...
    default: Warning: Remote connection disconnect. Retrying...
    default: Warning: Connection reset. Retrying...
    default: Warning: Remote connection disconnect. Retrying...
    default: Warning: Connection reset. Retrying...
    default: 
    default: Vagrant insecure key detected. Vagrant will automatically replace
    default: this with a newly generated keypair for better security.
    default: 
    default: Inserting generated public key within guest...
    default: Removing insecure key from the guest if it's present...
    default: Key inserted! Disconnecting and reconnecting using new SSH key...
==> default: Machine booted and ready!
[default] GuestAdditions versions on your host (5.2.0) and guest (5.1.30) do not match.
Reading package lists...
Building dependency tree...
Reading state information...
dkms is already the newest version (2.2.0.3-2ubuntu11.5).
The following NEW packages will be installed:
  linux-headers-4.4.0-87 linux-headers-4.4.0-87-generic
0 upgraded, 2 newly installed, 0 to remove and 0 not upgraded.
Need to get 10.7 MB of archives.
After this operation, 78.0 MB of additional disk space will be used.
Get:1 http://archive.ubuntu.com/ubuntu xenial-updates/main amd64 linux-headers-4.4.0-87 all 4.4.0-87.110 [9,892 kB]
Get:2 http://archive.ubuntu.com/ubuntu xenial-updates/main amd64 linux-headers-4.4.0-87-generic amd64 4.4.0-87.110 [785 kB]
dpkg-preconfigure: unable to re-open stdin: No such file or directory
Fetched 10.7 MB in 5s (1,977 kB/s)
Selecting previously unselected package linux-headers-4.4.0-87.
(Reading database ... 35843 files and directories currently installed.)
Preparing to unpack .../linux-headers-4.4.0-87_4.4.0-87.110_all.deb ...
Unpacking linux-headers-4.4.0-87 (4.4.0-87.110) ...
Selecting previously unselected package linux-headers-4.4.0-87-generic.
Preparing to unpack .../linux-headers-4.4.0-87-generic_4.4.0-87.110_amd64.deb ...
Unpacking linux-headers-4.4.0-87-generic (4.4.0-87.110) ...
Setting up linux-headers-4.4.0-87 (4.4.0-87.110) ...
Setting up linux-headers-4.4.0-87-generic (4.4.0-87.110) ...
Examining /etc/kernel/header_postinst.d.
run-parts: executing /etc/kernel/header_postinst.d/dkms 4.4.0-87-generic /boot/vmlinuz-4.4.0-87-generic
Copy iso file /Applications/VirtualBox.app/Contents/MacOS/VBoxGuestAdditions.iso into the box /tmp/VBoxGuestAdditions.iso
Mounting Virtualbox Guest Additions ISO to: /mnt
mount: /dev/loop0 is write-protected, mounting read-only
Installing Virtualbox Guest Additions 5.2.0 - guest version is 5.1.30
Verifying archive integrity... All good.
Uncompressing VirtualBox 5.2.0 Guest Additions for Linux........
VirtualBox Guest Additions installer
Removing installed version 5.1.30 of VirtualBox Guest Additions...
Copying additional installer modules ...
Installing additional modules ...
VirtualBox Guest Additions: Building the VirtualBox Guest Additions kernel modules.
VirtualBox Guest Additions: Look at /var/log/vboxadd-setup.log to find out what went wrong
VirtualBox Guest Additions: Running kernel modules will not be replaced until the system is restarted
VirtualBox Guest Additions: Starting.
VirtualBox Guest Additions: modprobe vboxsf failed
An error occurred during installation of VirtualBox Guest Additions 5.2.0. Some functionality may not work as intended.
In most cases it is OK that the "Window System drivers" installation failed.
Job for vboxadd-service.service failed because the control process exited with error code. See "systemctl status vboxadd-service.service" and "journalctl -xe" for details.
Unmounting Virtualbox Guest Additions ISO from: /mnt
==> default: Checking for guest additions in VM...
    default: The guest additions on this VM do not match the installed version of
    default: VirtualBox! In most cases this is fine, but in rare cases it can
    default: prevent things such as shared folders from working properly. If you see
    default: shared folder errors, please make sure the guest additions within the
    default: virtual machine match the version of VirtualBox you have installed on
    default: your host and reload your VM.
    default: 
    default: Guest Additions Version: 5.1.30
    default: VirtualBox Version: 5.2
==> default: Mounting shared folders...
    default: /vagrant => /Users/tjeerd/git/vagrant/vagrant-ubuntu-16.04
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:

: No such device

答案1

所有新的 Virtualbox Guest Additions 安装成功后。Avagrant reload确实成功设置了挂载。

相关内容