docker / for-win

Bug reports for Docker Desktop for Windows
https://www.docker.com/products/docker#/windows
1.86k stars 291 forks source link

Startup Bootloop with WSL update after WSL Kernel Update #14282

Open SirLouen opened 2 months ago

SirLouen commented 2 months ago

Description

WSL: 2.3.17 Kernel: 6.6.36.6 Docker Desktop: 4.33.1

After I updated the kernel with the .wslconfig file

[wsl2]
kernel=C:\\Users\\user\\vmlinux

Up to the latest official 6.6.36.6, technically is not a "Custom Kernel" but the latest official Kernel.

I started noticing that Docker Desktop started a boot loop on startup

It's continuously asking for Windows administrative permission to execute:

C:\Program Files\Docker\Docker\resources\com.docker.admin.exe wsl-update

Which happens to return

[2024-08-24T19:43:06.574395400Z][com.docker.admin.exe.update] updating wsl with -> wsl.exe --update --web-download
[2024-08-24T19:43:06.810557400Z][com.docker.admin.exe.update] update completed successfully: Checking for updates.
The most recent version of Windows Subsystem for Linux is already installed.

But still keeps trying this in an endless loop. In the video, the administrative escalation prompt doesn't show up, but can be heard each time it pops:

https://github.com/user-attachments/assets/ce7e635a-0d30-44ab-9c80-3a8d16ae2f82

I tried adding compatibility with: https://raw.githubusercontent.com/docker/docker/master/contrib/check-config.sh

Following this advice: https://github.com/microsoft/WSL/issues/11771#issuecomment-2272556114

And all relevant CONFIG are enabled:

$ ./check-config.sh
info: reading kernel config from /proc/config.gz ...

Generally Necessary:
- cgroup hierarchy: properly mounted [/sys/fs/cgroup]
- CONFIG_NAMESPACES: enabled
- CONFIG_NET_NS: enabled
- CONFIG_PID_NS: enabled
- CONFIG_IPC_NS: enabled
- CONFIG_UTS_NS: enabled
- CONFIG_CGROUPS: enabled
- CONFIG_CGROUP_CPUACCT: enabled
- CONFIG_CGROUP_DEVICE: enabled
- CONFIG_CGROUP_FREEZER: enabled
- CONFIG_CGROUP_SCHED: enabled
- CONFIG_CPUSETS: enabled
- CONFIG_MEMCG: enabled
- CONFIG_KEYS: enabled
- CONFIG_VETH: enabled
- CONFIG_BRIDGE: enabled
- CONFIG_BRIDGE_NETFILTER: enabled
- CONFIG_IP_NF_FILTER: enabled
- CONFIG_IP_NF_MANGLE: enabled
- CONFIG_IP_NF_TARGET_MASQUERADE: enabled
- CONFIG_NETFILTER_XT_MATCH_ADDRTYPE: enabled
- CONFIG_NETFILTER_XT_MATCH_CONNTRACK: enabled
- CONFIG_NETFILTER_XT_MATCH_IPVS: enabled
- CONFIG_NETFILTER_XT_MARK: enabled
- CONFIG_IP_NF_NAT: enabled
- CONFIG_NF_NAT: enabled
- CONFIG_POSIX_MQUEUE: enabled
- CONFIG_CGROUP_BPF: enabled

Optional Features:
- CONFIG_USER_NS: enabled
- CONFIG_SECCOMP: enabled
- CONFIG_SECCOMP_FILTER: enabled
- CONFIG_CGROUP_PIDS: enabled
- CONFIG_MEMCG_SWAP: missing
    (cgroup swap accounting is currently enabled)
- CONFIG_LEGACY_VSYSCALL_NONE: enabled
    (containers using eglibc <= 2.13 will not work. Switch to
     "CONFIG_VSYSCALL_[NATIVE|EMULATE]" or use "vsyscall=[native|emulate]"
     on kernel command line. Note that this will disable ASLR for the,
     VDSO which may assist in exploiting security vulnerabilities.)
- CONFIG_BLK_CGROUP: enabled
- CONFIG_BLK_DEV_THROTTLING: enabled
- CONFIG_CGROUP_PERF: enabled
- CONFIG_CGROUP_HUGETLB: enabled
- CONFIG_NET_CLS_CGROUP: enabled
- CONFIG_CGROUP_NET_PRIO: enabled
- CONFIG_CFS_BANDWIDTH: enabled
- CONFIG_FAIR_GROUP_SCHED: enabled
- CONFIG_IP_NF_TARGET_REDIRECT: enabled
- CONFIG_IP_VS: enabled
- CONFIG_IP_VS_NFCT: enabled
- CONFIG_IP_VS_PROTO_TCP: enabled
- CONFIG_IP_VS_PROTO_UDP: enabled
- CONFIG_IP_VS_RR: enabled
- CONFIG_SECURITY_SELINUX: enabled
- CONFIG_SECURITY_APPARMOR: enabled
- CONFIG_EXT3_FS: missing
- CONFIG_EXT3_FS_XATTR: missing
- CONFIG_EXT3_FS_POSIX_ACL: missing
- CONFIG_EXT3_FS_SECURITY: missing
    (enable these ext3 configs if you are using ext3 as backing filesystem)
