Pengwin icon indicating copy to clipboard operation
Pengwin copied to clipboard

Failed to start service Docker on WSL2

Open rsrini7 opened this issue 6 years ago • 5 comments

**Trying to setup docker with real linux kernel. Followed wsl2 migration steps for WLinux. Post migration installed docker. Docker daemon not starting. ** A clear and concise description of what the bug is.

To Reproduce Steps to reproduce the behavior:

  1. Migrate to wsl2
  2. install latest docker
  3. sudo service docker start
  4. See error

time="2019-07-06T12:35:24.385197200+05:30" level=warning msg="Running modprobe bridge br_netfilter failed with message: modprobe: ERROR: ../libkmod/libkmod.c:586 kmod_search_moddep() could not open moddep file '/lib/modules/4.19.43-microsoft-standard/modules.dep.bin'\nmodprobe: WARNING: Module bridge not found in directory /lib/modules/4.19.43-microsoft-standard\nmodprobe: ERROR: ../libkmod/libkmod.c:586 kmod_search_moddep() could not open moddep file '/lib/modules/4.19.43-microsoft-standard/modules.dep.bin'\nmodprobe: WARNING: Module br_netfilter not found in directory /lib/modules/4.19.43-microsoft-standard\n, error: exit status 1" time="2019-07-06T12:35:24.386495900+05:30" level=warning msg="Running modprobe nf_nat failed with message: modprobe: ERROR: ../libkmod/libkmod.c:586 kmod_search_moddep() could not open moddep file '/lib/modules/4.19.43-microsoft-standard/modules.dep.bin'\nmodprobe: WARNING: Module nf_nat not found in directory /lib/modules/4.19.43-microsoft-standard, error: exit status 1" time="2019-07-06T12:35:24.387748100+05:30" level=warning msg="Running modprobe xt_conntrack failed with message: modprobe: ERROR: ../libkmod/libkmod.c:586 kmod_search_moddep() could not open moddep file '/lib/modules/4.19.43-microsoft-standard/modules.dep.bin'\nmodprobe: WARNING: Module xt_conntrack not found in directory /lib/modules/4.19.43-microsoft-standard, error: exit status 1" time="2019-07-06T12:35:24.410128900+05:30" level=info msg="stopping event stream following graceful shutdown" error="" module=libcontainerd namespace=moby time="2019-07-06T12:35:24.410615600+05:30" level=info msg="stopping event stream following graceful shutdown" error="context canceled" module=libcontainerd namespace=plugins.moby time="2019-07-06T12:35:24.410643100+05:30" level=info msg="stopping healthcheck following graceful shutdown" module=libcontainerd time="2019-07-06T12:35:24.411191200+05:30" level=info msg="pickfirstBalancer: HandleSubConnStateChange: 0xc420644480, TRANSIENT_FAILURE" module=grpc time="2019-07-06T12:35:24.411214100+05:30" level=info msg="pickfirstBalancer: HandleSubConnStateChange: 0xc420644480, CONNECTING" module=grpc Error starting daemon: Error initializing network controller: error obtaining controller instance: failed to create NAT chain DOCKER: iptables failed: iptables --wait -t nat -N DOCKER: iptables v1.8.2 (nf_tables): CHAIN_ADD failed (No such file or directory): chain PREROUTING

Expected behavior Docker daemon should start successfully and should be able to pull images from registry

Screenshots If applicable, add screenshots to help explain your problem.

Additional context Add any other context about the problem here.

Basic Troubleshooting Checklist

[Yes] I have searched Google for the error message. [Yes] I have checked official WSL troubleshooting documentation: https://docs.microsoft.com/en-us/windows/wsl/troubleshooting#confirm-wsl-is-enabled. [ Yes] I have searched the official Microsoft WSL issues page: https://github.com/Microsoft/WSL/issues. [ Yes] I have searched the Pengwin issues page: https://github.com/WhitewaterFoundry/Pengwin/issues. [ Yes] I have reset Pengwin: Settings->Apps->Apps & features->Pengwin->Advanced Options->Reset. [ Yes] I have disabled and re-enabled WSL in Windows Features. [ Yes] I have run Windows 10 updates and restarted.

What other troubleshooting have you attempted?

Insert here:

Pengwin Version

Find: Settings->Apps->Apps & features->Pengwin->Advanced Options->Version.

Version 1.2.5.0

Windows Build

Run 'systeminfo | findstr /C:"OS"' in Command Prompt and insert here: OS Name: Microsoft Windows 10 Home Insider Preview Single Language OS Version: 10.0.18932 N/A Build 18932 OS Manufacturer: Microsoft Corporation OS Configuration: Standalone Workstation OS Build Type: Multiprocessor Free BIOS Version: American Megatrends Inc. E16P5IMS.108, 23-04-2018

For help on retrieving: https://docs.microsoft.com/en-us/windows/wsl/troubleshooting#check-your-build-number

rsrini7 avatar Jul 06 '19 07:07 rsrini7

Exactly same as https://github.com/microsoft/WSL/issues/4165.

Biswa96 avatar Jul 06 '19 20:07 Biswa96

Thank you @Biswa96, I ran across an answer of yours on some other topic on Stack Overflow a few days ago. Always so helpful.

sirredbeard avatar Jul 08 '19 23:07 sirredbeard

The docker installer uses iptables for nat. Unfortunately Debian uses a modified version of nftables. You can convert the entries over to nftables or just setup Debian to use the legacy iptables.

sudo update-alternatives --set iptables /usr/sbin/iptables-legacy sudo update-alternatives --set ip6tables /usr/sbin/ip6tables-legacy

dockerd, should start fine after switching to iptables-legacy.

sudo service docker start

-blemis

blemis avatar Aug 04 '19 19:08 blemis

Thx a lot @blemis ! I had the same issue and now it's fixed !

C0coleplub0 avatar May 10 '23 13:05 C0coleplub0

Incredible that this solution still works. Also you can check this: https://github.com/WhitewaterFoundry/Pengwin/discussions/734

crramirez avatar May 10 '23 13:05 crramirez