如何在homestead.yaml中修复IP Homestead

时间:2019-11-06 10:57:14

标签: networking vagrant ip homestead

我在hyper-v中使用宅基。 流浪者盒子运行良好。

但是。 IP地址每次都更改。

我在Homestead.yaml文件中修复了IP地址。但不起作用。

我用

  • 窗口10
  • Hyper-v
  • 无用的2.2.6

我尝试增加10倍的无所事事...

homestead.yaml

ip: "192.168.10.10"
memory: 2048
cpus: 2
provider: hyperv 

无用消息。

PS C:\Users\hi\dev\homestead> vagrant up
Bringing machine 'homestead' up with 'hyperv' provider...
==> homestead: Verifying Hyper-V is enabled...
==> homestead: Verifying Hyper-V is accessible...
    homestead: Configuring the VM...
==> homestead: Starting the machine...
==> homestead: Waiting for the machine to report its IP address...
    homestead: Timeout: 120 seconds
    homestead: IP: 172.17.76.38
==> homestead: Waiting for machine to boot. This may take a few minutes...
    homestead: SSH address: 172.17.76.38:22
    homestead: SSH username: vagrant
    homestead: SSH auth method: private key
==> homestead: Machine booted and ready!

hyper-v机器的IP是172.17.76.38 ...

如何修复???

2 个答案:

答案 0 :(得分:0)

我建议切换到VirtualBox或VMware。如Vagrant的official website

所述,您的问题是Hyper-V提供程序的局限性的一部分

答案 1 :(得分:0)

只需安装 Vagrant Host Manager Plug-in,然后您就可以使用主机名 homestead 进行连接,而无需查找 IP 地址。

您可以按照此 guide 获取非常详细的分步说明。