- CONFIG_EXT4_FS: enabled
- CONFIG_EXT4_FS_POSIX_ACL: enabled
- CONFIG_EXT4_FS_SECURITY: enabled
- Network Drivers:
  - "overlay":
    - CONFIG_VXLAN: enabled
    - CONFIG_BRIDGE_VLAN_FILTERING: enabled
      Optional (for encrypted networks):
      - CONFIG_CRYPTO: enabled
      - CONFIG_CRYPTO_AEAD: enabled
      - CONFIG_CRYPTO_GCM: enabled
      - CONFIG_CRYPTO_SEQIV: enabled
      - CONFIG_CRYPTO_GHASH: enabled
      - CONFIG_XFRM: enabled
      - CONFIG_XFRM_USER: enabled
      - CONFIG_XFRM_ALGO: enabled
      - CONFIG_INET_ESP: enabled
      - CONFIG_NETFILTER_XT_MATCH_BPF: enabled (as module)
  - "ipvlan":
    - CONFIG_IPVLAN: enabled
  - "macvlan":
    - CONFIG_MACVLAN: enabled
    - CONFIG_DUMMY: enabled
  - "ftp,tftp client in container":
    - CONFIG_NF_NAT_FTP: enabled
    - CONFIG_NF_CONNTRACK_FTP: enabled
    - CONFIG_NF_NAT_TFTP: enabled
    - CONFIG_NF_CONNTRACK_TFTP: enabled
- Storage Drivers:
  - "btrfs":
    - CONFIG_BTRFS_FS: enabled
    - CONFIG_BTRFS_FS_POSIX_ACL: enabled
  - "overlay":
    - CONFIG_OVERLAY_FS: enabled
  - "zfs":
    - /dev/zfs: missing
    - zfs command: missing
    - zpool command: missing

Limits:
- /proc/sys/kernel/keys/root_maxkeys: 1000000

I noted that downgrading to 4.33.0 as suggested here: https://github.com/docker/for-win/issues/14236#issuecomment-2272079082

Sorted the issue… I don't really understand why the man closed the Issue because there is a clear issue with the 4.33.1 update that conflicts with the latest 6.6 Kernel that doesn't appear in 4.33.0 (new error appearS)

It's strange because the 4.33.1 version was meant to add support for the new WSL version

Bug fixes and enhancements For Windows Added support for WSL2 2.3.11 and above, which includes loadable kernel modules. Fixes docker/for-win#14222

With 4.33.0 new error appears:

"waiting for the VM setup to be ready: context canceled"

Reproduce

  1. Compile the latest WSL kernel https://github.com/microsoft/WSL2-Linux-Kernel/releases/tag/linux-msft-wsl-6.6.36.3 Steps to compile: 1.1 Download the WSL2-Linux-Kernel 1.2 Extract and copy the config file attached as .config in the Kernel source files

config-6.6.36.3.txt

1.3 Run commands:

make prepare modules_prepare -j $(expr $(nproc) - 1)
make modules -j $(expr $(nproc) - 1)
sudo make modules_install
make -j $(expr $(nproc) - 1)
sudo make install

1.4 Then copy the vmlinux in a place where Windows host can read it

  1. Add the file it to the .wslconfig to run WSL with it

    [wsl2]
    kernel=C:\\Users\\user\\vmlinux
  2. Shutdown wsl with wsl --shutdown to refresh with the new Kernel

  3. Start a fresh installation of Docker Desktop

Expected behavior

Docker Desktop should initialize like normally.

docker version

Client:
 Version:           27.1.1
 API version:       1.46
 Go version:        go1.21.12
 Git commit:        6312585
 Built:             Tue Jul 23 19:57:57 2024
 OS/Arch:           windows/amd64
 Context:           desktop-linux

Server: Docker Desktop 4.33.1 (161083)
 Engine:
  Version:          27.1.1
  API version:      1.46 (minimum version 1.24)
  Go version:       go1.21.12
  Git commit:       cc13f95
  Built:            Tue Jul 23 19:57:19 2024
  OS/Arch:          linux/amd64
  Experimental:     false
 containerd:
  Version:          1.7.19
  GitCommit:        2bf793ef6dc9a18e00cb12efb64355c2c9d5eb41
 runc:
  Version:          1.7.19
  GitCommit:        v1.1.13-0-g58aa920
 docker-init:
  Version:          0.19.0
  GitCommit:        de40ad0

docker info

