Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"An existing connection was forcibly closed by the remote host." error is presented when launching any WSL 2 distro #4105

Closed
steven-peralta opened this issue Jun 13, 2019 · 152 comments
Assignees
Labels
wsl2 Issue/feature applies to WSL 2

Comments

@steven-peralta
Copy link

steven-peralta commented Jun 13, 2019

  • Your Windows build number: Microsoft Windows [Version 10.0.18917.1000]

  • What you're doing and what's happening:
    Trying to launch wsl.exe or bash throws an error message that states An 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: #4105 (comment)

@andreluizgit
Copy link

andreluizgit commented Jun 13, 2019

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

@benhillis
Copy link
Member

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!

@benhillis benhillis self-assigned this Jun 13, 2019
@benhillis benhillis added the wsl2 Issue/feature applies to WSL 2 label Jun 13, 2019
@OmriSama
Copy link

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).

@steven-peralta
Copy link
Author

steven-peralta commented Jun 13, 2019

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
image

The the first running vmmem process will stick around for a bit before disappearing, while the second one stays in its suspended state indefinitely

@benhillis
Copy link
Member

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.

@benhillis
Copy link
Member

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 secure@microsoft.com.

  1. wsl.exe --export DistroName FileName.tar
  2. Zip FileName.tar
  3. Email to secure@microsoft.com, say it's for benhill, or upload and send me a link.

@andreluizgit
Copy 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

@lazerl0rd
Copy link

lazerl0rd commented Jun 13, 2019

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.

@andreluizgit
Copy link

andreluizgit commented Jun 13, 2019

He wants it in WSL2 format.

Then only the ext4.Vhdx image converted (after change to WSL2) would be need

@lazerl0rd
Copy link

lazerl0rd commented Jun 13, 2019

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.

@andreluizgit
Copy link

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

@lazerl0rd
Copy link

lazerl0rd commented Jun 13, 2019

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.

@andreluizgit
Copy link

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

@benhillis
Copy link
Member

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.

@steven-peralta
Copy link
Author

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 secure@microsoft.com.

1. wsl.exe --export DistroName FileName.tar

2. Zip FileName.tar

3. Email to [secure@microsoft.com](mailto:secure@microsoft.com), say it's for benhill, or upload and send me a link.

Hello

I sent you my distribution tarballs to secure@microsoft.com

@benhillis
Copy link
Member

@steven-peralta - Awesome, thank you very much. Hopefully I am able to reproduce, if not I may need to add some more diagnostics...

@OmriSama
Copy link

I can't email my distro tarball because it's 600+MB

Also why can't we see the VM in Hyper-V Manager?

@xlong0408
Copy link

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 secure@microsoft.com.

  1. wsl.exe --export DistroName FileName.tar
  2. Zip FileName.tar
  3. Email to secure@microsoft.com, say it's for benhill, or upload and send me a link.

Hello

I sent you my distribution tarballs to secure@microsoft.com

@lazerl0rd
Copy link

lazerl0rd commented Jun 14, 2019

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).

@andreluizgit
Copy link

andreluizgit commented Jun 14, 2019

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

@Sword-Destiny
Copy link

Is there any solutions?

@hsmyers
Copy link

hsmyers commented Jun 16, 2019 via email

@OmriSama
Copy link

This sucks. I was really looking forward to WSL2 and now I can't even use it.

Is there any way to view verbose logs of the Virtualized container?

@OmriSama
Copy link

OmriSama commented Jun 17, 2019

So I just checked my Windows Event Viewer.

Everytime I try to launch wsl, I get a Critical error from "Hyper-V Worker".
Here are the XML dumps of the details:

Error one is 'Virtual Machine' has encountered a fatal error. The guest operating system reported that it failed with the following error codes: ErrorCode0: 0x0, ErrorCode1: 0x0, ErrorCode2: 0x0, ErrorCode3: 0x0, ErrorCode4: 0x0. If the problem persists, contact Product Support for the guest operating system. (Virtual machine ID B3469BCC-05A5-55BE-B5B2-5AEF301615B9):

