Comments (23)
yep, everything works from what i can tell.
from wsl.
probably similar to #11061
from wsl.
also tried disabling all network interface as the issue linked about said, and that did not work also.
networking used to work for a while and then it stopped working a couple weeks ago.
from wsl.
View similar issues
Please view the issues below to see if they solve your problem, and if the issue describes your problem please consider closing this one and thumbs upping the other issue to help us prioritize it!
Open similar issues:
- No network connection in any distribution under WSL2 (#11131), similarity score: 0.80
- no network any more (#10774), similarity score: 0.75
- Unable to get internet when connected to 192.168.81.0/24 network (#10016), similarity score: 0.74
Closed similar issues:
- Network is unreachable on ethernet connection but Ping, Traceroute work on Debian wsl2 on windows11 version 23H2 (#10744), similarity score: 0.76
- Test issue with logs (#11306), similarity score: 0.74
Note: You can give me feedback by thumbs upping or thumbs downing this comment.
Diagnostic information
.wslconfig found
Detected appx version: 2.2.4.0
optional-components.txt not found
from wsl.
WSL 2.2.4 has an issue, at least with an existing .wslconfig like the following:
# configure .wslconfig . If needed, change debugConsole=true
echo "[wsl2]">"$env:userprofile\.wslconfig"
echo "# Enable nested virtualization">>"$env:userprofile\.wslconfig"
echo "nestedVirtualization=true">>"$env:userprofile\.wslconfig"
echo "# networking mode">>"$env:userprofile\.wslconfig"
echo "networkingMode=NAT">>"$env:userprofile\.wslconfig"
echo "# Turn on default connection to bind WSL 2 localhost to Windows localhost">>"$env:userprofile\.wslconfig"
echo "localhostforwarding=true">>"$env:userprofile\.wslconfig"
echo "# turn off idle timeout">>"$env:userprofile\.wslconfig"
echo "vmIdleTimeout = -1">>"$env:userprofile\.wslconfig"
echo "# needed to start properly [email protected]">>"$env:userprofile\.wslconfig"
echo "guiApplications = true">>"$env:userprofile\.wslconfig"
echo "# debug console" >>"$env:userprofile\.wslconfig"
echo "debugConsole=false">>"$env:userprofile\.wslconfig"
Downgrade to WSL 2.1.5 (https://github.com/microsoft/WSL/releases/download/2.1.5/wsl.2.1.5.0.x64.msi) resolves the issue.
Unfortunately I couldn't take the time to find out how to make run WSL 2.2.4 with the configuration mentioned.
from wsl.
@keith-horton: This user is using mirrored networking:
networkingMode=mirrored
from wsl.
yep, downgrading also did not work.
from wsl.
also, i do not use any vpn on this particular box.
from wsl.
WSL 2.2.4 has an issue, at least with an existing .wslconfig like the following:
# configure .wslconfig . If needed, change debugConsole=true echo "[wsl2]">"$env:userprofile\.wslconfig" echo "# Enable nested virtualization">>"$env:userprofile\.wslconfig" echo "nestedVirtualization=true">>"$env:userprofile\.wslconfig" echo "# networking mode">>"$env:userprofile\.wslconfig" echo "networkingMode=NAT">>"$env:userprofile\.wslconfig" echo "# Turn on default connection to bind WSL 2 localhost to Windows localhost">>"$env:userprofile\.wslconfig" echo "localhostforwarding=true">>"$env:userprofile\.wslconfig" echo "# turn off idle timeout">>"$env:userprofile\.wslconfig" echo "vmIdleTimeout = -1">>"$env:userprofile\.wslconfig" echo "# needed to start properly [email protected]">>"$env:userprofile\.wslconfig" echo "guiApplications = true">>"$env:userprofile\.wslconfig" echo "# debug console" >>"$env:userprofile\.wslconfig" echo "debugConsole=false">>"$env:userprofile\.wslconfig"
Downgrade to WSL 2.1.5 (https://github.com/microsoft/WSL/releases/download/2.1.5/wsl.2.1.5.0.x64.msi) resolves the issue.
Unfortunately I couldn't take the time to find out how to make run WSL 2.2.4 with the configuration mentioned.
Hi. I am facing the same network issue and couldn't resolve it for a while now.
Could you share how we can downgrade WSL from 2.2.4.0 to 2.1.5?
Do we just run the executable you link?
from wsl.
Hi,
Case distinction:
- networkingMode=mirrored : I don‘t know the actual results neither with 2.1.5 nor with 2.2.4. As far as I remember, it didn’t work well in both versions (Windows 11 - patches - configuration).
- networkingMode=NAT : In my lab, 2.1.5. works, 2.2.4. results in no network connectivity. Downgrade helps by simply starting the 2.1.5 .msi installer with local administrative privileges, click through and reopen a new Terminal(Administrator).
from wsl.
Hi @dcasota . Thank you for your prompt response.
I ran the .msi
installer and managed to downgrade my WSL - however, it seems like my network issues still persists.
For context, I do not have an existing .wslconfig
in my %USERProfile%
directory, and I believe the default WSL behavior is to use NAT
https://learn.microsoft.com/en-us/windows/wsl/networking
Default networking mode: NAT
By default, WSL uses a NAT (Network Address Translation) based architecture for networking. Keep the following considerations in mind when working with a NAT-based networking architecture:
Do you have some ideas of what other issues this network connectivity problem might be caused by?
Thanks so much.
from wsl.
I tried to populate a curated answer. Hope this helps.
Constellations
1a) enterprise workstation/laptop: Data Loss prevention policy
'Device control in Microsoft Defender for Endpoint' with an activated policy for W11 devices might detect WSL instances and prevent access to storage and networks.
In any case, prevent data loss. Ask company's IT compliance manager for help. Work together.
1b) Support good standing of IT security. Backup your system.
- Hardware bios/firmware level
- Windows 11
- Installed drivers and agents
- Windows Subsystem for Linux
- WSL Distribution
For a WSL distribution, usewsl --export <distribution-name> <path\filename.tar>
2) WSL Reinstallation
Typically, a WSL reinstallation fixes misconfiguration issues quite well.
However, create first a backup of your WSL distribution as mentioned in Step 1. A reinstallation deletes any registered WSL distribution.
Here a sample of a reinstallation recipe.
# see https://learn.microsoft.com/en-us/windows/wsl/install-manual#step-1---enable-the-windows-subsystem-for-linux
# Open a Powershell Terminal (Administrator)
dism /online /disable-feature /FeatureName:Microsoft-Windows-Subsystem-Linux
dism /online /disable-feature /featurename:VirtualMachinePlatform
dism /online /disable-feature /FeatureName:Microsoft-Hyper-V
rm "$env:userprofile\.wslconfig"
# reboot
# Open a Powershell Terminal (Administrator)
dism /online /enable-Feature /All /FeatureName:Microsoft-Windows-Subsystem-Linux /norestart
dism /online /enable-feature /All /Featurename:VirtualMachinePlatform /norestart
dism /online /enable-Feature /All /FeatureName:Microsoft-Hyper-V /norestart
bcdedit /set hypervisorlaunchtype auto
# reboot
# Open a Powershell Terminal (Administrator)
wsl --install
3) Network Connectivity
Network connectivity results as a sort of pipeline e.g. physical network adapter ! virtual network adapter ! bridged ! vnic ! vswitch ! portgroup
.
If a vnic inside a WSL distribution does not get a network link, the pipeline is broken. Investigate if network connectivity works in another WSL distribution. If it works, it's rather not a WSL issue.
There are different types of network adapters e.g. built-in wired or wi-fi, usb(-c)-to-ethernet, etc. Not all vendor types are enabled by default in the Distros' Linux Kernel.
In case of a Windows 11 network configuration issue, check your configuration.
The WSL Networking Logs provided by @fawaf clearly testifies to the method required.
from wsl.
@fawaf thanks for reporting the issue
can you please collect a new set of networking logs using instructions below? - we need to the capture the process of WSL startup in the logs
run .\collect-networking-logs.ps1
run wsl --shutdown
start WSL and repro
stop .\collect-networking-logs.ps1
from wsl.
oddly, i ran it, but it doesn't continue to collect logs. it just runs to completion and exits.
from wsl.
a reinstall of wsl seems to have fixed this issue as mentioned above. i'll report back if it occurs again.
from wsl.
a reinstall of wsl seems to have fixed this issue as mentioned above. i'll report back if it occurs again.
Hey @fawaf - did you follow @dcasota's instruction above for reinstallation?
After reinstallation, how did you reimport your project files etc. back to your newly installed WSL2?
(I presume his Step 2 instructions above will delete your original WSL's Ubuntu content?)
from wsl.
yep, that is correct. step 1 will back up the distro into a tar file.
i used the import command provided by wsl
wsl --import <Distro> <InstallLocation> <FileName>
from wsl.
@fawaf Thank you for the swift replies!
Could I clarify that everything works well for you after re-importing?
i.e. your personal bash commands, project files, VSCode configuration, etc. etc. are all working ok?
^ just needed some re-assurance before I run the commands, lol!
from wsl.
@fawaf @cyberjj999 a question: can you check with wmic qfe list
if you have a Windows Security Update KB5039212 installed?
There seems to be a build-in wsl update in KB5039212, because even after having uninstalled wsl + dism packages, wsl -v
shows up as 2.2.4.
KB5039212 contains newer wsl bits:
wsl.exe,"10.0.22621.3672","07-Jun-2024","07:29","195,072"
wslconfig.exe,"10.0.22621.3672","07-Jun-2024","07:29","120,320"
wslg.exe,"10.0.22621.3672","07-Jun-2024","07:29","120,320"
Those wsl files are in c:\windows\system32.
I uninstalled the KB with wusa /uninstall /kb:5039212
. The files weren't deleted, but wsl -v
is back to 2.1.5.
in addition wsl show the well-known Error code Wsl/Service/CreateInstance/GetDefaultDistro/WSL_E_DEFAULT_DISTRO_NOT_FOUND
.
On this install base, a reinstallation succeeds.
KB5039212 seems to update the installbase to 2.2.4 despite issue(s) 'no network issue/internet access'.
Placed an info at https://answers.microsoft.com/en-us/windows/forum/all/cumulative-updates-for-windows-june-2024/7e7ebdf9-4c8a-420e-aa6c-9ce470649cb3.
from wsl.
i do not have KB5039212 installed.
from wsl.
@fawaf @cyberjj999 a question: can you check with
wmic qfe list
if you have a Windows Security Update KB5039212 installed?There seems to be a build-in wsl update in KB5039212, because even after having uninstalled wsl + dism packages,
wsl -v
shows up as 2.2.4.KB5039212 contains newer wsl bits:
wsl.exe,"10.0.22621.3672","07-Jun-2024","07:29","195,072" wslconfig.exe,"10.0.22621.3672","07-Jun-2024","07:29","120,320" wslg.exe,"10.0.22621.3672","07-Jun-2024","07:29","120,320"
Those wsl files are in c:\windows\system32.
I uninstalled the KB with
wusa /uninstall /kb:5039212
. The files weren't deleted, butwsl -v
is back to 2.1.5.in addition wsl show the well-known Error code
Wsl/Service/CreateInstance/GetDefaultDistro/WSL_E_DEFAULT_DISTRO_NOT_FOUND
.On this install base, a reinstallation succeeds.
KB5039212 seems to update the installbase to 2.2.4 despite issue(s) 'no network issue/internet access'. Placed an info at https://answers.microsoft.com/en-us/windows/forum/all/cumulative-updates-for-windows-june-2024/7e7ebdf9-4c8a-420e-aa6c-9ce470649cb3.
Yes. I do have KB5039212
installed in my latest update - incidentally, it seems like the installation date is pretty near or maybe even coincide with the day I started facing the network issue...
is the fix to remove this update then?
from wsl.
I can confirm that uninstalling KB5039212
(and reboot afterwards) help me with my problem (dns working, nat not)
from wsl.
@cyberjj999 In my x86_64 lab, removing kb5039212 helped to afterwards reinstall wsl to 2.1.5 successfully and not have issues with networkingMode. Also, in Start > Settings > Windows Updates > choose pause updates e.g. for 7 days.
from wsl.
Related Issues (20)
- when networkingMode=mirrored, windows can't request the k8s service(nodePort), but it's ok on wsl . HOT 4
- starting wsl ubuntu gives me: no sessions [process exited with code 1 (0x00000001)] HOT 6
- Feature Request - Add Mirrored Networking support for Windows 10 HOT 1
- Reopening #4803 HOT 3
- WslRegisterDistribution failed with error: 0xc0000409 (Any help will be appreciated!) HOT 1
- Error code: Wsl/Service/CreateInstance/CreateVm/HCS/ERROR_MOD_NOT_FOUND after Windows update HOT 1
- WSL 会导致 Windows 10 系统 每次关机都会自动重启 HOT 6
- cpio required for 6.6 build HOT 3
- The contents of `/tmp` are cleared few seconds after start up HOT 4
- localhostForwarding = false has no effect HOT 4
- WSL does not have an access to the WiFi hotspot network HOT 3
- docker cannot start after installing linux-msft-wsl-6.6.y HOT 9
- GUI locked up if application is running and Windows goes to sleep HOT 4
- WslRegisterDistribution failed with error: 0x80041002 Error: 0x80041002 (null) HOT 4
- DNS resolution for Internal Sites doesn't work when using Global Secure Access Client HOT 3
- Extraneous directories created at root of Ubuntu file system HOT 4
- Failed to attach disk '\\192.168.1.123\ext4.vhdx' to WSL2: The user name or password is incorrect. HOT 4
- Kali-Linux WSL2 is unable to connect to Internet HOT 3
- Allow USB Storage devices to be mounted... HOT 1
- 9p client truncates modified time nanoseconds field to zero when setting it HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from wsl.