"An existing connection was forcibly closed by the remote host." error is presented when launching any WSL 2 distro
-
Your Windows build number:
Microsoft Windows [Version 10.0.18917.1000] -
What you're doing and what's happening: Trying to launch
wsl.exeorbashthrows an error message that statesAn existing connection was forcibly closed by the remote host.
Microsoft Windows [Version 10.0.18917.1000]
(c) 2019 Microsoft Corporation. All rights reserved.
C:\Users\Steven>bash
An existing connection was forcibly closed by the remote host.
C:\Users\Steven>wsl
An existing connection was forcibly closed by the remote host.
C:\Users\Steven>
I've tried this with my converted Debian distro, as well as ArchWSL. I also tried to install Ubuntu but during setup after choosing my UNIX username the same error gets thrown.
- What's wrong / what should be happening instead: The distro should be launching normally and I should be presented with a bash shell.
Log files: logs.zip
Edit (9/26/19): It appears that the number of entries in a modified hosts.txt is what is causing this issue at the moment. More information here: https://github.com/microsoft/WSL/issues/4105#issuecomment-531385551
Me too. Same build 18917 and Debian, I converted it to Wsl version 2 but the Appx can't run after this convertion... Then I returned to Wsl version 1.
The issue can be the ext4.vhdx disk image that can't be open from Appx (Debian or Ubuntu) with Wsl2, before the linux files could be open via explorer with Wsl1.
Windows Insider forum : https://answers.microsoft.com/en-us/insider/forum/all/an-existing-connection-was-forcibly-closed-by-the-remote-host
Thanks for filing. From the trace it looks like your instance is being terminated during creation. Does the following command work? If so can you give me the output? When you're in this state, can you look in task manager and see if there is a vmmem process running?
wsl.exe -u root -e dmesg
Thanks!
Thanks for filing. From the trace it looks like your instance is being terminated during creation. Does the following command work? If so can you give me the output? When you're in this state, can you look in task manager and see if there is a vmmem process running?
wsl.exe -u root -e dmesg
Thanks!
That command doesn't work; I'm still getting the original An existing connection was forcibly closed by the remote host. message, but there is heightened Vmmem activity when I call this for sure (I tried calling it repeatedly and noticed the spike).
Thanks for filing. From the trace it looks like your instance is being terminated during creation. Does the following command work? If so can you give me the output? When you're in this state, can you look in task manager and see if there is a vmmem process running?
wsl.exe -u root -e dmesg
Thanks!
Microsoft Windows [Version 10.0.18917.1000]
(c) 2019 Microsoft Corporation. All rights reserved.
C:\Users\Steven>wsl.exe -u root -e dmesg
An existing connection was forcibly closed by the remote host.
C:\Users\Steven>
This is what I see in task manager shortly after running that command

