【问题标题】:Test kitchen fails to install VirtualBox Guest Additions 4.3.28测试厨房无法安装 VirtualBox Guest Additions 4.3.28
【发布时间】:2015-09-27 05:10:13
【问题描述】:

我在使用厨房创建同步文件夹时遇到问题。最新版本的 Virtualbox Guest Additions (2.3.8) 似乎有问题

运行后:

$ kitchen converge

我明白了:

Downloading VirtualBox Guest Additions ISO from http://download.virtualbox.org/virtualbox/4.3.28/VBoxGuestAdditions_4.3.28.iso
Copy iso file /home/rocker/.vagrant.d/tmp/VBoxGuestAdditions_4.3.28.iso into the box /tmp/VBoxGuestAdditions.iso
mount: /dev/loop0 is write-protected, mounting read-only
Installing Virtualbox Guest Additions 4.3.28 - guest version is 4.3.20
Verifying archive integrity... All good.
Uncompressing VirtualBox 4.3.28 Guest Additions for Linux............
VirtualBox Guest Additions installer
Removing installed version 4.3.20 of VirtualBox Guest Additions...
Copying additional installer modules ...
Installing additional modules ...
Removing existing VirtualBox non-DKMS kernel modules[  OK  ]
Building the VirtualBox Guest Additions kernel modules
Building the main Guest Additions module[FAILED]
(Look at /var/log/vboxadd-install.log to find out what went wrong)
Doing non-kernel setup of the Guest Additions[  OK  ]
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.28. Some functionality may not work as intended.
In most cases it is OK that the "Window System drivers" installation failed.
Cleaning up downloaded VirtualBox Guest Additions ISO...
Restarting VM to apply changes...
==> default: Attempting graceful shutdown of VM...
==> 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: Warning: Connection timeout. Retrying...
==> default: Machine booted and ready!
==> default: Checking for guest additions in VM...
==> default: Setting hostname...
==> default: Configuring and enabling network interfaces...
==> default: Mounting shared folders...
    default: /home/vagrant/sync => /home/rocker/environments/chef-repo/mediacenter/data
STDERR: 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` home_vagrant_sync /home/vagrant/sync
mount -t vboxsf -o uid=`id -u vagrant`,gid=`id -g vagrant` home_vagrant_sync /home/vagrant/sync

这是我的 .kitchen.yml

---
driver:
    name: vagrant
    synced_folders:
        - ["data", "/home/vagrant/sync"]

provisioner:
    name: chef_solo
    cookbooks_path: "/home/rocker/environments/chef-repo/cookbooks"

platforms:
    - name: cento7
      driver:
        box: centos7
        box_url: http://opscode-vm-bento.s3.amazonaws.com/vagrant/virtualbox/opscode_centos-7.0_chef-provisionerless.box
        network:
        - ["private_network", {ip: "192.168.38.34"}]
        customize:
            memory: 1536

suites:
    - name: server
      run_list:
        - recipe[chef-server::default]
      attributes:

如果我删除这部分:

synced_folders:
    - ["data", "/home/vagrant/sync"]

VirtualBox Guest Additions 仍然失败,但不会停止收敛过程。

如果我使用 learningchef centos 6.5 图片框也会出现同样的情况:

    box: learningchef/centos65
    box_url: learningchef/centos65

我在网上做了一些研究,它似乎解决了很多人使用的问题:

$ vagrant plugin install vagrant-vbguest

所以安装 Vagrant Virtualbox 来宾插件。 我可以以某种方式将其插入测试厨房生命周期而不是手动执行此步骤吗?

编辑: 此外,生成的 Vagrantfile 如下所示:

Vagrant.configure("2") do |c|
  c.berkshelf.enabled = false if Vagrant.has_plugin?("vagrant-berkshelf")
  c.vm.box = "centos7"
  c.vm.box_url = "http://opscode-vm-bento.s3.amazonaws.com/vagrant/virtualbox/opscode_centos-7.0_chef-provisionerless.box"
  c.vm.hostname = "server-cento7"
  c.vm.network(:private_network, {:ip=>"192.168.38.34"})
  c.vm.synced_folder ".", "/vagrant", disabled: true
  c.vm.synced_folder "/home/rocker/environments/chef-repo/mediacenter/data", "/home/vagrant/sync", nil
  c.vm.provider :virtualbox do |p|
    p.customize ["modifyvm", :id, "--memory", "1536"]
  end
end

非常感谢任何建议。

【问题讨论】:

  • 这与其说是避免不如说是一个解决方案,但可以尝试使用已安装来宾添加的盒子。如果您还不熟悉,这里是site。此外,vagrant 插件是全局的,所以一旦你安装了它,你就不需要再为同一台机器上的其他项目这样做了。
  • 是的,那行得通。如果您提出答案,我可以将您的作为解决方案
  • 非常感谢。这行得通!

标签: vagrant chef-infra chef-solo test-kitchen


【解决方案1】:

您可以完全避免这个问题,只需使用一个已经安装了来宾添加的盒子。您可以浏览 3rd 方框 here。很有可能会有一个您可以使用。

此外,vagrant 插件是全局的,所以一旦你安装了它,你就不需要再为同一台机器上的其他项目这样做了。

(从评论升级为回答)

【讨论】:

  • 谢谢,我安装了其中一个盒子并更新了所有内容$ sudo yum update;还安装 linux 内核头文件有助于来宾添加安装。
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 2017-06-23
  • 1970-01-01
  • 1970-01-01
  • 2014-12-14
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多