- <Event xmlns="http://schemas.microsoft.com/win/2004/08/events/event">
- <System>
  <Provider Name="Microsoft-Windows-Hyper-V-Worker" Guid="{51ddfa29-d5c8-4803-be4b-2ecb715570fe}" /> 
  <EventID>18590</EventID> 
  <Version>0</Version> 
  <Level>1</Level> 
  <Task>0</Task> 
  <Opcode>0</Opcode> 
  <Keywords>0x8000000000000000</Keywords> 
  <TimeCreated SystemTime="2019-06-16T23:55:46.904189500Z" /> 
  <EventRecordID>123</EventRecordID> 
  <Correlation /> 
  <Execution ProcessID="3508" ThreadID="7108" /> 
  <Channel>Microsoft-Windows-Hyper-V-Worker-Admin</Channel> 
  <Computer>MyComputer</Computer> 
  <Security UserID="S-1-5-83-1-3007749068-1438516645-4015698613-3105166896" /> 
  </System>
- <UserData>
- <VmlEventLog xmlns="http://www.microsoft.com/Windows/Virtualization/Events">
  <VmName>Virtual Machine</VmName> 
  <VmId>B3469BCC-05A5-55BE-B5B2-5AEF301615B9</VmId> 
  <VmErrorCode0>0x0</VmErrorCode0> 
  <VmErrorCode1>0x0</VmErrorCode1> 
  <VmErrorCode2>0x0</VmErrorCode2> 
  <VmErrorCode3>0x0</VmErrorCode3> 
  <VmErrorCode4>0x0</VmErrorCode4> 
  <VmErrorMessage><5>[ 0.208903] Key type ceph registered <6>[ 0.209117] libceph: loaded (mon/osd proto 15/24) <6>[ 0.209118] hv_vmbus: registering driver hv_sock <6>[ 0.209240] NET: Registered protocol family 40 <6>[ 0.209506] registered taskstats version 1 <5>[ 0.209510] Loading compiled-in X.509 certificates <6>[ 0.209705] Btrfs loaded, crc32c=crc32c-generic <6>[ 0.210457] rtc_cmos 00:00: setting system clock to 2019-06-16 23:54:45 UTC (1560729285) <4>[ 0.210468] Unstable clock detected, switching default tracing clock to "global" <4>[ 0.210468] If you want to keep using the local clock, then add: <4>[ 0.210468] "trace_clock=local" <4>[ 0.210468] on the kernel command line <6>[ 0.213020] Freeing unused kernel image memory: 1348K <6>[ 0.272405] Write protecting the kernel read-only data: 18432k <6>[ 0.272906] Freeing unused kernel image memory: 2008K <6>[ 0.273151] Freeing unused kernel image memory: 1836K <6>[ 0.273280] Run /init as init process <6>[ 0.277394] IPv6: ADDRCONF(NETDEV_UP): eth0: link is not ready <5>[ 0.288347] scsi 0:0:0:0: Direct-Access Msft Virtual Disk 1.0 PQ: 0 ANSI: 5 <5>[ 0.288721] sd 0:0:0:0: Attached scsi generic sg0 type 0 <5>[ 0.289446] sd 0:0:0:0: [sda] 536870912 512-byte logical blocks: (275 GB/256 GiB) <5>[ 0.289447] sd 0:0:0:0: [sda] 4096-byte physical blocks <5>[ 0.289534] sd 0:0:0:0: [sda] Write Protect is off <7>[ 0.289535] sd 0:0:0:0: [sda] Mode Sense: 0f 00 00 00 <5>[ 0.289705] sd 0:0:0:0: [sda] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA <5>[ 0.293086] sd 0:0:0:0: [sda] Attached SCSI disk <6>[ 0.309515] EXT4-fs (sda): mounted filesystem with ordered data mode. Opts: discard,errors=remount-ro,data=ordered <11>[ 0.349846] init: (1) ERROR: InitEntryUtilityVm:2425: read failed 17 <6>[ 0.685387] EXT4-fs (sda): mounted filesystem with ordered data mode. Opts: discard,errors=remount-ro,data=ordered <11>[ 0.703667] init: (1) ERROR: InitEntryUtilityVm:2425: read failed 17 <6>[ 1.201115] EXT4-fs (sda): mounted filesystem with ordered data mode. Opts: discard,errors=remount-ro,data=ordered <11>[ 1.220820] init: (1) ERROR: InitEntryUtilityVm:2425: read failed 17 <6>[ 1.232353] IPv6: ADDRCONF(NETDEV_CHANGE): eth0: link becomes ready <6>[ 49.034941] hv_balloon: Max. dynamic memory size: 15306 MB <5>[ 61.322809] sd 0:0:0:0: [sda] Synchronizing SCSI cache <6>[ 61.325856] ACPI: Preparing to enter system sleep state S5 <0>[ 61.325898] reboot: Power down <7>[ 61.335904] acpi_power_off called <0>[ 61.335934] Kernel panic - not syncing: Attempted to kill init! exitcode=0x00000000 <0>[ 61.335934] <1>[ 61.335938] CPU: 0 PID: 1 Comm: init Not tainted 4.19.43-microsoft-standard #1 <1>[ 61.335939] Call Trace: <1>[ 61.335947] dump_stack+0x5c/0x7b <1>[ 61.335951] panic+0xe4/0x232 <1>[ 61.335953] do_exit+0xb27/0xb30 <1>[ 61.335956] __do_sys_reboot+0x129/0x1d0 <1>[ 61.335958] ? kmem_cache_free+0x17e/0x1b0 <1>[ 61.335959] ? kmem_cache_free+0x17e/0x1b0 <1>[ 61.335961] ? __dentry_kill+0x116/0x150 <1>[ 61.335963] ? default_file_splice_write+0x20/0x20 <1>[ 61.335965] ? __ia32_sys_fdatasync+0x20/0x20 <1>[ 61.335966] ? iterate_supers+0x9b/0xf0 <1>[ 61.335968] ? iterate_bdevs+0xee/0x130 <1>[ 61.335970] do_syscall_64+0x55/0x110 <1>[ 61.335973] entry_SYSCALL_64_after_hwframe+0x44/0xa9 <1>[ 61.335976] RIP: 0033:0x2050cc <1>[ 61.335979] Code: Bad RIP value. <1>[ 61.335980] RSP: 002b:00007fff31ea0378 EFLAGS: 00000217 ORIG_RAX: 00000000000000a9 <1>[ 61.335982] RAX: ffffffffffffffda RBX: 0000000000000001 RCX: 00000000002050cc <1>[ 61.335983] RDX: 000000004321fedc RSI: 0000000028121969 RDI: 00000000fee1dead <1>[ 61.335984] RBP: 0000000000000004 R08: 0000000000000000 R09: 0000000000000000 <1>[ 61.335985] R10: 0000000000000000 R11: 0000000000000217 R12: 00007fff31ea0388 <1>[ 61.335986] R13: 00007fff31ea04a0 R14: 0000000000000005 R15: 0000000000000003 <0>[ 61.337906] Kernel Offset: disabled</VmErrorMessage> 
  </VmlEventLog>
  </UserData>
  </Event>

