Skip to main content

Timeline for HyperV - Static Ip with Vagrant

Current License: CC BY-SA 4.0

10 events
when toggle format what by license comment
Nov 30, 2023 at 9:34 vote accept Jazerix
Aug 23, 2021 at 10:23 comment added Florian Boehmak regarding 1) you can specify the default switch in vagrant file: vm_exists = system("powershell.exe", "-Command", "Get-VM -VMNAME #{vm_name} -ErrorAction SilentlyContinue | out-null") if !vm_exists config.vm.network "public_network", bridge: "Default Switch" end github.com/hashicorp/vagrant/issues/8384#issuecomment-548988185
Oct 22, 2019 at 12:21 history edited Ben Johnson CC BY-SA 4.0
Add note to indicate that Google's DNS servers may not be reachable on corporate networks.
Oct 21, 2019 at 21:20 comment added Hildy Ok, for you edification, the issue was that my machine is in a corporate network, and it doesn't seem to allow that Google DNS. I did an ipconfig /all in command, used one of the DNS addresses listed under the adapter my machine is using to plug into the network. Your instructions work otherwise.
Oct 21, 2019 at 19:38 comment added Hildy Using the network script to change the guest OS, then triggering a vagrant reload with :reload works if you use the default switch and set IPADDR with in its range, then set the GATEWAY and DNS1 to both be the Ip of the default switch found with ipconfig on the host. But since the default switche's ip is not static, that's not entirely helpful.
Oct 21, 2019 at 19:04 comment added Hildy Indeed it does.
Oct 21, 2019 at 18:06 comment added Ben Johnson @Hildy The most likely explanation is a network configuration issue in the guest OS. Does Get-VM "your-vm-name" | Get-VMNetworkAdapter show NATSwitch for the SwitchName and {OK} for the Status?
Oct 21, 2019 at 17:04 comment added Hildy I did this, and it does indeed create a VM with a static Ip; but it doesn't have internet access. Any thoughts?
Oct 16, 2019 at 16:01 history edited Ben Johnson CC BY-SA 4.0
Replace my previous Answer with a much more comprehensive and automated solution.
Nov 29, 2018 at 22:05 history answered Ben Johnson CC BY-SA 4.0