Hyper-V - No Guest Internet - windows

I'm using a Windows Server 2019 server from Microsoft Azure. I have installed Hyper-V with the management tools and am now trying to setup a Ubuntu 14.04LTS VM inside of Hyper-V. I create a new External Switch however when setting up the Ubuntu instance there it tells me that there is an issue with the DHCP server. When I check my network connections for the newly created switch there is IPV4 connectivity, with packets being sent and received.
Things that I have tried:
-Ensured that inside of the Virtual Switch Manager that in my newly created virtual switch, the external network is selected as my main internet adapter. And that the "Allow management os to share this network adapter".
-Tried selecting "Internal Network"
-Inside of the ubuntu server, tried dchlient -r and dhclient eth0 to try to retrieve a new IP (For internal network this has worked, but without internet access, for external ip it hangs on the command dhclient eth0)
-In Network Connections I have tried bridging the two connections (out of desperation, "bricks" the vps causing me to not be able to rdp, must create a new azure vm)
-I have tried right clicking the main "ethernet" inside the Network Connections and allowing sharing options to other users.
Please help as I'm quite lost as to why the Ubuntu Guest is not connecting to the internet with the new network switch

The virtual switch connection types are very confusingly named, and sharing is somewhat flaky. I've had best results with the Internal Network. Most of the time it just works but there are certain situations when the NAT service breaks and you will have to restart some combination of the host and guest machines, possibly both -- I've not found a way to just restart the virtual switch service without restarting the host OS.
If you need to use the External Network type, be aware that your actual physical router will be in the mix, so you must make sure that it is properly configured, especially if you're doing MAC filtering on your router and the guest is not using the hardware MAC. This usually happens because of the virtualisation process itself, even if it's not something you've configured in the guest.

Related

WSL2 setup without Internet Connection Sharing(SharedAccess) service

For some reason, I cannot use Internet Connection Sharing (SharedAccess) service.
When I use WSL1, it works without ICS service, but I am unable to install WSL2 without ICS service. Installing WSL2 produces this error:
WslRegisterDistribution failed with error: 0x803b002a
Internet connection sharing service (shared access) is disabled and cannot be started
Is 'ICS service' necessary for WSL2? Or is there any method for using it without ICS?
I used WSL2 without ICS 1~2 months ago. This problem appeared after some updates. And I guess that one of update makes the ICS necessary for WSL2.
https://github.com/microsoft/WSL/issues/6646
My windows version was (1909).
I could use WSL2 successfully with (20H2).
WSL2 isn't actually WSL anymore. It's just a Linux virtual machine running on Hyper-V. They hide it well but that's all it is. And to get network access it has its own network interface, which uses Internet Connection Sharing to gain access to the networks the host sees.
If you cannot forward across a network interface with ICS (for example, some VPN clients prohibit it by policy) your best option is to run the Linux of your choice on VirtualBox. VirtualBox is different from all the others because its NAT driver runs in user mode on the host system instead of creating an interface.

Can you have a single domain across 2 servers within Hyper-V Manager?

I am running a Hyper-V lab for a client to test the functionality of a Powershell script and due to memory constraints, I would like to move my file and database VM servers off of my main desktop PC to my laptop. I set up Hyper-V on the laptop, and successfully exported/imported the VM's into the other Hyper-V server. I can boot them, all the configuration and files are intact however, I am predictably having trouble reconnecting to the domain they were a part of prior to the move. I understand I need an External virtual switch to handle that communication, as internal and private will not reach outside of the Hyper-V server they reside in. Obviously I would prefer to not use an external, but this is strictly to continue testing. I've trouble-shooted entering different DNS server values from the client machine's IPv4 properties and changing the virtual switch to External for the existing Hyper-V server, and re-register the DNS records on the DC. All result in the same error when I try to connect to the domain: "(error code 0x0000232B RCODE_NAME_ERROR) The query was for the SRV record for _ldap._tcp.dc."... "The DNS SRV records required to locate a AD DC for the domain are not registered in DNS".
In summary, I want to move a VM from the first server listed to the second, and then re-connect to the domain they were part of previously. Both machines are just running Windows 10, not Windows Servers, if that matters. Another note, I can do remote sessions from the desktop to the laptop just fine which would lead to believe this is not related to a firewall. Thanks!
The best it to set up a VLAN. If you can't do that, change the network class of your AD lab machine (192.168.55.x ?) to another in order to avoid conflicts.
Your DNS server has to be AD to make your machines connecting to it.
And last but not least, if you're on 2 different hyperV servers, you have to use external switch in hyperV:
https://redmondmag.com/articles/2018/05/04/hyper-v-private-networks.aspx

