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

Pau*_*l M 8 virtualbox vagrant virtualbox-guest-additions

我不得不搬到一台运行 Windows 10 的新笔记本电脑上,所以我安装了最新的 Virtual box (6) 和 vagrant (2.2.6)。我拉下我的项目并运行一个流浪者来构建盒子并部署我的所有工作,但是来宾添加存在问题。盒子是 Centos 7,所以在第一次启动后,我对盒子进行了 yum 更新,并在我的本地 vagrant 安装中添加了 vagrant 插件 vbguest 和 hostsupdater。我还必须安装 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>
Run Code Online (Sandbox Code Playgroud)

Agi*_*lis 10

我的同事遇到了完全相同的问题。好像是最新版的 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'!
Run Code Online (Sandbox Code Playgroud)

一旦我更新了插件,就会重新安装 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
Run Code Online (Sandbox Code Playgroud)
  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)'!
Run Code Online (Sandbox Code Playgroud)

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

  • @PaulM 该解决方法似乎对其他人有效,但对于我的同事来说,他使用与我相同版本的组件,即使使用 0.21 也无法阻止来宾添加的重新安装。有关此问题的更多信息可以在我上面链接的问题中找到。 (2认同)

bba*_*iee 6

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

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