Category Archive Linux

Byphunsanit

WSL: source WSL cannot be found

ถ้าเจอ File Explorer, Windows Explorer เปิด WSL folder ไม่ได้ อาจจะเห็นแต่คลิกอะไรไม่ได้ ใน Even Viewer มี error ประมาณ WSL cannot be found

The description for Event ID 0 from source WSL cannot be found. Either the component that raises this event is not installed on your local computer or the installation is corrupted. You can install or repair the component on the local computer.

If the event originated on another computer, the display information had to be saved with the event.

The following information was included with the event:

Failed to create network endpoint with address: ‘172.24.251.76’, assigned new address: ‘172.24.253.88’

The message resource is present but the message was not found in the message table

  1. เปิดโปรแกรม regedit โดยไปที่เมนูของ windows พิมพ์ regedit.exe ในช่อง run หรือ search แล้ว enter
  2. ไปที่ Computer\HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Lxss\ จะเห็น GUID ( ตัวอักษรสุ่มไม่ซ้ำกัน ) เป็นชื่อโฟลเดอร์อยู่ด้านล่าง
  3. ไล่ดูข้างในว่ามีค่า DistributionName ตรงกับที่เราต้องการ แล้วดู BasePath ว่า path ถูกต้องมั๋ย เช่น
    \?\C:\UsersWSL\DockerDesktopWSL\data
  4. เช็คว่าตาม path เช่น
    C:\UsersWSL\DockerDesktopWSL\data\ext4.vhdx
    แล้วแก้ permissions ให้ user ที่ต้องการสามารถอ่าน เขียนได้
  5. ทำซ้ำขั้นตอนที่ 4 จนกว่าจะครบทุก users

ตัวอย่าง windows registry Computer\HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Lxss\

Windows Registry Editor Version 5.00

[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Lxss]
"DefaultVersion"=dword:00000002
"NatIpAddress"="172.24.251.76"
"DefaultDistribution"="{c84d999d-44e7-49da-8b2d-d79518e3761f}"

[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Lxss\{571f934e-d964-47b1-ba79-6031bd230fab}]
"State"=dword:00000001
"DistributionName"="docker-desktop-data"
"Version"=dword:00000002
"BasePath"="\\\\?\\C:\\UsersWSL\\DockerDesktopWSL\\data"
"Flags"=dword:0000000f
"DefaultUid"=dword:00000000

[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Lxss\{c84d999d-44e7-49da-8b2d-d79518e3761f}]
"State"=dword:00000001
"DistributionName"="Ubuntu"
"Version"=dword:00000002
"BasePath"="\\\\?\\C:\\UsersWSL\\Ubuntu"
"Flags"=dword:0000000f
"DefaultUid"=dword:00000000

[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Lxss\{e145ead0-095c-4a18-aec7-fe599f516eb6}]
"State"=dword:00000001
"DistributionName"="docker-desktop"
"Version"=dword:00000002
"BasePath"="\\\\?\\C:\\UsersWSL\\DockerDesktopWSL\\main"
"Flags"=dword:0000000f
"DefaultUid"=dword:00000000

อ่านเพิ่มเติม