码迷,mamicode.com
首页 > Windows程序 > 详细

Windows 10 + Vagrant + Virtualbox + Homestead

时间:2015-09-06 16:28:40      阅读:291      评论:0      收藏:0      [点我收藏+]

标签:

 Best Answer — Asker‘s Choice

Eldair 

 3,475 PointsPosted 1 month ago

Hello,

New solution:

  1. Install Virtualbox 5 and Vagrant 1.7.4

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

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

  4. Homestead init and/or up

  5. Homestead halt

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

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

  8. 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.


Windows 10 + Vagrant + Virtualbox + Homestead

标签:

原文地址:http://my.oschina.net/qsmoon/blog/501747

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!