Vagrant up 每次都会导致来宾添加重新安装,为什么?

Vagrant up causes guest additions to reinstall each time, why?

我不得不换一台新笔记本电脑 运行 windows 10,所以我安装了最新的 Virtual box (6) 和 vag运行t (2.2.6)。我撤下了我的项目并 运行 一个 vag运行t 建立了盒子并部署了我所有的工作,但是来宾添加存在问题。该盒子是 Centos 7,所以在首次启动后,我对盒子进行了 yum 更新,并将 vag运行t 插件 vbguest 和 hostsupdater 添加到我的本地 vag运行t 安装中。我还必须安装 deltarpms 才能使更新生效。

但是每次我现在启动或重新加载盒子时,它都说缺少 vbguest 工具存在问题。然后 IT 继续卸载 VGA,重新安装相同的版本,然后告诉我它没有正确安装。但是共享文件夹似乎确实有效。我可以做些什么来解决这个上传问题,下面是完整的输出。

PS C:\Users\Paul M\projects\centos-docker> vagrant reload
==> default: [vagrant-hostsupdater] Removing hosts
==> default: Attempting graceful shutdown of VM...
==> default: Checking if box 'bento/centos-7.4' version '201709.15.0' is up to date...
==> 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: Forwarding ports...
    default: 8898 (guest) => 8898 (host) (adapter 1)
    default: 8899 (guest) => 8899 (host) (adapter 1)
    default: 22 (guest) => 2222 (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:2222
    default: SSH username: vagrant
    default: SSH auth method: private key
==> default: Machine booted and ready!
[default] A Virtualbox Guest Additions installation was found but no tools to rebuild or start them.
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * base: mirror.vorboss.net
 * extras: www.mirrorservice.org
 * updates: www.mirrorservice.org
Package kernel-devel-3.10.0-1062.7.1.el7.x86_64 already installed and latest version
Package kernel-devel-3.10.0-1062.7.1.el7.x86_64 already installed and latest version
Package gcc-4.8.5-39.el7.x86_64 already installed and latest version
Package binutils-2.27-41.base.el7_7.1.x86_64 already installed and latest version
Package 1:make-3.82-24.el7.x86_64 already installed and latest version
Package 4:perl-5.16.3-294.el7_6.x86_64 already installed and latest version
Package bzip2-1.0.6-13.el7.x86_64 already installed and latest version
Package elfutils-libelf-devel-0.176-2.el7.x86_64 already installed and latest version
Nothing to do
Copy iso file C:\Program Files\Oracle\VirtualBox/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 6.0.14 - guest version is 6.0.14
Verifying archive integrity... All good.
Uncompressing VirtualBox 6.0.14 Guest Additions for Linux........
VirtualBox Guest Additions installer
Removing installed version 6.0.14 of VirtualBox Guest Additions...
Copying additional installer modules ...
Installing additional modules ...
VirtualBox Guest Additions: Starting.
VirtualBox Guest Additions: Building the VirtualBox Guest Additions kernel
modules.  This may take a while.
VirtualBox Guest Additions: To build modules for other installed kernels, run
VirtualBox Guest Additions:   /sbin/rcvboxadd quicksetup <version>
VirtualBox Guest Additions: or
VirtualBox Guest Additions:   /sbin/rcvboxadd quicksetup all
VirtualBox Guest Additions: Building the modules for kernel
3.10.0-1062.7.1.el7.x86_64.
VirtualBox Guest Additions: Running kernel modules will not be replaced until
the system is restarted
An error occurred during installation of VirtualBox Guest Additions 6.0.14. Some functionality may not work as intended.
In most cases it is OK that the "Window System drivers" installation failed.
Redirecting to /bin/systemctl start vboxadd.service
Redirecting to /bin/systemctl start vboxadd-service.service
Unmounting Virtualbox Guest Additions ISO from: /mnt
==> default: Checking for guest additions in VM...
==> default: [vagrant-hostsupdater] Checking for host entries
==> default: Mounting shared folders...
    default: /vagrant => C:/Users/Paul M/Projects/centos-docker
==> default: Machine already provisioned. Run `vagrant provision` or use the `--provision`
==> default: flag to force provisioning. Provisioners marked to run always will still run.
PS C:\Users\Paul M\projects\centos-docker>

我的同事遇到了完全相同的问题。好像是最新版本的vagrant插件引起的v0.22.0.之前的版本,v0.21.0没有这个问题

Fetching: vagrant-vbguest-0.22.0.gem (100%)
Successfully uninstalled vagrant-vbguest-0.21.0
Updated 'vagrant-vbguest' to version '0.22.0'!

我一更新插件,就重新安装了 vbguest 添加项。

--

更新:

打开了一个问题:https://github.com/dotless-de/vagrant-vbguest/issues/362

--

更新:解决方法 - 安装 0.21

  1. vagrant plugin uninstall vagrant-vbguest
Uninstalling the 'vagrant-vbguest' plugin...
Successfully uninstalled micromachine-3.0.0
Successfully uninstalled vagrant-vbguest-0.22.0
  1. vagrant plugin install vagrant-vbguest --plugin-version 0.21
Installing the 'vagrant-vbguest --version '0.21'' plugin. This can take a few minutes...
Fetching: micromachine-3.0.0.gem (100%)
Fetching: vagrant-vbguest-0.21.0.gem (100%)
Installed the plugin 'vagrant-vbguest (0.21.0)'!

更新:开发者发布了一个更新 - .22.1 : vagrant plugin update 应该给你 v.22.1

如果用户安装了插件(任何版本),您可以将其添加到 Vagrantfile 以避免更新来宾添加。

Vagrant.configure("2") do |config|
  ....
  if Vagrant.has_plugin?("vagrant-vbguest")
    config.vbguest.auto_update = false
  end
  ....
end