Error two is 'Virtual Machine' has encountered a fatal error. The guest operating system reported that it failed with the following error codes: ErrorCode0: 0x0, ErrorCode1: 0x81000004132B0000, ErrorCode2: 0x2050CC, ErrorCode3: 0xFFFFFFFFFFFFFFDA, ErrorCode4: 0x7FFF31EA0378. If the problem persists, contact Product Support for the guest operating system. (Virtual machine ID B3469BCC-05A5-55BE-B5B2-5AEF301615B9):

- <Event xmlns="http://schemas.microsoft.com/win/2004/08/events/event">
- <System>
  <Provider Name="Microsoft-Windows-Hyper-V-Worker" Guid="{51ddfa29-d5c8-4803-be4b-2ecb715570fe}" /> 
  <EventID>18590</EventID> 
  <Version>0</Version> 
  <Level>1</Level> 
  <Task>0</Task> 
  <Opcode>0</Opcode> 
  <Keywords>0x8000000000000000</Keywords> 
  <TimeCreated SystemTime="2019-06-16T23:55:46.902217800Z" /> 
  <EventRecordID>122</EventRecordID> 
  <Correlation /> 
  <Execution ProcessID="3508" ThreadID="7108" /> 
  <Channel>Microsoft-Windows-Hyper-V-Worker-Admin</Channel> 
  <Computer>MyComputer</Computer> 
  <Security UserID="S-1-5-83-1-3007749068-1438516645-4015698613-3105166896" /> 
  </System>
