带有 Vagrant 的 FreeBSD - 不知道如何检查来宾添加版本

zab*_*mba 6 virtualbox freebsd vagrant

在 Mac OS X 10.9.3 上

VagrantCloud 中挑选了一个盒子

初始化流浪箱

$ vagrant init chef/freebsd-9.2-i386

A `Vagrantfile` has been placed in this directory. You are now
ready to `vagrant up` your first virtual environment! Please read
the comments in the Vagrantfile as well as documentation on
`vagrantup.com` for more information on using Vagrant.
Run Code Online (Sandbox Code Playgroud)

列出文件

$ ls -al
-rw-r--r--  1 joel  staff  4831 Jun  5 17:17 Vagrantfile
Run Code Online (Sandbox Code Playgroud)

流浪文件内容

VAGRANTFILE_API_VERSION = "2"

Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
  config.vm.box = "chef/freebsd-9.2-i386"
end
Run Code Online (Sandbox Code Playgroud)

启动我的虚拟盒子会导致错误

$ vagrant up

Bringing machine 'default' up with 'virtualbox' provider...
==> default: Box 'chef/freebsd-9.2-i386' could not be found. Attempting to find and install...
    default: Box Provider: virtualbox
    default: Box Version: >= 0
==> default: Loading metadata for box 'chef/freebsd-9.2-i386'
    default: URL: https://vagrantcloud.com/chef/freebsd-9.2-i386
==> default: Adding box 'chef/freebsd-9.2-i386' (v1.0.0) for provider: virtualbox
    default: Downloading: https://vagrantcloud.com/chef/freebsd-9.2-i386/version/1/provider/virtualbox.box
==> default: Successfully added box 'chef/freebsd-9.2-i386' (v1.0.0) for 'virtualbox'!
==> default: Importing base box 'chef/freebsd-9.2-i386'...
==> default: Matching MAC address for NAT networking...
==> default: Checking if box 'chef/freebsd-9.2-i386' is up to date...
==> default: Setting the name of the VM: freebsd92-i386_default_1401982167145_49633
==> default: Fixed port collision for 22 => 2222. Now on port 2201.
==> default: Clearing any previously set network interfaces...
==> default: Preparing network interfaces based on configuration...
    default: Adapter 1: nat
==> default: Forwarding ports...
    default: 22 => 2201 (adapter 1)
==> default: Booting VM...
==> default: Waiting for machine to boot. This may take a few minutes...
    default: SSH address: 127.0.0.1:2201
    default: SSH username: vagrant
    default: SSH auth method: private key
    default: Warning: Connection timeout. Retrying...
    default: Warning: Connection timeout. Retrying...
==> default: Machine booted and ready!
Sorry, don't know how to check guest version of Virtualbox Guest Additions on this platform. Stopping installation.
==> 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: 4.2.16
    default: VirtualBox Version: 4.3
==> default: Mounting shared folders...
    default: /vagrant => /Users/joel/Code/anybots/operations/robot/freebsd92-i386
Vagrant attempted to execute the capability 'mount_virtualbox_shared_folder'
on the detect guest OS 'freebsd', but the guest doesn't
support that capability. This capability is required for your
configuration of Vagrant. Please either reconfigure Vagrant to
avoid this capability or fix the issue by creating the capability.
Run Code Online (Sandbox Code Playgroud)

请注意,我最近安装了最新版本的 VirtualBox,但不知何故我找不到 Guest Additions。

Jep*_*hir 4

出现该错误是因为 Vagrant 尝试使用 VirtualBox 共享文件夹,但 FreeBSD 不支持这一点。相反,将 Vagrant 配置为使用 NFS:

VAGRANTFILE_API_VERSION = "2"

Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
    config.vm.box = "chef/freebsd-10.0"
    config.vm.network "private_network", type: "dhcp"
    config.vm.synced_folder ".", "/vagrant", type: "nfs"
end
Run Code Online (Sandbox Code Playgroud)