在我的Macbook上,我正在使用VirtualBox + Vagrant。对于Vagrant,我下载了VagrantPress(来自vagrantpress.org),这是一个带有Wordpress和一些Puppet脚本的Vagrantfile。它看起来像这样:
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant.configure("2") do |config|
config.vm.box = "base"
config.vm.box_url = "http://cloud-images.ubuntu.com/vagrant/precise/current/precise-server-cloudimg-amd64-vagrant-disk1.box"
config.vm.network :forwarded_port, guest: 80, host: 8080
config.vm.provision :puppet do |puppet|
puppet.manifests_path = "puppet/manifests"
puppet.module_path = "puppet/modules"
puppet.manifest_file = "init.pp"
puppet.options="--verbose --debug"
end
end
首先,这是按预期运行(在localhost上查看Wordpress安装),但是我将它安装在Dropbox子目录上,并且在尝试让它在另一台运行Ubuntu的计算机上运行时,我可能有改变了破坏整个设置的东西。
现在,当我的macbook上运行'Vagrant up'时(曾经运行良好),我看到了:
Bringing machine 'default' up with 'virtualbox' provider...
[default] Clearing any previously set forwarded ports...
[default] Creating shared folders metadata...
[default] Clearing any previously set network interfaces...
[default] Preparing network interfaces based on configuration...
[default] Forwarding ports...
[default] -- 22 => 2222 (adapter 1)
[default] -- 80 => 8080 (adapter 1)
[default] Booting VM...
GuestAdditions versions on your host (4.2.18) and guest (4.1.12) do not match.
Reading package lists...
Building dependency tree...
Reading state information...
dkms is already the newest version.
dkms set to manually installed.
linux-headers-3.2.0-54-generic is already the newest version.
linux-headers-3.2.0-54-generic set to manually installed.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Copy iso file /Applications/VirtualBox.app/Contents/MacOS/VBoxGuestAdditions.iso into the box /tmp/VBoxGuestAdditions.iso
mount: warning: /mnt seems to be mounted read-only.
Installing Virtualbox Guest Additions 4.2.18 - guest version is 4.1.12
Verifying archive integrity... All good.
Uncompressing VirtualBox 4.2.18 Guest Additions for Linux............
VirtualBox Guest Additions installer
You appear to have a version of the VBoxGuestAdditions software
on your system which was installed from a different source or using a
different type of installer. If you installed it from a package from your
Linux distribution or if it is a default part of the system then we strongly
recommend that you cancel this installation and remove it properly before
installing this version. If this is simply an older or a damaged
installation you may safely proceed.
Do you wish to continue anyway? [yes or no]
Cancelling installation.
An error occurred during installation of VirtualBox Guest Additions 4.2.18. Some functionality may not work as intended.
[default] Waiting for machine to boot. This may take a few minutes...
[default] Machine booted and ready!
[default] The guest additions on this VM do not match the installed version of
VirtualBox! In most cases this is fine, but in rare cases it can
cause things such as shared folders to not work properly. If you see
shared folder errors, please update the guest additions within the
virtual machine and reload your VM.
Guest Additions Version: 4.1.12
VirtualBox Version: 4.2
[default] Mounting shared folders...
[default] -- /vagrant
[default] -- /tmp/vagrant-puppet/manifests
[default] -- /tmp/vagrant-puppet/modules-0
Chrome上的和localhost说“没有收到数据”。 在那之后,我'Vagrant ssh'并跑了:
curl 'http://localhost/'
并获得:
cURL Error (7): couldn't connect to host ...
我一直试图解决这个问题好几天了。我甚至尝试重新安装Vagrant和VirtualBox,但它没有用。 此外,我尝试手动更新Guest Additions(虽然之前没有必要),并在获得'GuestAdditions 4.2.18运行---确定后'。启动VM后,我仍然会收到localhost的相同错误。 我做错了什么?
答案 0 :(得分:0)
如果我理解您的设置正确,您可能需要在主机系统上尝试http://localhost:8080/
(以便与来宾上的端口80连接)。
在来宾操作系统中,您确定网络服务器正在运行吗?它可能不会自动启动。
另外,我认为您可以忽略Guest Additions版本不匹配。这可能与您所看到的问题无关。