- <UserData>
- <VmlEventLog xmlns="http://www.microsoft.com/Windows/Virtualization/Events">
  <VmName>Virtual Machine</VmName> 
  <VmId>B3469BCC-05A5-55BE-B5B2-5AEF301615B9</VmId> 
  <VmErrorCode0>0x0</VmErrorCode0> 
  <VmErrorCode1>0x81000004132b0000</VmErrorCode1> 
  <VmErrorCode2>0x2050cc</VmErrorCode2> 
  <VmErrorCode3>0xffffffffffffffda</VmErrorCode3> 
  <VmErrorCode4>0x7fff31ea0378</VmErrorCode4> 
  <VmErrorMessage /> 
  </VmlEventLog>
  </UserData>
  </Event>

Here is another set of messages from a similar error:

<6>[    0.223403] ipt_CLUSTERIP: ClusterIP Version 0.8 loaded successfully
<6>[    0.223583] Initializing XFRM netlink socket
<6>[    0.223628] NET: Registered protocol family 10
<6>[    0.223941] Segment Routing with IPv6
<6>[    0.225618] sit: IPv6, IPv4 and MPLS over IPv4 tunneling driver
<6>[    0.225697] NET: Registered protocol family 17
<6>[    0.225761] sctp: Hash tables configured (bind 256/256)
<6>[    0.225801] 9pnet: Installing 9P2000 support
<5>[    0.225805] Key type ceph registered
<6>[    0.226066] libceph: loaded (mon/osd proto 15/24)
<6>[    0.226067] hv_vmbus: registering driver hv_sock
<6>[    0.226135] NET: Registered protocol family 40
<6>[    0.226396] registered taskstats version 1
<5>[    0.226399] Loading compiled-in X.509 certificates
<6>[    0.226559] Btrfs loaded, crc32c=crc32c-generic
<6>[    0.227393] rtc_cmos 00:00: setting system clock to 2019-06-17 00:00:38 UTC (1560729638)
<4>[    0.227403] Unstable clock detected, switching default tracing clock to "global"
<4>[    0.227403] If you want to keep using the local clock, then add:
<4>[    0.227403]   "trace_clock=local"
<4>[    0.227403] on the kernel command line
<6>[    0.229152] Freeing unused kernel image memory: 1348K
<6>[    0.280641] Write protecting the kernel read-only data: 18432k
<6>[    0.281149] Freeing unused kernel image memory: 2008K
<6>[    0.281394] Freeing unused kernel image memory: 1836K
<6>[    0.281520] Run /init as init process
<6>[    0.285269] IPv6: ADDRCONF(NETDEV_UP): eth0: link is not ready
<5>[    0.296233] scsi 0:0:0:0: Direct-Access     Msft     Virtual Disk     1.0  PQ: 0 ANSI: 5
<5>[    0.296677] sd 0:0:0:0: Attached scsi generic sg0 type 0
<5>[    0.297366] sd 0:0:0:0: [sda] 536870912 512-byte logical blocks: (275 GB/256 GiB)
<5>[    0.297367] sd 0:0:0:0: [sda] 4096-byte physical blocks
<5>[    0.297472] sd 0:0:0:0: [sda] Write Protect is off
<7>[    0.297473] sd 0:0:0:0: [sda] Mode Sense: 0f 00 00 00
<5>[    0.297640] sd 0:0:0:0: [sda] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA
<5>[    0.300628] sd 0:0:0:0: [sda] Attached SCSI disk
<6>[    0.318354] EXT4-fs (sda): mounted filesystem with ordered data mode. Opts: discard,errors=remount-ro,data=ordered
<11>[    0.360057] init: (1) ERROR: InitEntryUtilityVm:2425: read failed 17
<6>[    1.250612] IPv6: ADDRCONF(NETDEV_CHANGE): eth0: link becomes ready
<6>[   49.051604] hv_balloon: Max. dynamic memory size: 15306 MB
<5>[   60.441114] sd 0:0:0:0: [sda] Synchronizing SCSI cache
<6>[   60.443375] ACPI: Preparing to enter system sleep state S5
<0>[   60.443430] reboot: Power down
<7>[   60.453455] acpi_power_off called
<0>[   60.453496] Kernel panic - not syncing: Attempted to kill init! exitcode=0x00000000
<0>[   60.453496] 
<1>[   60.453501] CPU: 0 PID: 1 Comm: init Not tainted 4.19.43-microsoft-standard #1
<1>[   60.453502] Call Trace:
<1>[   60.453510]  dump_stack+0x5c/0x7b
<1>[   60.453514]  panic+0xe4/0x232
<1>[   60.453516]  do_exit+0xb27/0xb30
<1>[   60.453519]  __do_sys_reboot+0x129/0x1d0
<1>[   60.453522]  ? iput+0x73/0x1f0
<1>[   60.453524]  ? __dentry_kill+0x116/0x150
<1>[   60.453526]  ? default_file_splice_write+0x20/0x20
<1>[   60.453528]  ? __ia32_sys_fdatasync+0x20/0x20
<1>[   60.453530]  ? iterate_supers+0x9b/0xf0
<1>[   60.453532]  ? iterate_bdevs+0xee/0x130
<1>[   60.453534]  do_syscall_64+0x55/0x110
<1>[   60.453537]  entry_SYSCALL_64_after_hwframe+0x44/0xa9
<1>[   60.453540] RIP: 0033:0x2050cc
<1>[   60.453544] Code: Bad RIP value.
<1>[   60.453545] RSP: 002b:00007ffd2effc6e8 EFLAGS: 00000217 ORIG_RAX: 00000000000000a9
<1>[   60.453546] RAX: ffffffffffffffda RBX: 0000000000000001 RCX: 00000000002050cc
<1>[   60.453547] RDX: 000000004321fedc RSI: 0000000028121969 RDI: 00000000fee1dead
<1>[   60.453549] RBP: 0000000000000004 R08: 0000000000000000 R09: 0000000000000000
<1>[   60.453550] R10: 0000000000000000 R11: 0000000000000217 R12: 00007ffd2effc6f8
<1>[   60.453551] R13: 00007ffd2effc810 R14: 0000000000000005 R15: 0000000000000003
<0>[   60.455494] Kernel Offset: disabled

