Because I always forget stuff like this
I have a confession to make, dear readers:
I am a horrible VM admin.
I’m also not great at networking.
When I go to set up a VM to do something like install SQL vNext, I want to be able to talk to it.
Why bother?
Well, SSMS is no longer part of the SQL install. I don’t really want to copy another 800 MB file over to my VM and install it.
I’m also a devoted fan of Red Gate’s SQL Prompt, because I’m lazy and forgetful. I only have the one license, and I do my very best to respect that by not installing it (even temporarily) in more than one place.
And, you know, I should also probably practice what I preach about not RDPing into a server and running SSMS. That’s not very nice. Not very nice at all.
ICU TCP
So how does one get SSMS connectivity between a Hyper-V host and guest?
The magic of magic numbers. And by magic numbers, I mean IP addresses.
In your Hyper-V Manager, click on the Virtual Switch Manager
You’ll want to create an Internal network
Next, in your VM guest settings, you’ll want to assign it to use the internal network.
Now, on your host, head on into the Networking Control Panel where your connections are listed. You should have a new one for the Internal network you created in Hyper-V
Get the properties of that adapter, and go into the IPV4 properties. I set mine to a generic subnet, and a random 192.168.X.X IP address. Just be careful here if you have hard coded IPs sitting around somewhere.
Now when you start up your VM guest, you’ll want to repeat those steps and assign it the same subnet and a different random IP address.
Et Voila
You may have to kill Windows Firewall, or add in the appropriate exceptions on your Guest and Host to get things working in both directions. But this should be the end of it, and now you should be able to connect SSMS directly to your Guest from your Host.
Thanks for reading!