Client:
 Version:    27.1.1
 Context:    desktop-linux
 Debug Mode: false
 Plugins:
  buildx: Docker Buildx (Docker Inc.)
    Version:  v0.16.1-desktop.1
    Path:     C:\Program Files\Docker\cli-plugins\docker-buildx.exe
  compose: Docker Compose (Docker Inc.)
    Version:  v2.29.1-desktop.1
    Path:     C:\Program Files\Docker\cli-plugins\docker-compose.exe
  debug: Get a shell into any image or container (Docker Inc.)
    Version:  0.0.34
    Path:     C:\Program Files\Docker\cli-plugins\docker-debug.exe
  desktop: Docker Desktop commands (Alpha) (Docker Inc.)
    Version:  v0.0.14
    Path:     C:\Program Files\Docker\cli-plugins\docker-desktop.exe
  dev: Docker Dev Environments (Docker Inc.)
    Version:  v0.1.2
    Path:     C:\Program Files\Docker\cli-plugins\docker-dev.exe
  extension: Manages Docker extensions (Docker Inc.)
    Version:  v0.2.25
    Path:     C:\Program Files\Docker\cli-plugins\docker-extension.exe
  feedback: Provide feedback, right in your terminal! (Docker Inc.)
    Version:  v1.0.5
    Path:     C:\Program Files\Docker\cli-plugins\docker-feedback.exe
  init: Creates Docker-related starter files for your project (Docker Inc.)
    Version:  v1.3.0
    Path:     C:\Program Files\Docker\cli-plugins\docker-init.exe
  sbom: View the packaged-based Software Bill Of Materials (SBOM) for an image (Anchore Inc.)
    Version:  0.6.0
    Path:     C:\Program Files\Docker\cli-plugins\docker-sbom.exe
  scout: Docker Scout (Docker Inc.)
    Version:  v1.11.0
    Path:     C:\Program Files\Docker\cli-plugins\docker-scout.exe

Server:
ERROR: error during connect: Get "http://%2F%2F.%2Fpipe%2FdockerDesktopLinuxEngine/v1.46/info": open //./pipe/dockerDesktopLinuxEngine: The system cannot find the file specified.
errors pretty printing info

Diagnostics ID

77F07B67-A67F-4B23-86A1-9FBE325F6292/20240824194655

Additional Info

If I switch back to the regular kernel, removing the .wslconfig kernel line, Docker Desktop works adequately.

SirLouen commented 2 months ago

After all the evening thrown to the bin, installing, uninstalling, and testing dozens of versions of WSL & Docker Desktop, I've finally discovered the issue:

For some stupid reason WSL 2.3.17.0 DOWNGRADES default Kernel version to 5.15.153.1, because WSL 2.3.14.0 has, by default Kernel 6.6.36.3-1. Why? Noone knows.

So basically, I downgraded to WSL 2.3.14.0 and now everything is working well again.

Anyway, I think that it is very weird that a completely default compilation of 6.6.36.3-1 breaks Docker Desktop (also under WSL 2.3.14.0), but using default kernel, it works.

