您的位置:首页 > 其它

Windows 10 + Vagrant + Virtualbox + Homestead

2015-09-06 15:38 323 查看
Best Answer — Asker's Choice

Eldair
— 3,475 PointsPosted 1 month ago

Hello,
New solution:

Install Virtualbox 5 and Vagrant 1.7.4

Comment line 17: config.vm.network :private_network, ip: settings["ip"] ||= "192.168.10.10" in homestead.rb

Comment line 64: b.use ClearNetworkInterfaces in action.rb (path ~\HashiCorp\Vagrant\embedded\gems\gems\vagrant-1.7.4\plugins\providers\virtualbox\action.rb)

Homestead init and/or up

Homestead halt

In Virtualbox preferences -> network -> host-only networks edit existing Host-Only adapter and add 192.168.10.10 as IP address

Select homestead box in Virtualbox and go to settings -> network -> adapter 2 and select Host-only network (the one edited in step above)

Homestead up, provision

P.S. I don't know why, but I had to add :8000 to alias urls in browser to get them to open pages.
Edit: the :8000 can be avoided if you change default port forwarding 80 => 80 instead of 80 => 8000 in homestead.rb or go to settings of your box -> network settings -> adapter 1 (nat) and port forwarding option, and there is port 80 forwarded to port 8000, change 8000 to 80 and that's it.
And it's working (: Cheers
UPDATE Alternative solution by @pdcmoreira:
I found a VERY SIMPLE way to make it work without touching any file in the accepted answer!
Install and run this file: https://www.virtualbox.org/attachment/ticket/14040/VBox-Win10-fix-14040.exe (leave it running in the background) Go to the C:\Program Files\Oracle\VirtualBox folder, right click on VirtualBox.exe, go to compatibility, check the "Run in compatibility mode" checkbox and choose Windows 7. Click OK to close the window. Repeat step 2. for VBoxManage.exe and VBoxHeadless.exe Run cmd and do homestead up. There you go! It should work!
After all is done and working, close the program opened in step 1.
[UPDATED]
You don't need to run cmd as Administrator in step 4.
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: