WSL2 setup without Internet Connection Sharing(SharedAccess) service - windows

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.

Related

Hyper-V - No Guest Internet

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.

How to rdp from mac to azure vm through vnet gateway

I am trying to rdp from my local mac to an Azure instance through a (IKEv2) vpn connection. I am never prompted for a password, and it looks like the connection just times out. The error code I get is 0x204.
I have tried using both Microsoft Remote Desktop 8 and 10 for mac.
The connection is active and reports that it is connected.
From the mac, I can connect to another VM (in the same azure account) which is not running behind a vpn.
From Parallels Desktop (with networking set to Shared mode and the vpn connection active on the mac), I can successfully connect using the windows rdp client.
So it seems the Microsoft RDP-client for mac is not using the vpn connection.
Is there a way to make it do so?
Is there another solution, that will allow me to rdp to an Azure VM from my mac (without going through Parallels)?
Note: This is not the same question as this, since that is not about going through an azure vnet gateway.
I needed to add hosts file entries for each azure site I needed to access.
For example for accessing my-vm-name.someregion.cloudapp.azure.com, I needed to add a hosts file entry for it's private IP within the subnet. E.g. 10.2.0.100.
The reason everything worked in Windows under Parallels, is that the relevant entries had already been added to the hosts file previously.

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.

Windows services with network access

I have a small server app, which receives UDP data on port X. When I run this app with a local logged in user account, all is fine and my app receives commands via UDP. But when I'm installing the app as a windows service which runs under same local user account, I'm not longer receiving data, when I try to connect from a different machine. Local connections are fine. I've also opened my UDP port X in the windows firewall settings, but with no luck.
Any help is appreciated.
Only for the sake of completeness:
It has been found that it has something to do with the virtual machine in which the Windows runs. I use a network bridge to connect it to my local network. After adding a host-only network adapter, my windows service received all expected commands. No idea why!?

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