So I will leave this issue open for future review because there is clearly a bug with using the WSL custom kernel functionality (not because of a custom kernel itself, because, as I say, it's 100% default settings provided in Microsoft/wsl-config as provided by official docks, no extra modules or anything). I think its very useful to be able to compile custom kernels with some specific modules (specially after 6.6 with the new Module settings), because it could open some uses cases and compatibility with certain devices not loaded by default

constantin-ungureanu-github commented 2 months ago

Please have a look over here https://wsl.dev/wslcilium/ At step Configure WSL2: Once the Kernel is built, we need to configure both the distro and WSL2. Doing an update of wsl does not update the kernel to latest (wsl --update), at least not yet.

I haven't tried this out, but it might be because of mismatching Kernel headers and modules of the wsl.

RobTranquillo commented 2 months ago

I am facing the same issue (endless startup loop) right after updating Docker Desktop to the latest version in the GUI. I have never compiled Docker or parts of it myself. I had installed Docker Desktop back then in a simple and straightforward way.

If Docker Desktop is not started with elevated permissions, it requests permissions over and over again. If I refuse, I get the error: wsl update failed: updating wsl: elevated update failed: the operating system denied access to the specified file: grafik

Clicking on ‘Gather diagnostics’ also hangs forever.

Edit: after waiting extra long for diagnistics I got an ID: 95D91F57-DD23-4775-AAEF-8776CBA9C6AB/20240829113646 maybe that helps.

Edit2: Running wsl --update in Windows cmd it states I'am on the newest Version

SirLouen commented 2 months ago

Please have a look over here https://wsl.dev/wslcilium/ At step Configure WSL2: Once the Kernel is built, we need to configure both the distro and WSL2. Doing an update of wsl does not update the kernel to latest (wsl --update), at least not yet.

I haven't tried this out, but it might be because of mismatching Kernel headers and modules of the wsl.

Thanks for the link, I was following some very similar (with the -j part included to speed up things) https://github.com/kevin-doolaeghe/wsl-kernel-modules

But that is not the biggest problem here. There are many reports for this issue with custom Kernel. I'm wondering whats going on. Surely they have to update this https://raw.githubusercontent.com/docker/docker/master/contrib/check-config.sh

Because I'm 90% confident that the issue here is a missing module that is not being checked and is critical for this to work.

constantin-ungureanu-github commented 2 months ago

It seems the issue is in wsl. The latest released wsl version is 2.2.4 at the moment, with kernel 5.15 . The kernel 6.6.36 has been added and later reverted in wsl 2.3.17 pre-release, it doesn't say what was the problem, I suspect what we're having here. I tried it out and I got the same behavior, with version 6.6.36 of custom kernel or kernel from pre-release wsl 2.3.14. It looks we'll have to wait until wsl with kernel 6.6+ is fixed and oficially released. Some module might be missing, indeed. https://github.com/microsoft/WSL/releases

SirLouen commented 2 months ago

I tried it out and I got the same behavior, with version 6.6.36 of custom kernel or kernel from pre-release wsl 2.3.14. It looks we'll have to wait until wsl with kernel 6.6+ is fixed and oficially released. Some module might be missing, indeed. https://github.com/microsoft/WSL/releases

It's working for me:

# wsl --version
WSL version: 2.3.14.0
Kernel version: 6.6.36.3-1
WSLg version: 1.0.64
MSRDC version: 1.2.5326
Direct3D version: 1.611.1-81528511
DXCore version: 10.0.26100.1-240331-1435.ge-release
Windows version: 10.0.22631.4037
# docker --version
Docker version 27.1.1, build 6312585

image

But NOT with the same Kernel compiled by myself with default WSL parameters (+ check-config.sh parameters added for compliance)

So no, it's not a WSL problem but a Docker Desktop issue. As I said, I'm 90% confident, that there is some kernel module that must be loaded but check-config.sh is not picking. I wonder which modules are being loaded with the default Kernel configuration for comparison (they suggest that their compilation is based on Microsoft/wsl_config file), but since neither in the WSL repo, nor this repo I can find any contrastable information, given the closed sourced nature of both projects.

valorisa commented 2 months ago

Description

WSL: 2.3.17 Kernel: 6.6.36.6 Docker Desktop: 4.33.1

After I updated the kernel with the .wslconfig file

[wsl2]
kernel=C:\\Users\\user\\vmlinux

Up to the latest official 6.6.36.6, technically is not a "Custom Kernel" but the latest official Kernel.

I started noticing that Docker Desktop started a boot loop on startup

It's continuously asking for Windows administrative permission to execute:

C:\Program Files\Docker\Docker\resources\com.docker.admin.exe wsl-update

Which happens to return

[2024-08-24T19:43:06.574395400Z][com.docker.admin.exe.update] updating wsl with -> wsl.exe --update --web-download
[2024-08-24T19:43:06.810557400Z][com.docker.admin.exe.update] update completed successfully: Checking for updates.
The most recent version of Windows Subsystem for Linux is already installed.

But still keeps trying this in an endless loop. In the video, the administrative escalation prompt doesn't show up, but can be heard each time it pops:

Untitled.video.-.Made.with.Clipchamp.mp4 I tried adding compatibility with: https://raw.githubusercontent.com/docker/docker/master/contrib/check-config.sh

Following this advice: microsoft/WSL#11771 (comment)

And all relevant CONFIG are enabled:

$ ./check-config.sh
info: reading kernel config from /proc/config.gz ...

Generally Necessary:
- cgroup hierarchy: properly mounted [/sys/fs/cgroup]
- CONFIG_NAMESPACES: enabled
- CONFIG_NET_NS: enabled
- CONFIG_PID_NS: enabled
- CONFIG_IPC_NS: enabled
- CONFIG_UTS_NS: enabled
- CONFIG_CGROUPS: enabled
- CONFIG_CGROUP_CPUACCT: enabled
- CONFIG_CGROUP_DEVICE: enabled
- CONFIG_CGROUP_FREEZER: enabled
- CONFIG_CGROUP_SCHED: enabled
- CONFIG_CPUSETS: enabled
- CONFIG_MEMCG: enabled
- CONFIG_KEYS: enabled
- CONFIG_VETH: enabled
- CONFIG_BRIDGE: enabled
- CONFIG_BRIDGE_NETFILTER: enabled
- CONFIG_IP_NF_FILTER: enabled
- CONFIG_IP_NF_MANGLE: enabled
- CONFIG_IP_NF_TARGET_MASQUERADE: enabled
- CONFIG_NETFILTER_XT_MATCH_ADDRTYPE: enabled
- CONFIG_NETFILTER_XT_MATCH_CONNTRACK: enabled
- CONFIG_NETFILTER_XT_MATCH_IPVS: enabled
- CONFIG_NETFILTER_XT_MARK: enabled
- CONFIG_IP_NF_NAT: enabled
- CONFIG_NF_NAT: enabled
- CONFIG_POSIX_MQUEUE: enabled
- CONFIG_CGROUP_BPF: enabled

Optional Features:
- CONFIG_USER_NS: enabled
- CONFIG_SECCOMP: enabled
- CONFIG_SECCOMP_FILTER: enabled
- CONFIG_CGROUP_PIDS: enabled
- CONFIG_MEMCG_SWAP: missing
    (cgroup swap accounting is currently enabled)
- CONFIG_LEGACY_VSYSCALL_NONE: enabled
    (containers using eglibc <= 2.13 will not work. Switch to
     "CONFIG_VSYSCALL_[NATIVE|EMULATE]" or use "vsyscall=[native|emulate]"
     on kernel command line. Note that this will disable ASLR for the,
     VDSO which may assist in exploiting security vulnerabilities.)
- CONFIG_BLK_CGROUP: enabled
- CONFIG_BLK_DEV_THROTTLING: enabled
- CONFIG_CGROUP_PERF: enabled
- CONFIG_CGROUP_HUGETLB: enabled
- CONFIG_NET_CLS_CGROUP: enabled
- CONFIG_CGROUP_NET_PRIO: enabled
- CONFIG_CFS_BANDWIDTH: enabled
- CONFIG_FAIR_GROUP_SCHED: enabled
- CONFIG_IP_NF_TARGET_REDIRECT: enabled
- CONFIG_IP_VS: enabled
- CONFIG_IP_VS_NFCT: enabled
- CONFIG_IP_VS_PROTO_TCP: enabled
- CONFIG_IP_VS_PROTO_UDP: enabled
- CONFIG_IP_VS_RR: enabled
- CONFIG_SECURITY_SELINUX: enabled
- CONFIG_SECURITY_APPARMOR: enabled
- CONFIG_EXT3_FS: missing
- CONFIG_EXT3_FS_XATTR: missing
- CONFIG_EXT3_FS_POSIX_ACL: missing
- CONFIG_EXT3_FS_SECURITY: missing
    (enable these ext3 configs if you are using ext3 as backing filesystem)
- CONFIG_EXT4_FS: enabled
- CONFIG_EXT4_FS_POSIX_ACL: enabled
- CONFIG_EXT4_FS_SECURITY: enabled
- Network Drivers:
  - "overlay":
    - CONFIG_VXLAN: enabled
    - CONFIG_BRIDGE_VLAN_FILTERING: enabled
      Optional (for encrypted networks):
      - CONFIG_CRYPTO: enabled
      - CONFIG_CRYPTO_AEAD: enabled
      - CONFIG_CRYPTO_GCM: enabled
      - CONFIG_CRYPTO_SEQIV: enabled
      - CONFIG_CRYPTO_GHASH: enabled
      - CONFIG_XFRM: enabled
      - CONFIG_XFRM_USER: enabled
      - CONFIG_XFRM_ALGO: enabled
      - CONFIG_INET_ESP: enabled
      - CONFIG_NETFILTER_XT_MATCH_BPF: enabled (as module)
  - "ipvlan":
    - CONFIG_IPVLAN: enabled
  - "macvlan":
    - CONFIG_MACVLAN: enabled
    - CONFIG_DUMMY: enabled
  - "ftp,tftp client in container":
    - CONFIG_NF_NAT_FTP: enabled
    - CONFIG_NF_CONNTRACK_FTP: enabled
    - CONFIG_NF_NAT_TFTP: enabled
    - CONFIG_NF_CONNTRACK_TFTP: enabled
- Storage Drivers:
  - "btrfs":
    - CONFIG_BTRFS_FS: enabled
    - CONFIG_BTRFS_FS_POSIX_ACL: enabled
  - "overlay":
    - CONFIG_OVERLAY_FS: enabled
  - "zfs":
    - /dev/zfs: missing
    - zfs command: missing
    - zpool command: missing

Limits:
- /proc/sys/kernel/keys/root_maxkeys: 1000000

I noted that downgrading to 4.33.0 as suggested here: #14236 (comment)

Sorted the issue… I don't really understand why the man closed the Issue because there is a clear issue with the 4.33.1 update that conflicts with the latest 6.6 Kernel that doesn't appear in 4.33.0 (new error appearS)

It's strange because the 4.33.1 version was meant to add support for the new WSL version

Bug fixes and enhancements For Windows Added support for WSL2 2.3.11 and above, which includes loadable kernel modules. Fixes docker/for-win#14222

With 4.33.0 new error appears:

"waiting for the VM setup to be ready: context canceled"

Reproduce

  1. Compile the latest WSL kernel https://github.com/microsoft/WSL2-Linux-Kernel/releases/tag/linux-msft-wsl-6.6.36.3 Steps to compile: 1.1 Download the WSL2-Linux-Kernel 1.2 Extract and copy the config file attached as .config in the Kernel source files

config-6.6.36.3.txt

1.3 Run commands:

make prepare modules_prepare -j $(expr $(nproc) - 1)
make modules -j $(expr $(nproc) - 1)
sudo make modules_install
make -j $(expr $(nproc) - 1)
sudo make install

1.4 Then copy the vmlinux in a place where Windows host can read it

  1. Add the file it to the .wslconfig to run WSL with it
[wsl2]
kernel=C:\\Users\\user\\vmlinux
  1. Shutdown wsl with wsl --shutdown to refresh with the new Kernel
  2. Start a fresh installation of Docker Desktop

Expected behavior

Docker Desktop should initialize like normally.

docker version

Client:
 Version:           27.1.1
 API version:       1.46
 Go version:        go1.21.12
 Git commit:        6312585
 Built:             Tue Jul 23 19:57:57 2024
 OS/Arch:           windows/amd64
 Context:           desktop-linux

Server: Docker Desktop 4.33.1 (161083)
 Engine:
  Version:          27.1.1
  API version:      1.46 (minimum version 1.24)
  Go version:       go1.21.12
  Git commit:       cc13f95
  Built:            Tue Jul 23 19:57:19 2024
  OS/Arch:          linux/amd64
  Experimental:     false
 containerd:
  Version:          1.7.19
  GitCommit:        2bf793ef6dc9a18e00cb12efb64355c2c9d5eb41
 runc:
  Version:          1.7.19
  GitCommit:        v1.1.13-0-g58aa920
 docker-init:
  Version:          0.19.0
  GitCommit:        de40ad0

docker info

Client:
 Version:    27.1.1
 Context:    desktop-linux
 Debug Mode: false
 Plugins:
  buildx: Docker Buildx (Docker Inc.)
    Version:  v0.16.1-desktop.1
    Path:     C:\Program Files\Docker\cli-plugins\docker-buildx.exe
  compose: Docker Compose (Docker Inc.)
    Version:  v2.29.1-desktop.1
    Path:     C:\Program Files\Docker\cli-plugins\docker-compose.exe
  debug: Get a shell into any image or container (Docker Inc.)
    Version:  0.0.34
    Path:     C:\Program Files\Docker\cli-plugins\docker-debug.exe
  desktop: Docker Desktop commands (Alpha) (Docker Inc.)
    Version:  v0.0.14
    Path:     C:\Program Files\Docker\cli-plugins\docker-desktop.exe
  dev: Docker Dev Environments (Docker Inc.)
    Version:  v0.1.2
    Path:     C:\Program Files\Docker\cli-plugins\docker-dev.exe
  extension: Manages Docker extensions (Docker Inc.)
    Version:  v0.2.25
    Path:     C:\Program Files\Docker\cli-plugins\docker-extension.exe
  feedback: Provide feedback, right in your terminal! (Docker Inc.)
    Version:  v1.0.5
    Path:     C:\Program Files\Docker\cli-plugins\docker-feedback.exe
  init: Creates Docker-related starter files for your project (Docker Inc.)
    Version:  v1.3.0
    Path:     C:\Program Files\Docker\cli-plugins\docker-init.exe
  sbom: View the packaged-based Software Bill Of Materials (SBOM) for an image (Anchore Inc.)
    Version:  0.6.0
    Path:     C:\Program Files\Docker\cli-plugins\docker-sbom.exe
  scout: Docker Scout (Docker Inc.)
    Version:  v1.11.0
    Path:     C:\Program Files\Docker\cli-plugins\docker-scout.exe

Server:
ERROR: error during connect: Get "http://%2F%2F.%2Fpipe%2FdockerDesktopLinuxEngine/v1.46/info": open //./pipe/dockerDesktopLinuxEngine: The system cannot find the file specified.
errors pretty printing info

Diagnostics ID

77F07B67-A67F-4B23-86A1-9FBE325F6292/20240824194655

Additional Info

If I switch back to the regular kernel, removing the .wslconfig kernel line, Docker Desktop works adequately.

And if you want build custom kernel like https://cdn.kernel.org/pub/linux/kernel/v6.x/linux-6.10.7.tar.xz ? Does the same procedure work?

SirLouen commented 2 months ago

Description

WSL: 2.3.17 Kernel: 6.6.36.6 Docker Desktop: 4.33.1 After I updated the kernel with the .wslconfig file

[wsl2]
kernel=C:\\Users\\user\\vmlinux

Up to the latest official 6.6.36.6, technically is not a "Custom Kernel" but the latest official Kernel. I started noticing that Docker Desktop started a boot loop on startup It's continuously asking for Windows administrative permission to execute:

C:\Program Files\Docker\Docker\resources\com.docker.admin.exe wsl-update

Which happens to return

[2024-08-24T19:43:06.574395400Z][com.docker.admin.exe.update] updating wsl with -> wsl.exe --update --web-download
[2024-08-24T19:43:06.810557400Z][com.docker.admin.exe.update] update completed successfully: Checking for updates.
The most recent version of Windows Subsystem for Linux is already installed.

But still keeps trying this in an endless loop. In the video, the administrative escalation prompt doesn't show up, but can be heard each time it pops: Untitled.video.-.Made.with.Clipchamp.mp4 I tried adding compatibility with: https://raw.githubusercontent.com/docker/docker/master/contrib/check-config.sh Following this advice: microsoft/WSL#11771 (comment) And all relevant CONFIG are enabled:

$ ./check-config.sh
info: reading kernel config from /proc/config.gz ...

Generally Necessary:
- cgroup hierarchy: properly mounted [/sys/fs/cgroup]
- CONFIG_NAMESPACES: enabled
- CONFIG_NET_NS: enabled
- CONFIG_PID_NS: enabled
- CONFIG_IPC_NS: enabled
- CONFIG_UTS_NS: enabled
- CONFIG_CGROUPS: enabled
- CONFIG_CGROUP_CPUACCT: enabled
- CONFIG_CGROUP_DEVICE: enabled
- CONFIG_CGROUP_FREEZER: enabled
- CONFIG_CGROUP_SCHED: enabled
- CONFIG_CPUSETS: enabled
- CONFIG_MEMCG: enabled
- CONFIG_KEYS: enabled
- CONFIG_VETH: enabled
- CONFIG_BRIDGE: enabled
- CONFIG_BRIDGE_NETFILTER: enabled
- CONFIG_IP_NF_FILTER: enabled
- CONFIG_IP_NF_MANGLE: enabled
- CONFIG_IP_NF_TARGET_MASQUERADE: enabled
- CONFIG_NETFILTER_XT_MATCH_ADDRTYPE: enabled
- CONFIG_NETFILTER_XT_MATCH_CONNTRACK: enabled
- CONFIG_NETFILTER_XT_MATCH_IPVS: enabled
- CONFIG_NETFILTER_XT_MARK: enabled
- CONFIG_IP_NF_NAT: enabled
- CONFIG_NF_NAT: enabled
- CONFIG_POSIX_MQUEUE: enabled
- CONFIG_CGROUP_BPF: enabled

Optional Features:
- CONFIG_USER_NS: enabled
- CONFIG_SECCOMP: enabled
- CONFIG_SECCOMP_FILTER: enabled
- CONFIG_CGROUP_PIDS: enabled
- CONFIG_MEMCG_SWAP: missing
    (cgroup swap accounting is currently enabled)
- CONFIG_LEGACY_VSYSCALL_NONE: enabled
    (containers using eglibc <= 2.13 will not work. Switch to
     "CONFIG_VSYSCALL_[NATIVE|EMULATE]" or use "vsyscall=[native|emulate]"
     on kernel command line. Note that this will disable ASLR for the,
     VDSO which may assist in exploiting security vulnerabilities.)
- CONFIG_BLK_CGROUP: enabled
- CONFIG_BLK_DEV_THROTTLING: enabled
- CONFIG_CGROUP_PERF: enabled
- CONFIG_CGROUP_HUGETLB: enabled
- CONFIG_NET_CLS_CGROUP: enabled
- CONFIG_CGROUP_NET_PRIO: enabled
- CONFIG_CFS_BANDWIDTH: enabled
- CONFIG_FAIR_GROUP_SCHED: enabled
- CONFIG_IP_NF_TARGET_REDIRECT: enabled
- CONFIG_IP_VS: enabled
- CONFIG_IP_VS_NFCT: enabled
- CONFIG_IP_VS_PROTO_TCP: enabled
- CONFIG_IP_VS_PROTO_UDP: enabled
- CONFIG_IP_VS_RR: enabled
- CONFIG_SECURITY_SELINUX: enabled
- CONFIG_SECURITY_APPARMOR: enabled
- CONFIG_EXT3_FS: missing
- CONFIG_EXT3_FS_XATTR: missing
- CONFIG_EXT3_FS_POSIX_ACL: missing
- CONFIG_EXT3_FS_SECURITY: missing
    (enable these ext3 configs if you are using ext3 as backing filesystem)
- CONFIG_EXT4_FS: enabled
- CONFIG_EXT4_FS_POSIX_ACL: enabled
- CONFIG_EXT4_FS_SECURITY: enabled
- Network Drivers:
  - "overlay":
    - CONFIG_VXLAN: enabled
    - CONFIG_BRIDGE_VLAN_FILTERING: enabled
      Optional (for encrypted networks):
      - CONFIG_CRYPTO: enabled
      - CONFIG_CRYPTO_AEAD: enabled
      - CONFIG_CRYPTO_GCM: enabled
      - CONFIG_CRYPTO_SEQIV: enabled
      - CONFIG_CRYPTO_GHASH: enabled
      - CONFIG_XFRM: enabled
      - CONFIG_XFRM_USER: enabled
      - CONFIG_XFRM_ALGO: enabled
      - CONFIG_INET_ESP: enabled
      - CONFIG_NETFILTER_XT_MATCH_BPF: enabled (as module)
  - "ipvlan":
    - CONFIG_IPVLAN: enabled
  - "macvlan":
    - CONFIG_MACVLAN: enabled
    - CONFIG_DUMMY: enabled
  - "ftp,tftp client in container":
    - CONFIG_NF_NAT_FTP: enabled
    - CONFIG_NF_CONNTRACK_FTP: enabled
    - CONFIG_NF_NAT_TFTP: enabled
    - CONFIG_NF_CONNTRACK_TFTP: enabled
- Storage Drivers:
  - "btrfs":
    - CONFIG_BTRFS_FS: enabled
    - CONFIG_BTRFS_FS_POSIX_ACL: enabled
  - "overlay":
    - CONFIG_OVERLAY_FS: enabled
  - "zfs":
    - /dev/zfs: missing
    - zfs command: missing
    - zpool command: missing

Limits:
- /proc/sys/kernel/keys/root_maxkeys: 1000000

I noted that downgrading to 4.33.0 as suggested here: #14236 (comment) Sorted the issue… I don't really understand why the man closed the Issue because there is a clear issue with the 4.33.1 update that conflicts with the latest 6.6 Kernel that doesn't appear in 4.33.0 (new error appearS) It's strange because the 4.33.1 version was meant to add support for the new WSL version

Bug fixes and enhancements For Windows Added support for WSL2 2.3.11 and above, which includes loadable kernel modules. Fixes docker/for-win#14222

With 4.33.0 new error appears:

"waiting for the VM setup to be ready: context canceled"

Reproduce

  1. Compile the latest WSL kernel https://github.com/microsoft/WSL2-Linux-Kernel/releases/tag/linux-msft-wsl-6.6.36.3 Steps to compile: 1.1 Download the WSL2-Linux-Kernel 1.2 Extract and copy the config file attached as .config in the Kernel source files

config-6.6.36.3.txt 1.3 Run commands:

make prepare modules_prepare -j $(expr $(nproc) - 1)
make modules -j $(expr $(nproc) - 1)
sudo make modules_install
make -j $(expr $(nproc) - 1)
sudo make install

1.4 Then copy the vmlinux in a place where Windows host can read it

  1. Add the file it to the .wslconfig to run WSL with it
[wsl2]
kernel=C:\\Users\\user\\vmlinux
  1. Shutdown wsl with wsl --shutdown to refresh with the new Kernel
  2. Start a fresh installation of Docker Desktop

Expected behavior

Docker Desktop should initialize like normally.

docker version

Client:
 Version:           27.1.1
 API version:       1.46
 Go version:        go1.21.12
 Git commit:        6312585
 Built:             Tue Jul 23 19:57:57 2024
 OS/Arch:           windows/amd64
 Context:           desktop-linux

Server: Docker Desktop 4.33.1 (161083)
 Engine:
  Version:          27.1.1
  API version:      1.46 (minimum version 1.24)
  Go version:       go1.21.12
  Git commit:       cc13f95
  Built:            Tue Jul 23 19:57:19 2024
  OS/Arch:          linux/amd64
  Experimental:     false
 containerd:
  Version:          1.7.19
  GitCommit:        2bf793ef6dc9a18e00cb12efb64355c2c9d5eb41
 runc:
  Version:          1.7.19
  GitCommit:        v1.1.13-0-g58aa920
 docker-init:
  Version:          0.19.0
  GitCommit:        de40ad0

docker info

Client:
 Version:    27.1.1
 Context:    desktop-linux
 Debug Mode: false
 Plugins:
  buildx: Docker Buildx (Docker Inc.)
    Version:  v0.16.1-desktop.1
    Path:     C:\Program Files\Docker\cli-plugins\docker-buildx.exe
  compose: Docker Compose (Docker Inc.)
    Version:  v2.29.1-desktop.1
    Path:     C:\Program Files\Docker\cli-plugins\docker-compose.exe
  debug: Get a shell into any image or container (Docker Inc.)
    Version:  0.0.34
    Path:     C:\Program Files\Docker\cli-plugins\docker-debug.exe
  desktop: Docker Desktop commands (Alpha) (Docker Inc.)
    Version:  v0.0.14
    Path:     C:\Program Files\Docker\cli-plugins\docker-desktop.exe
  dev: Docker Dev Environments (Docker Inc.)
    Version:  v0.1.2
    Path:     C:\Program Files\Docker\cli-plugins\docker-dev.exe
  extension: Manages Docker extensions (Docker Inc.)
    Version:  v0.2.25
    Path:     C:\Program Files\Docker\cli-plugins\docker-extension.exe
  feedback: Provide feedback, right in your terminal! (Docker Inc.)
    Version:  v1.0.5
    Path:     C:\Program Files\Docker\cli-plugins\docker-feedback.exe
  init: Creates Docker-related starter files for your project (Docker Inc.)
    Version:  v1.3.0
    Path:     C:\Program Files\Docker\cli-plugins\docker-init.exe
  sbom: View the packaged-based Software Bill Of Materials (SBOM) for an image (Anchore Inc.)
    Version:  0.6.0
    Path:     C:\Program Files\Docker\cli-plugins\docker-sbom.exe
  scout: Docker Scout (Docker Inc.)
    Version:  v1.11.0
    Path:     C:\Program Files\Docker\cli-plugins\docker-scout.exe

Server:
ERROR: error during connect: Get "http://%2F%2F.%2Fpipe%2FdockerDesktopLinuxEngine/v1.46/info": open //./pipe/dockerDesktopLinuxEngine: The system cannot find the file specified.
errors pretty printing info

Diagnostics ID

77F07B67-A67F-4B23-86A1-9FBE325F6292/20240824194655

Additional Info

If I switch back to the regular kernel, removing the .wslconfig kernel line, Docker Desktop works adequately.

And if you want build custom kernel like https://cdn.kernel.org/pub/linux/kernel/v6.x/linux-6.10.7.tar.xz ? Does the same procedure work?

According to the WSL site, generic kernels wont work well with WSL itself. Only WSL kernels seems to be working. Try to see if you WSL boots first with a fully custom non-WSL kernel.

valorisa commented 2 months ago

I'll try it.