@OmriSama
Copy link

image
It seems this error is popping up CONSISTENTLY between all of my attempts to launch the VM. It seems to be some VHD mounting-related issue. Need to keep investigating.

@OmriSama
Copy link

I guess it's also worth mentioning that I previously didn't have Windows Sandbox enabled, and I just enabled it to try to see how it reacts.

The Sandbox will launch initially, but then I get the same An existing connection was forcibly closed... after clicking some stuff around for a little bit.

@steven-peralta
Copy link
Author

I guess it's also worth mentioning that I previously didn't have Windows Sandbox enabled, and I just enabled it to try to see how it reacts.

The Sandbox will launch initially, but then I get the same An existing connection was forcibly closed... after clicking some stuff around for a little bit.

hmm, interesting that you mention that, actually. i was having the same issue, but i just chalked it up to the sandbox being slow and buggy. i did not think that it would be related to the WSL 2 issues i am having now

@hsmyers
Copy link

hsmyers commented Sep 14, 2019 via email

@OmriSama
Copy link

@OmriSama @hsmyers could you link up your old hosts files?

You can use a service such as https://del.dog to share it here. It would help us find what record caused the issue, as I can't debug what WSL2 is doing ATM.

https://privatebin.net/?ad8f86bb68131e73#3vMBNG36nQiC32zfTALogks4Z1To5nkSzFyej199LofM

Quite messy.

@lazerl0rd
Copy link

@OmriSama try make all the records point to 127.0.0.1 and check if WSL2 works, please.

Then if it does, point them all to 0.0.0.0 and see if it works.

@OmriSama
Copy link

@OmriSama try make all the records point to 127.0.0.1 and check if WSL2 works, please.

Then if it does, point them all to 0.0.0.0 and see if it works.

Not sure; did a "find and replace all" in VScode for 127.0.0.1 to 0.0.0.0, and then the other way around. Neither worked!

@lazerl0rd
Copy link

lazerl0rd commented Sep 14, 2019

@OmriSama that's interesting. I guess it's either a common record we both had that WSL might "need" to connection check or something (most likely this), or the fact the hosts file isn't empty.

Just for the sake of it, can you try adding 0.0.0.0 lasterhub.me to the bottom of a default hosts file and try see if WSL2 will still work (this address shouldn't affect any of your services since it's my domain)?

