简体   繁体   中英

Cannot run docker 4.14.1 WSL2 on Windows11

i'm trying tom run docker after setup and follow steps here also follow steps for Enable virtualization on Windows 11/BIOS

在此处输入图像描述 在此处输入图像描述

after clicking start, service show running and then stop & desktop docker close.

I got these error below:

docker version

C:\Windows\system32>docker version
error during connect: In the default daemon configuration on Windows, the docker client must be run with elevated privileges to connect.: Get "http://%2F%2F.%2Fpipe%2Fdocker_engine/v1.24/version": open //./pipe/docker_engine: The system cannot find the file specified.
Client:
 Cloud integration: v1.0.29
 Version:           20.10.21
 API version:       1.41
 Go version:        go1.18.7
 Git commit:        baeda1f
 Built:             Tue Oct 25 18:08:16 2022
 OS/Arch:           windows/amd64
 Context:           default
 Experimental:      true

docker info

C:\Windows\system32>docker info
Client:
 Context:    default
 Debug Mode: false
 Plugins:
  buildx: Docker Buildx (Docker Inc., v0.9.1)
  compose: Docker Compose (Docker Inc., v2.12.2)
  dev: Docker Dev Environments (Docker Inc., v0.0.3)
  extension: Manages Docker extensions (Docker Inc., v0.2.13)
  sbom: View the packaged-based Software Bill Of Materials (SBOM) for an image (Anchore Inc., 0.6.0)
  scan: Docker Scan (Docker Inc., v0.21.0)

Server:
ERROR: error during connect: In the default daemon configuration on Windows, the docker client must be run with elevated privileges to connect.: Get "http://%2F%2F.%2Fpipe%2Fdocker_engine/v1.24/info": open //./pipe/docker_engine: The system cannot find the file specified.
errors pretty printing info

I tried below solution:

1- Open Powershell as administrator Launch command: & 'C:\Program Files\Docker\Docker\DockerCli.exe' -SwitchDaemon

2- delete config file AppData/Roaming/Docker & start Docker Desktop

3-Net stop com.docker.service And then Net start com.docker.service

C:\Windows\system32>Net start com.docker.service
System error 5 has occurred.
Access is denied.

INFO

C:\Windows\system32>wsl -l -v
  NAME            STATE           VERSION
* Ubuntu-20.04    Running         2

I solved this Problem by open docker file >> properities > security > advanced

(Note: check the owner: your windows account give it full control sometimes windows reset these access privileges (happen with me cause of windows defender).

then click add >> select principal >> advance

and add security (also if not work add service) then apply the changes.

This link check could help you to know how to see the error & other solutions

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM