目录

电脑没电关机,wsl和docker又挂了,附解决过程

目录

电脑没电关机,wsl和docker又挂了,附解决过程

如题,开了个会没带笔记本电源,点啊弄关机后docker打不开,我以为是docker坏了,结果docker报错:

An unexpected error occurred while executing a WSL command. Either shut down WSL down with wsl –shutdown, and/or reboot your machine. You can also try reinstalling WSL and/or Docker Desktop. If the issue persists,

deploying WSL2 distributions provisioning docker WSL distros: getting WSL distro list: running WSL command wsl.exe C:\windows\System32\wsl.exe -l -v –all: context deadline exceeded checking if isocache exists: CreateFile \wsl$\docker-desktop-data\isocache: The semaphore timeout period has expired.

反正意思就是WSL出问题,我才发现是Ubuntu打不开了,不是程序界面打不开,是能打开界面进不去系统,一片空白:

https://i-blog.csdnimg.cn/blog_migrate/174616f7bdbc10b08be0748b396b67ba.png

打不开就算了,还没有任何报错,不知道到底哪里有问题了,那我就考虑重装吧,然后一整体就下面这样。

https://i-blog.csdnimg.cn/blog_migrate/44c94668c405b95303b2205ddae5394e.png https://i-blog.csdnimg.cn/blog_migrate/f098c2a876d40f06ca83998f357c8cf0.png

无奈我只能多次重启,然后卸载wsl再重装:

wsl –unregister Ubuntu

wsl –install

新的wsl是装好了,但一看docker desktop有报错

deploying WSL2 distributions
provisioning docker WSL distros: terminating WSL distro "docker-desktop": exit code: 4294967295: running WSL command wsl.exe C:\windows\System32\wsl.exe --terminate docker-desktop: 不存在具有所提供名称的分发。
Error code: Wsl/Service/WSL_E_DISTRO_NOT_FOUND
: exit status 0xffffffff

但我看了C:\windows\System32\wsl.exe不仅存在而且能打开啊,又开始怀疑老的wsl没卸载完全:

https://i-blog.csdnimg.cn/blog_migrate/17d2e96cab5751d4765208acdb85061d.png

算了先将就看着用用行不

wsl –set-default-version 2

wsl –set-default-version Ubuntu

wsl –shutdown

结果还是不不行,又按照下面的帖子改:

[windows - Ubuntu WSL with docker could not be found - Stack Overflow

https://i-blog.csdnimg.cn/blog_migrate/003a2ce7eb50c2e24a8c624c260c5930.png “windows - Ubuntu WSL with docker could not be found - Stack Overflow”)

还是报错

ensuring desktop context: creating "desktop-linux" context: rename C:\Users\cong.madocker\contexts\meta\fe9c6bd7a66301f49ca9b6a70b217107cd1284598bfc254700c989b916da791etmp-meta.json1694104157 C:\Users\cong.madocker\contexts\meta\fe9c6bd7a66301f49ca9b6a70b217107cd1284598bfc254700c989b916da791e\meta.json: Access is denied.

算了,搞不定,先把docker desktop先卸载了吧,我的历史镜像中的数据应该还在吧。一路默认安装好了,先来个docker run hello-world

https://i-blog.csdnimg.cn/blog_migrate/8b60c16b00b3419e2fe43c34628acfbd.png

居然好了,谢天谢地,连续两天折腾几小时终于好了。

https://i-blog.csdnimg.cn/blog_migrate/14c5bd7caa6dfdb5f47e1a3e025cc232.png

不过原来拉取的本地镜像没了,不过也没什么重要的数据,重新拉取配置一下吧,至少没有重装系统。

回顾一下,因为电脑没电关机(猜测的原因),居然惹出这么多事情,最后也没搞明白出了什么问题。