Forum Discussion
Bala Sundaram
Sep 24, 2018Brass Contributor
Hyper-V Default switch IP address range change. Ver 1809 Build 17763.1
Can one confirm IP address range changed to 192.168.X.Y Subnet 255.255.255.240 from 172.X.X.X Also changes the subnet randomly on every Hyper-V services startup. 192.168.X.Y . X can change from 5...
HotCakeX
Sep 11, 2019MVP
Well normally those who virtualize servers for real life uses have at least one gigabit Ethernet port, that's the least i can say. the norm is 10 GBit Ethernet(s). not WIFI. and they are always-on connections. that's why we don't see server admins complain about this Hyper-V feature because the proper way would be to create 1-on-1 links between Physical and Virtual network adapters using External virtual network adapter.
I totally understand your situation, sometimes you have to switch between WiFi and Ethernet because it's a laptop, portable and so on.
you can still create persistent routes in the Window's routing table and make the default virtual network adapter's IP address stick even after reboots.
Btw, you Don't have to change anything in the Guest OS if you change your active network adapter from WiFi to Ethernet. all you need to do is to go to Hyper-V's virtual switch manager, go to the external adapter and change the external network from the drop down list. the guest OS shouldn't need any further changes if it has already given a static IP address from the same subnet.
I totally understand your situation, sometimes you have to switch between WiFi and Ethernet because it's a laptop, portable and so on.
you can still create persistent routes in the Window's routing table and make the default virtual network adapter's IP address stick even after reboots.
Btw, you Don't have to change anything in the Guest OS if you change your active network adapter from WiFi to Ethernet. all you need to do is to go to Hyper-V's virtual switch manager, go to the external adapter and change the external network from the drop down list. the guest OS shouldn't need any further changes if it has already given a static IP address from the same subnet.
mlmathews
Sep 11, 2019Brass Contributor
I figured out how to create a new NAT internal switch with a static IP. It can be done via Powershell: Using a NAT Virtual Switch with Hyper-V
These are the commands I used to re-create the 192.168.5.X NAT network like I had in VMware Workstation:
New-VMSwitch -SwitchName “NATSwitch” -SwitchType Internal
New-NetIPAddress -IPAddress 192.168.5.1 -PrefixLength 24 -InterfaceAlias “vEthernet (NATSwitch)”
New-NetNAT -Name “NATNetwork” -InternalIPInterfaceAddressPrefix 192.168.5.0/24
I knew there must be a way since my scenario is very common in software development. There's just no way to do it in the Hyper-V Switch Manager GUI.
I have no use for the Default Switch now, but it doesn't appear to be remove-able...at least not without some registry hacking.
- HotCakeXFeb 04, 2020MVPI think the best thing that should be done is to send feedbacks using any way, preferably Feedback hub, then share it with others who have the same problem to upvote it so that Microsoft will change that behavior on their end in future Windows 10 releases.
- GeoIT1150Feb 04, 2020Copper Contributor
HotCakeX
Very informative thread for this newb. Like many, I'd consider the behavior of the default switch a bug and not an enhancement.
1) Installed automatically (not optional).
2) Can't be removed.3) Can't be modified.
4) No persistent state except unconfigured.
5) Defaults to "Public" on a Domain machine and reconfiguration of state doesn't stick.
VBox and VMWare user attempting to learn Hyper-V and decipher the lack of logic in the above configuration.
Because it's "Public" or doesn't allow the option of a network type selection the Default Switch kills PowerShell WinRM and MS Admin Center on my domain, even when all VMs are using a second manually configured external switch and there is nothing using it - it's still in the registry in the default default configuration after reboot and PowerShell DSC is useless with the Default Switch registering.
I've read the arguments that it's "for amateurs" etc and there to make networking easy. My experience is exactly the opposite, that it's inexplicably configured to keep professionals from accomplishing their work. It breaks workflows that would otherwise be successful and that is a substantive meaning of a 'bug' in the software.
I've temporarily gone back to VMWare, which works flawlessly managing my virtual lab because default switch just doesn't work in my situation.
If someone can, please help me find workarounds to the 5 points above I'd greatly appreciate both your time and the knowledge. Very frustrating to have a simple configuration be this difficult to get working.
FYI - problems listed above are on 1909.
Thanks - HotCakeXJan 01, 2020MVPSneeze what?
- Barafu_Albino_CheetahJan 01, 2020Copper Contributor
- HotCakeXJan 01, 2020MVPWell I have the best AV, Kaspersky Internet security, with bunch of virtual switches including the default switch, everything is working perfectly.
you should contact your AV website and tell them this problem of yours.
my suggestion is to use an AV that is the best and doesn't have these problems.
https://www.youtube.com/channel/UCKGe7fZ_S788Jaspxg-_5Sg
https://www.youtube.com/watch?v=UDkllzL1gqo - Barafu_Albino_CheetahDec 31, 2019Copper Contributor
Using anything will not make Default Switch to disappear. It confuses my AV even when no virtual machines are running.
- HotCakeXDec 30, 2019MVPHi,
Try using External virtual adapter instead of the default switch if you can 🙂 - Barafu_Albino_CheetahDec 30, 2019Copper Contributor
I have another silly problem with this default switch. Since it changes its parameters all the time, my antivirus every time thinks it is a new network, and asks me what to do with it. It causes distractions, but the worst part is that it blocks all network on boot until I answer, causing network disks to not mount, which causes unrelated apps to not load properly and so on.
I am trying to figure it out with AV support, but I doubt they will resolve it soon, so I will have to use less optimal antivirus on my PC.
- HotCakeXDec 08, 2019MVPThanks for the useful info, btw i also got the Killer e2200 GbE NIC
anyway, yeah Hyper-V has it's own issues. I recently got bored and switched to VMware workstation pro 15.5 (latest ver) and I had so many problems configuring it.
I had to turn off Windows defender application guard, Windows Sandbox, Core isolation in Windows defender and literally lots of compromise in order to only install it.
after that I had problem with Windows 10 Enterprise x64 IoT version when i tried installing VMware tools on it, i was getting error that prevented me to install it.
so i eventually uninstalled it, turned on all of those security features again and continued using Hyper-V. i know it's not perfect but the alternative is a lot worse, at least for me.
I just hope Microsoft hear us and apply the changes we are asking to the way Hyper-V handles virtual network adapters. - LuxZgDec 08, 2019Copper Contributor
HotCakeX Here I had another chance on completely unrelated PC (different hardware, different location, different networking settings and environment, different users, not in domain, etc.) Same set of initial errors.
Trying to create external switch in GUI:
"Error applying Virtual Switch Properties changes
Adding ports to the switch 'External Switch' failed
The operation was passed a parameter that was not valid."Trying via PowerShell command ("New-VMSwitch -Name "External VirtualSwitch" -NetAdapterName "Killer e2200 GbE NIC" -AllowManagementOS $True"):
"New-VMSwitch : Failed while adding virtual Ethernet switch connections.
External Ethernet adapter 'Killer e2200 Gigabit Ethernet Controller #2' is already bound to the Microsoft Virtual Switch protocol."So I tried "easy" solution first, and in NIC Properties unchecked option:
"Hyper-V Extensible Virtual Switch"
(And rebooted PC)Luckily, on this PC when I tried to create external switch in GUI after reboot everything went ok. Didn't have to use the "nuke" option this time.
But still, quite annoying. And (at least in my case) on PCs that I regularly use I have all of them throwing this or that error. I love MS, but sometimes I hate it as well...
Cheers!
- HotCakeXDec 02, 2019MVPGood to know you found a solution, even though it's not that pleasant.
i agree default switch should be optional, not everyone want to use the quick VM creation of Hyper-V. - LuxZgDec 02, 2019Copper Contributor
HotCakeX It seems you are right, I'm sorry... But it seems that Microsoft still has a related bug, as I had (and have) the same issue on multiple PCs, and looking at Microsoft forums, I'm not alone.
There are several errors when trying to create External adapter, in my case, always on newer Win10 with Default Switch present (Windows 10 version 1709 or newer), so I (maybe mistakenly?) believe these to be related.
First error:
"the operation was passed an invalid parameter"
Complementary error (from Powershell's New-VMSwitch commandlet):
"Adapter is already bound to the Microsoft Virtual Switch protocol"
Proposed solutions:
Network and Sharing (Win7)/Network (Win 10) Change adapter settings/options Right-click Local Area Connection Go to Properties Scroll to the bottom of the list Uncheck "Hyper-V Extensible Virtual Switch" option
Alternative:
The nuclear option that works with Windows Core is using netcfg to wipe out all your networking settings and re-initialize the network card drivers. #WARNING! DANGER! THIS WILL DELETE ALL YOUR NETWORKING SETTINGS! netcfg -d
Second error, after I did uncheck Hyper-V from my physical NIC and rebooted:Tried to create External switch via PowerShell again
New-VMSwitch -Name "External VirtualSwitch" -NetAdapterName "Ethernet" -AllowManagementOS $True
Error:
"bind failed: {Access Denied} A process has requested access to an object, but has not been granted those access rights"
Proposed solutions:
Hi, I solved this by: In PowerShell type: netcfg -d This WILL DELETE all network adapters AND network SETTINGS! Physical adapters will NOT be LOST. Then i restored my network settings and created new External Virtual Switches.
So since both errors proposed "netcfg -d" I did that, rebooted, naturally now I have two Default Switches that I will just need to ignore, but now I can create External Switch without errors (both in GUI and PoSh), and use them as usual (pre-Win10/1709 times).
I do still stand by the fact that a) Default Switch should be OPTIONAL (can be setup as default behavior, but should have option to be removed) and b) that Microsoft somehow at the same/similar time introduced related bugs that provoke issues with creation of External switches.
I'm kinda happy now that I have my External switch running again, and will just have to live with the unneeded default switches lingering there in the background forever. Maybe you didn't have issues for a mix of reasons (maybe you did not upgrade all the way from initial Win10, or maybe you have other inactive adapters that are poluted by this bug but you don't use them so never noticed, or - you're just lucky).
Hopefully the links to two threads and the copied proposed solutions will help someone somewhere when they pop onto this thread through web search, if it helps just one more person I'll be happy.
Cheers!
- HotCakeXNov 28, 2019MVPDon't worry, I didn't forget anything.
I have 1 active network adapter and I connect that 1 network adapter to an external virtual network adapter and use it on my VM. no other adapter has connection. default switch never shows any error or prevent from creating an external network adapter and connect it to your only physical network adapter that has Internet.
if you don't want your IP to be reset every time, use the External virtual network adapter. - LuxZgNov 28, 2019Copper Contributor
Guy, kudos for dragging this conversation for so long... And I see each has their own set of arguments.
But what HotCakeX keeps forgetting is to tell the whole truth about his setup, and whole truth (and main issues) with DefaultSwitch.
Yes, DefaultSwitch is all fine for my granny to put a VM on her Win10 and put it online. But what is not ok is:
- that DefaultSwitch permanently grabs one ethernet connection for it's own purposes
- this connection may well be only one, for example, on workstation PC which isn't on WiFi, and doesn't have 2 LAN adapters
- cannot be removed
- prevents you from setting up second virtual switch / adapter on same interface as it is already binded to DefaultSwitch
- no workaround as DefaultSwitch keeps recreating itself on each reboot (so if you remove it, it will be there next reboot, if you disable it, it will be re-enabled, etc)
All is good, I have several clusters I can use to put VMs on them, with all dedicated connections, and all. But sometimes I just want/need to use a small VM on my PC, and I want it to KEEP the IP addresses same through reboots. There is simply NO REASON for it to be recreated every time, my local networks don't change, if 172.18.123.15 isn't conflicting on one reboot, it's not gonna conflict on next reboot. Yet - Win10 will still recreate it if I reboot, and with new IP range. There is also NO REASON for DefaultSwitch to be unremovable. We had Hyper-V before Default Switch, and on client PCs, and it worked just fine. Sure, make DefaultSwitch default config, my grandma really likes showing CentOS on her VMs from time to time, but give the option for REAL USERS (aka developers, sysadmins, etc) to remove/disable the DefaultSwitch garbage and use Hyper-V same way we've used it for years on our PCs. Instead, we have to keep Googling and hoping something will change with time. Or just endure the bad state of things, and use "real servers" just so we can have a small VM for whatever purposes we need it.
Btw, those that want to evaluate software sometimes want to make a small proof of concept on their workstation, without it requiring 2 more teams to allow you to a) put these VMs on their clusters b) create temporary networks for you to test something for a week or two.
Let me go back to the main thing that hurts a lot of people... HotCakeX you said you have your whole setup with home router and cheap 20$ WiFi adapter... yet you are forgetting to tell people that you also have second built-in adapter that you have in same PC/laptop. One that DefaultSwitch grabbed and "polluted" forever, and then you are using a 20$ adapter as your external adapter. That's paying 20$ for Microsoft's decision to make DefaultSwitch UNREMOVABLE.
Anyway, thanks for again confirming that MS still didn't fix this properly (and will probably stay broken as is), I'll revisit this in a year or so again, just to check if I can finally get back to the functionality I had with Windows 7, without buying new adapters, setting up new test WiFi environments, laying down new cables or buying new switches, just so my workstation could have a VM with ... predictable IP.
- mlmathewsNov 22, 2019Brass Contributor
GlaucomaPredator I have not found a way to permanently delete the Default Switch. I've been just ignoring it for now.
- GlaucomaPredatorNov 21, 2019Copper Contributor
mlmathews The problem is not being able to destroy the old switch. How did you manage that?
- marshalismsSep 28, 2019Copper ContributorYou are my hero! I have been fighting this since I setup hyper v on windows 10 a couple of days ago. I was dropping packets left and right once I started my virtual machine. Thank you!!
- HotCakeXSep 12, 2019MVPIt's not.
- HotCakeXSep 12, 2019MVPYeah as you said it's off topic so i have no interest in discussing containers.
but as i said, using double NATs won't let servers be accessible from the Internet. specially if it's a nested virtualization that I use mostly. - mlmathewsSep 12, 2019Brass Contributor
HotCakeX I'm not intending to argue with you and what I'm about to say is not directly related to the original topic of this thread, but you might be surprised at what's being done in "real-life" networking scenarios these days. The reason I switched from VMware to Hyper-V on my dev machine is because I need to work with Window Containers and Docker Desktop, which requires Hyper-V. Currently Hyper-V and VMware cannot coexist, but that is about to change. In the container world, VM's are just hosts for containers and usually many containers. For example IIS would not run directly on a server VM, but in a container. In larger scale systems like I work with, everything is redundant and disposable. For example, the web application I work on has many instances in production all sitting behind a reverse proxy (which itself is in a container). If one instance dies for some reason, no big deal, another is spun up to replace it. The containers are all behind a Hyper-V internal switch with NAT. Anyway, it you want to learn more about containers in the Windows world, here's a good place to start: About Windows containers
- HotCakeXSep 12, 2019MVPExactly what i said. the External Virtual Network switch is used for Real-Life scenarios. i wasn't talking about test purposes.
test purposes can have whatever strange settings they want.
Servers such ca CA, VPN, IIS, VDI etc are needed to connect to the outside world in order to do their job and serve. the Internet network would be already behind a NAT which belongs to the physical router.
there is no point in putting it behind yet another NAT.
the external IP address is 1 and when users from Internet want to connect to the Virtual Servers, they have limited possibilities, the best one would be to use VPN and then access the local network of the Servers/Clients but that also does Not need double NATs. - mlmathewsSep 12, 2019Brass Contributor
HotCakeX The VM can connect to the network using an internal switch if it's set up with a virtual NAT firewall. My local server VM can connect to Microsoft Update (and the rest of the local network + internet). However, only the host (my laptop) can initiate connections to the VM...which is perfect for a development testing scenario. There are other servers (vSphere VMs) that the code is pushed to when it's time to make it available to other people for testing and production.
- HotCakeXSep 12, 2019MVP
In that same article:
"the end result is that (to begin with) that virtual machines on the internal virtual switch can talk to the host, but they cannot talk to the network that the host is connected to."
That's totally useless for me.
I want my Virtual machine to be able to talk to the host network and be accessible from the Internet or in case of a server, it host websites on ISS, provide VPN server connections to outside clients over the Internet.
my host is already behind a phyiscal router, putting my VMs on yet another NAT with different subnets makes things worse and impossible.
with External Virtual Swtich in Hyper-V, i can give an IP address (v6 or v4) to my VM and then put that VM's IP address in my physical router's DMZ so it can be accessible from the Internet.
that's how servers operate. Hyper-V does a great job by letting VMs directly be involved with the real network.