Issue with VPN to enable CI system and accessing MACs for Visual studio developement

I am trying to setup build servers, and a mac available for remote builds in VS. As results I have a Synology server setup with VPN enabled. The Firewall and all settings are setup according to the synology guide. I have then enabled port forwarding on my linksys WRT1900ACS router, for the three ports needed (500,1701,4500), which is also enabled in the firewall on the router. I then access the VPN locally without any issues, tried with different guides (guide1 guide2 guide3).
I then create copies of the vpn connection and inserting my static IP from my ISP. I logon to a tethered internet from my phone, as to ensure the network is different. I then get an error:
local l2tp connection attempt failed because the security layer encountered a processing error during initial negotiations.
Searching it seems like it is an error with the registry (reg 1 reg 2). Changing that just makes the vpn connection hang. What am I doing wrong? After waiting a long period of time (several minutes), the same error returns.
I have also tested on an Ipad using the settings defined in ios-settings.
For others the above guides solves the issue if you have a static IP. You however have to ensure that your ISP, have allowed the traffic, and that your router does not receive a double IP registration, rendering your static IP invalid.
which was the case for me.

vmWare Workstation External Accessibility Issue

I'm running Windows Server 2012 w/ vmWare Workstation. I've built a GitLab VM on Centos 7 that's totally setup and accessible on my local network. It's configured using Bridged Mode so it has it's own IP from the DHCP Server.
I use No-IP to connect to my Network externally which has been working great for several years now. I have port-forwarding setup within my router to forward traffic for the GitLab webUI to the GitLab VM, but it's not accessible externally. I even tried setting up the port forwarding to direct the traffic to the Windows Server and then setup internal port forwarding w/ netsh on the Windows Server to forward the traffic to the GitLab VM, making sure I opened the port on the Windows Firewall (even tried disabling it), but I still can't get to the GitLab VM externally. AFAIK running a VM w/ a Bridged adapter should essentially be like it is just another physical machine on the network.
Now, I am running IIS on the Windows Server, but when I specify a specific port using my public No-IP Domain, the router should detect the traffic on that port and forward it according to the rules that I have setup, correct? IIS shouldn't be interfering with any traffic on other ports with the external Domain.
I'm totally stumped on this on and searching around the web really hasn't helped much.
So it turns out that I did everything 100% correctly with setting up port forwarding right to the IP of the VM, but my workplace blocks just about every port except for 80 and 443. Tested connectivity from an AWS box and everything is accessible exactly as designed.
Now I just feel like an idiot, but hey, I figured it out.

How to disable Network in Windows Server 2008

I have a virtual machine on VMWare Workstation with Windows Server 2008 R2.
There are some not admin users. They have to have an internet access for theirs work (for example, to use SVN, Maven and so on). But at the same time, I have to close access to the Network for them.
What i have already tried:
I've tried to turn off network discovery in Network and Sharing Center. But it disables network only via gui(explorer), so users still can access other devices like that \\SOME_MACHINE_PC. More then that, users (which are even not admins) can change back this option in Control Panel.
I've tried to edit registry, adding such configuration:
[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\Network]
"NoEntireNetwork "=dword:00000001
[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer]
"NoNetHood"=dword:00000001
But it have not changed anything at all.
I've tried to change Network Adapter config in WMware to Host-only: A private network shared with the host.
But this turns off internet.
So, is there any other variants?
You can create an extra subnet for the VM, and don't route from this subnet to the company network.Then you can access the VM via the Host System (I am doing it via vnc). When the VM doesn't need access to the host network, it should work.
If the VM needs access to the company lan:
You could create a second VM for the internet only use, and use the existing VM for its current purpose.

Resources