The the first running vmmem process will stick around for a bit before disappearing, while the second one stays in its suspended state indefinitely
Great thank you. It looks like the utility VM is still alive, it's the distro itself that is running into an issue. I'll dig into this a bit today.
Would it be possible for somebody hitting the "An existing connection was forcibly closed by the remote host" issue to export your distribution and share the tar file? This will contain your entire root file system so if there is private information please send it to [email protected].
- wsl.exe --export DistroName FileName.tar
- Zip FileName.tar
- Email to [email protected], say it's for benhill, or upload and send me a link.
Would it be possible for somebody hitting the "An existing connection was forcibly closed by the remote host" issue to export your distribution"
Can be with WSL 1 actived or must be only wsl2 ? I can run "wsl.exe --export DistroName FileName.tar" with my Debian in WSL1 ? and Then send to you
Would it be possible for somebody hitting the "An existing connection was forcibly closed by the remote host" issue to export your distribution"
Can be with WSL 1 actived or must be only wsl2 ? I can run "wsl.exe --export DistroName FileName.tar" with my Debian in WSL1 ? and Then send to you
I think he wants it in WSL2 format.
He wants it in WSL2 format.
Then only the ext4.Vhdx image converted (after change to WSL2) would be need
He wants it in WSL2 format.
Then only the ext4.Vhdx image converted (after change to WSL2) would be need
Idk about you, but I'm experiencing it on a plain clean downloaded Ubuntu and Debian (and Kali) WSL instance so I'm not sure why it's needed at all.
He wants it in WSL2 format.
Then only the ext4.Vhdx image converted (after change to WSL2) would be need
Idk about you, but I'm experiencing it on a plain clean downloaded Ubuntu and Debian (and Kali) WSL instance so I'm not sure why it's needed at all
I understood. Only problem with wsl2 is that it create a disk image and the Appx (Debian or Ubuntu) can't run
He wants it in WSL2 format.
Then only the ext4.Vhdx image converted (after change to WSL2) would be need
Idk about you, but I'm experiencing it on a plain clean downloaded Ubuntu and Debian (and Kali) WSL instance so I'm not sure why it's needed at all
I understood. Only problem with wsl2 is that it create a disk image and the Appx (Debian or Ubuntu) can't run
If it helps, I don't think other optional features are interfering as I spent 15 mins switching between to see and no change. It's not due to other Hyper-V either.
If it helps, I don't think other optional features are interfering as I spent 15 mins switching between to see and no change. It's not due to other Hyper-V either.
Me too. I tried enable & disable Hyper-V feature with Virtual Machine Platform enabled but This disk image "ext4.vhdx" Can't be Mounted
wsl --export creates a tar regardless if the distro is WSL1 or WSL2. What I suspect is there's something in the root file system that /init does not like. The VM looks like it's being created and the distro is able to be converted, but launching the distro fails.
Would it be possible for somebody hitting the "An existing connection was forcibly closed by the remote host" issue to export your distribution and share the tar file? This will contain your entire root file system so if there is private information please send it to [email protected].
1. wsl.exe --export DistroName FileName.tar 2. Zip FileName.tar 3. Email to [[email protected]](mailto:[email protected]), say it's for benhill, or upload and send me a link.
Hello
I sent you my distribution tarballs to [email protected]
@steven-peralta - Awesome, thank you very much. Hopefully I am able to reproduce, if not I may need to add some more diagnostics...
I can't email my distro tarball because it's 600+MB
Also why can't we see the VM in Hyper-V Manager?
Would it be possible for somebody hitting the "An existing connection was forcibly closed by the remote host" issue to export your distribution and share the tar file? This will contain your entire root file system so if there is private information please send it to [email protected].
- wsl.exe --export DistroName FileName.tar
- Zip FileName.tar
- Email to [email protected], say it's for benhill, or upload and send me a link.
Hello
I sent you my distribution tarballs to [email protected]
I can't email my distro tarball because it's 600+MB
Also why can't we see the VM in Hyper-V Manager?
Use mega.nz or something similar.
It’s not a traditional VM and it’s using a different platform (Virtual Machine Platform) which is the third? platform for Hyper-V virtualisation in Windows as you can see in Control Panel > Programs > Manage Optional Features. The other two are default Hyper-V (the one you see in the manager) and Hypervisor Platform (Android emulator uses this but doesn’t appear in manager too).
I can't email my distro tarball because it's 600+MB Also why can't we see the VM in Hyper-V Manager?
Use mega.nz or something similar.
It’s not a traditional VM and it’s using a different platform (Virtual Machine Platform) which is the third? platform for Hyper-V virtualisation in Windows as you can see in Control Panel > Programs > Manage Optional Features. The other two are default Hyper-V (the one you see in the manager) and Hypervisor Platform (Android emulator uses this but doesn’t appear in manager too).
The problem is that the Appx (Ubuntu or Debian) can't open this new VM (image disk ext4.vhdx) because the App was built to execute the root files with NT filesystem
more users with similar issues : https://github.com/microsoft/WSL/issues maybe would be good to suspend the release of wsl2 for this moment