Just to be sure too, could you do the same with 127.0.0.1 lasterhub.me please? Thanks.

@onomatopellan
Copy link

onomatopellan commented Sep 15, 2019

I think it's more about the number of entries in the Hosts file instead of a special content.

This is a Windows hosts file for ad blocking: (more than 4000 lines)
https://pastebin.com/NmaBBmMa
output when launching WSL2: "An existing connection was forcibly closed by the remote host."

And this is same hosts file with 1000 lines instead:
https://pastebin.com/SvpjgTZP
output when launching WSL2:"A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond."

Same hosts file with the first 500 lines doesn't show the problem and WSL2 launches correctly.

@lazerl0rd
Copy link

Interesting @onomatopellan. Could you try edit wsl.conf to not generate a hosts file and not resolv, then see if a big hosts file affects it?

F:\Users\XXX> wsl
XXX@XXX > ~
$ cat /etc/wsl.conf
[network]
generateHosts = false
generateResolvConf = false
XXX@XXX > ~
$ exit
F:\Users\XXX> wsl --shutdown
F:\Users\XXX> wsl

@onomatopellan
Copy link

@lazerl0rd Nope. Modifying wsl.conf didn't help and still shows the same error.

@lazerl0rd
Copy link

lazerl0rd commented Sep 15, 2019

@onomatopellan thanks. Ben will see this later and take a look.

PS: Ben, out of interest, you said you guys thought you solved the issue a while back. Since it wasn't this that you solved - what did you find and think was the issue?

@tirpen
Copy link

tirpen commented Sep 16, 2019

Long '0.0.0.0' based hosts file here. I restore the default just to start BASH and then overwrite that hosts with mine. WSL keeps working as intended.

Also, WSL2 won't start when DNS Client service is disabled. Is that by design?

@benhillis
Copy link
Member

Awesome, I have a repro. I'll get this fixed. Thanks to everybody for the help.

@steven-peralta
Copy link
Author

I can confirm @benhillis that using the default HOSTS file as of %WinDir%\System32\drivers\etc (https://support.microsoft.com/en-us/help/972034/how-to-reset-the-hosts-file-back-to-the-default) has got WSL2 working for me.

Seems this is supported by others below too.

Background info:
My hosts file was an older version of https://raw.githubusercontent.com/EnergizedProtection/block/master/extensions/porn-lite/formats/hosts-ipv6.txt.

I guess one of the following is what kills WSL2:

127.0.0.1 localhost
127.0.0.1 localhost.localdomain
127.0.0.1 local
255.255.255.255 broadcasthost
::1 localhost
::1 ip6-localhost
::1 ip6-loopback
fe80::1%lo0 localhost
ff00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
ff02::3 ip6-allhosts
0.0.0.0 0.0.0.0

Thanks @Skye19 and @chdenat for the idea. @steven-peralta since this is your issue, you might wanna take a look here.

Thanks for the information. I've since dropped out of receiving Insider builds and have reinstalled Windows 10 on my PC, but I believe I did have a custom hosts.txt file for ad-blocking before I did all of that.

@KerberosMorphy
Copy link

Hi there!, I had really hard time to set WSL2, at each update I had retry without success and look back to this issues to see any improvement.
But thanks to all of you! I would finally be able to use Docker with WSL2!

@chdenat
Copy link

chdenat commented Sep 19, 2019

Glad to have open the door ;)

@hsmyers
Copy link

hsmyers commented Sep 19, 2019 via email

@zyazhb
Copy link

zyazhb commented Sep 23, 2019

TNX for information hosts is the causion! DELETE hosts fix this.

@benhillis
Copy link
Member

Fixed in 18995.

@lelayf
Copy link

lelayf commented Nov 6, 2020

I had manually added some remote hosts to /etc/hosts under Ubuntu WSL2 and that seems to have created the same problem when those hosts ceased to exist and their DNS resolution failed. Deleting the hosts file under System32 as described above and a restart solved it.

@MarkSCQ
Copy link

MarkSCQ commented Nov 19, 2020

I dont know why, it seems restart solves everything 😆

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
wsl2 Issue/feature applies to WSL 2
Projects
None yet
Development

No branches or pull requests