我在笔记本电脑上运行Windows 8.1 64位。
我一直在按照本指南尝试为我的Laravel项目设置一个家园:laravel installation and setup
guide tldr:您只需安装vagrant,virtual-box和composer。您使用这些来获取宅基地,然后进行初始化和安装。您配置homestead.yaml并生成ssh密钥。在所有这些之后你使用vagrant up,让vagrant设置你的Vritual机器与你的开发环境和所有的东西。
使用git bash,我按照指南进入' vagrant up'一部分。
这是毛茸茸的地方,我收到以下错误:
$ vagrant up
Bringing machine 'default' up with 'virtualbox' provider...
==> default: Importing base box 'laravel/homestead'...
==> default: Matching MAC address for NAT networking...
==> default: Checking if box 'laravel/homestead' is up to date...
==> default: Setting the name of the VM: homestead
==> default: Clearing any previously set network interfaces...
==> default: Preparing network interfaces based on configuration...
default: Adapter 1: nat
default: Adapter 2: hostonly
==> default: Forwarding ports...
default: 80 => 8000 (adapter 1)
default: 443 => 44300 (adapter 1)
default: 3306 => 33060 (adapter 1)
default: 5432 => 54320 (adapter 1)
default: 22 => 2222 (adapter 1)
==> default: Running 'pre-boot' VM customizations...
==> 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: Warning: Remote connection disconnect. Retrying...
default:
default: Vagrant insecure key detected. Vagrant will automatically replace
default: this with a newly generated keypair for better security.
default:
default: Inserting generated public key within guest...
default: Removing insecure key from the guest if it's present...
default: Key inserted! Disconnecting and reconnecting using new SSH key...
==> default: Machine booted and ready!
==> default: Checking for guest additions in VM...
default: The guest additions on this VM do not match the installed version o
f
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 t
he
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.3.14
default: VirtualBox Version: 5.0
==> default: Setting hostname...
==> default: Configuring and enabling network interfaces...
==> default: Mounting shared folders...
default: /vagrant => C:/Users/Work/Homestead/Homestead
The following SSH command responded with a non-zero exit status.
Vagrant assumes that this means the command failed!
chown `id -u vagrant`:`id -g vagrant` /vagrant
Stdout from the command:
Stderr from the command:
chown: changing ownership of ���/vagrant���: Not a directory
我以管理员身份运行git bash。 我的.yaml文件看起来像这样
---
ip: "192.168.10.10"
memory: 2048
cpus: 1
provider: virtualbox
authorize: C:/Users/Work/.ssh/id_rsa.pub
keys:
- C:/Users/Work/.ssh/id_rsa
folders:
- map: C:/Users/Work/Projects
to: /home/vagrant/Code
sites:
- map: homestead.app
to: /home/vagrant/Code/Laravel/public
databases:
- homestead
variables:
- key: APP_ENV
value: local
我得到了Vagrant和Virtual Box的最新版本。
在我看来,错误来自文件夹无效的路径,但看到我的yaml文件应该是正确的我不明白如何解决它。
我在另一台Windows 8.1固定PC上成功安装了宅基地环境,但我从未遇到过这个错误。
答案 0 :(得分:4)
Mitchell向我们证实这是最新版本中的一个错误,现在已修复:查看此问题及相关提交https://github.com/mitchellh/vagrant/issues/5933
答案 1 :(得分:2)
我刚刚通过了。
vagrant up
,您就是答案 2 :(得分:1)
所以,这就是我实际设法解决它的方法。
Vagrant(1.3.5)和VirtualBox(4.3.4)的最新版本在Windows上根本不能一起播放。所以,我保持Vagrant 1.3.5并转到VirtualBox 4.2.2。
一旦你有了这个,你必须摆脱几个文件夹,以便一切正确地重置:
Users\<<USERNAME>>\.VirtualBox
Users\<<USERNAME>>\.vagrant.d
在尝试运行之前删除它们
vagrant up
有了这个,我就能让一切都恢复正常。但是,我注意到流浪汉的运行速度确实比以前慢一点。我可以忍受这个。 感谢您的所有帮助和建议。
答案 3 :(得分:1)
如果您收到此消息,请尝试在主机上匹配VirtualBox版本,这将解决问题。
默认值:此VM上的guest虚拟机添加项与安装的版本不匹配 默认:VirtualBox!在大多数情况下这很好,但在极少数情况下它可以 默认值:防止共享文件夹等工作正常。如果你看到 默认:共享文件夹错误,请确保在其中添加客人 默认值:虚拟机与您安装的VirtualBox版本匹配 默认:您的主机并重新加载您的VM。 默认: 默认值:访客添加版本:4.3.10 默认值: VirtualBox版本:5.0
答案 4 :(得分:0)
不是百分百肯定,但看起来似乎是,流浪汉试图映射它的默认&#34; / vagrant&#34;文件夹到您当地的C:/ Users / Work / Homestead / Homestead。如果本地不存在或存在一些权限错误,则不会创建/ vagrant并且其上的下一个命令将失败。看看是否创建了C:/ Users / Work / Homestead / Homestead。而且我也没有在你的yaml中看到这种映射。 / vagrant =&gt; C:/用户/工作/泰德/宅基。你的配置是不是被某些东西覆盖了?