[英]WSL Not Starting in VS Code - tried updating it, wsl shutdown, and restarting computer
I'm getting this error regarding WSL2 not starting.我收到有关 WSL2 未启动的错误。 I've tried doing
wsl --shutdown
wsl
in PowerShell and restarting my computer but it's still not running.我已经尝试在 PowerShell 中执行
wsl --shutdown
wsl
并重新启动我的计算机,但它仍然没有运行。 The state in PowerShell says it's running, though, I am still getting the error. PowerShell 中的 state 表示它正在运行,但我仍然遇到错误。 If I open Ubuntu in Windows and run
code.
如果我在 Windows 中打开 Ubuntu 并运行
code.
that doesn't work either.那也不管用。 I've updated wsl to the latest version.
我已经将 wsl 更新到最新版本。 Thanks for your help!
谢谢你的帮助!
[2023-01-23 06:26:26.345] Starting VS Code Server inside WSL (wsl2)
[2023-01-23 06:26:26.345] Extension version: 0.72.0
[2023-01-23 06:26:26.345] Windows build: 19044. Multi distro support: available. WSL path support: enabled
[2023-01-23 06:26:26.346] No shell environment set or found for current distro.
[2023-01-23 06:26:26.507] WSL daemon log file:
[2023-01-23 06:26:26.510] Probing if server is already installed: C:\WINDOWS\System32\wsl.exe -d Ubuntu -e sh -c "[ -d ~/.vscode-server/bin/97dec172d3256f8ca4bfb2143f3f76b503ca0534 ] && printf found || ([ -f /etc/alpine-release ] && printf alpine-; uname -m)"
[2023-01-23 06:26:29.965] Probing result: found
[2023-01-23 06:26:29.966] Server install found in WSL
[2023-01-23 06:26:29.967] Launching C:\WINDOWS\System32\wsl.exe -d Ubuntu sh -c '"$VSCODE_WSL_EXT_LOCATION/scripts/wslServer.sh" 97dec172d3256f8ca4bfb2143f3f76b503ca0534 stable code-server .vscode-server --host=127.0.0.1 --port=0 --connection-token=1837640582-1523319798-660006518-1171681990 --use-host-proxy --without-browser-env-var --disable-websocket-compression --accept-server-license-terms --telemetry-level=all'
[2023-01-23 06:26:30.216] Setting up server environment: Looking for /home/samtimus/.vscode-server/server-env-setup. Not found.
[2023-01-23 06:26:30.216] WSL version: 5.15.79.1-microsoft-standard-WSL2 Ubuntu
[2023-01-23 06:26:30.216] WSL-shell-PID: 13
[2023-01-23 06:26:30.216] Node executable: /home/samtimus/.vscode-server/bin/97dec172d3256f8ca4bfb2143f3f76b503ca0534/node
[2023-01-23 06:26:30.216] Starting server: /home/samtimus/.vscode-server/bin/97dec172d3256f8ca4bfb2143f3f76b503ca0534/bin/code-server --host=127.0.0.1 --port=0 --connection-token=1837640582-1523319798-660006518-1171681990 --use-host-proxy --without-browser-env-var --disable-websocket-compression --accept-server-license-terms --telemetry-level=all
[2023-01-23 06:26:30.217] VS Code Server for WSL closed unexpectedly.
[2023-01-23 06:26:30.217] For help with startup problems, go to https://code.visualstudio.com/docs/remote/troubleshooting#_wsl-tips
[2023-01-23 06:26:30.222] C:\WINDOWS\System32\wsl.exe -d Ubuntu -e kill 13
[2023-01-23 06:26:30.546] WSL Daemon exited with code 0
PS C:\Users\User> wsl -l -v
NAME STATE VERSION
* Ubuntu Running 2
PS C:\Users\User> wsl --update
Checking for updates.
The most recent version of Windows Subsystem for Linux is already installed.
When you installed your sub-system (UBUNTU) the system created a shortcut to having direct access to the shell.当您安装子系统 (UBUNTU) 时,系统会创建一个快捷方式以直接访问 shell。
If you don't, open your PowerShell and exec BASH. If still don't, open your VSCODE on windows.如果你不这样做,打开你的 PowerShell 并执行 BASH。如果仍然不这样做,请在 windows 上打开你的 VSCODE。
Install the extension WSL EXTENSION .安装扩展WSL EXTENSION 。
Open a WSL terminal window (using the start menu item or by typing wsl from a command prompt / PowerShell.打开 WSL 终端 window(使用开始菜单项或从命令提示符键入 wsl / PowerShell。
Another way is.另一种方式是。 Open your VSCODE on windows, press F1 and select WSL: New WSL Window.
在 windows 上打开你的 VSCODE,按 F1 和 select WSL:新 WSL Window。
I was able to figure it out with the following steps!我能够通过以下步骤弄清楚!
Within the WSL terminal, type rm -r ~/.vscode-server to delete the VS Code WSL server.在 WSL 终端中,键入 rm -r ~/.vscode-server 以删除 VS Code WSL 服务器。 Exit the terminal and from your PowerShell/Cmd, run wsl --shutdown.
退出终端并从您的 PowerShell/Cmd 运行 wsl --shutdown。 Then you can log in back to your WSL and run code.
然后您可以重新登录到您的 WSL 并运行代码。 and it should work normally.
它应该可以正常工作。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.