标签: windows-subsystem-for-linux

WSL 停止工作并出现错误:0x80070003

WSL2 停止工作。当我重新安装 Linux 发行版时,单击启动按钮时会抛出以下错误:

Installing, this may take a few minutes...
WslRegisterDistribution failed with error: 0x80070003
Error: 0x80070003 The system cannot find the path specified.

Press any key to continue...
Run Code Online (Sandbox Code Playgroud)

wsl --help命令工作正常,但是wsl -l命令和其他 wsl 命令会抛出以下错误

The system cannot find the path specified.
Run Code Online (Sandbox Code Playgroud)

windows-subsystem-for-linux wsl-2

2
推荐指数
1
解决办法
6129
查看次数

从 Ubuntu WSL2 运行 VSCode 不起作用

我正在尝试在 Ubuntu WSL2 中运行 VSCode。

\n

当我运行时code .,zsh 无法找到 VSCode。\n我已经安装了Remote - WSL插件,并且我能够从 Windows 打开我的 Ubuntu 实例。我也想从 Ubuntu 终端实现它。

\n
ayman@DESKTOP \xee\x82\xb0 ~ \xee\x82\xb0 code .\nzsh: command not found: code\n
Run Code Online (Sandbox Code Playgroud)\n

我努力了wsl --shutdown然后重新安装 Remote-WSL 插件,但仍然不起作用。

\n

zsh从终端运行 VSCode是否需要配置?如果可以,需要什么配置?

\n

zsh visual-studio-code windows-subsystem-for-linux wsl-2

2
推荐指数
1
解决办法
1625
查看次数

在 WSL2 上运行的 Jupyter 实验室网络错误

我在 WSL2 Ubuntu 上运行 Jupyter Lab,并在 Win10 PC 上的 Firefox 中访问它。它们在同一台机器上运行,因此不应该涉及“网络”。我将其运行为jupyter lab --no-browser. 服务器在终端中启动得很好:

[I 11:17:40.843 LabApp] [jupyter_nbextensions_configurator] enabled 0.4.1
[I 11:17:40.885 LabApp] JupyterLab extension loaded from /home/muthur/anaconda3/lib/python3.8/site-packages/jupyterlab  
[I 11:17:40.886 LabApp] JupyterLab application directory is /home/muthur/anaconda3/share/jupyter/lab                    
[I 11:17:40.888 LabApp] Serving notebooks from local directory: /home/muthur                                            
[I 11:17:40.888 LabApp] Jupyter Notebook 6.2.0 is running at:                                                           
[I 11:17:40.888 LabApp] http://localhost:8888/?token=...                                                                
[I 11:17:40.888 LabApp]  or http://127.0.0.1:8888/?token=...                                                            
[I 11:17:40.888 LabApp] Use Control-C to stop this server and shut down all kernels (twice …
Run Code Online (Sandbox Code Playgroud)

jupyter-notebook windows-subsystem-for-linux wsl-2

2
推荐指数
1
解决办法
2572
查看次数

从 WSL 上运行的 django 连接到 Windows 上运行的 Postgres

我主要在 Windows 上进行开发,但我正在使用 WSL 测试我的应用程序,因为我会将其推送到 Linux 服务器。我当前的问题是将在 WSL 上运行的 django 应用程序连接到在 Windows 上运行的 postgres。许多文章解释了如何连接到在 WSL 上运行的 postgres,但反之则不然。

django postgresql windows-subsystem-for-linux wsl-2

2
推荐指数
1
解决办法
1861
查看次数

docker-compose up 失败,出现以下错误无法解决:rpc 错误:代码 = 未知 desc = 无法使用前端 dockerfile.v0 解决:

下面的详细错误:- 未能解决:rpc 错误:代码 = 未知 desc = 无法使用前端 dockerfile.v0 解决:无法创建 LLB 定义:无法执行请求:Head https://registry-1.docker.io/屏蔽网址:意外的 EOF

环境:- Docker 版本 20.10.7,构建 f0df350 O

操作系统:- 操作系统名称 Microsoft Windows 10 Pro 版本 10.0.19042 Build 19042

docker docker-compose windows-subsystem-for-linux

2
推荐指数
1
解决办法
4076
查看次数

WSL 2 上的 Python3 需要很长时间(超过 6 分钟)才能导入密钥环

当我尝试pip在我的机器上运行命令时,我注意到这个问题WSL2 Ubuntu-20.04,运行任何东西都需要很长时间。我最终将范围缩小到pip导入keyring模块的时间。

Python 3.8.5 (default, May 27 2021, 13:30:53)
[GCC 9.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import time
>>> def import_keyring():
...     time_start = time.time()
...     import keyring
...     print(f"Keyring took {time.time() - time_start} seconds to load")
...
>>> import_keyring()
Keyring took 400.4930064678192 seconds to load
Run Code Online (Sandbox Code Playgroud)

查看进程资源管理器,似乎有一个子进程正在等待:

 dbus-launch --autolaunch <32 character hex string> --binary-syntax --close-stderr
Run Code Online (Sandbox Code Playgroud)

dbus-launch 命令本身似乎没有任何子进程,所以我常常strace查看它挂在哪里:

connect(3, {sa_family=AF_INET, sin_port=htons(6000), sin_addr=inet_addr("<my main machine's …
Run Code Online (Sandbox Code Playgroud)

python dbus pip python-keyring windows-subsystem-for-linux

2
推荐指数
1
解决办法
1060
查看次数

在wsl模式和cmd模式下运行docker命令有什么区别吗?

我在 Windows 11 和 Docker Desktop 中安装wsl并运行wsl2(使用 Ubuntu)来使用 docker。

我很好奇运行是否有什么区别,docker command例如docker build在 cmd 或 wsl 模式下运行?

wsl 模式意味着:我wsl在 cmd 中运行任何内容之前输入。

希望我的问题很清楚。

docker windows-subsystem-for-linux

2
推荐指数
1
解决办法
821
查看次数

kubectl:在 WSL 终端中找不到

我按照以下说明在 Windows10 上安装了 WSL2:https://learn.microsoft.com/en-us/windows/wsl/install-win10,手动安装。

所有命令都对我有用,但是最后当我打开 wsl 终端并输入kubectl我有响应时-sh: kubectl: not found

我安装了 Ubuntu 20.04 LTS,当我打开 Ubuntu 终端时,kubectl 就会在那里工作。

Powershell 表示安装正确:

PS C:\Users\michu> wsl --list --verbose
  NAME                   STATE           VERSION
 *docker-desktop         Running         2
  docker-desktop-data    Running         2
  Ubuntu-20.04           Running         2
Run Code Online (Sandbox Code Playgroud)

如何使 docker/kubectl 也能在 WSL 终端中运行?
完成所有说明步骤后它不应该立即工作吗?

docker kubernetes windows-10 windows-subsystem-for-linux

2
推荐指数
1
解决办法
2345
查看次数

WSL:功能未实现

我知道 wsl 使用翻译从 Windows 内核执行的每个命令,但我的问题仍然是:
WSL 是否支持系统调用(例如消息队列),如果支持,如何支持?

每当使用任何消息队列函数时,我都会收到“函数未实现”错误。还有希望吗?

[编辑:]

int main(int argc,char* argv[]){ 
    key_t key=MSG_KEY;
    mqid=msgget(key,0660 | IPC_CREAT );
    if(mqid==-1){
        perror("msgget error:");
        printf(" %s",strerror(errno));
    }
    int lenght=0,n=0;
    lenght=msgrcv(mqid,&req,MAX,1,0);
    if(lenght==-1){      
        if (errno == ENOMSG)
        {
            printf("\nNo message in the queue\n");
        }
        else
        {
            printf("\nError receiving message: %s\n", strerror(errno));
        }
    }
    else
    {
        printf("Received a message\n");
    }
    printf("\nreceived %d number of bytes\n",n);
    msgctl(mqid,IPC_RMID,NULL); 

    return 0;
}
Run Code Online (Sandbox Code Playgroud)

c system windows-subsystem-for-linux

2
推荐指数
1
解决办法
1590
查看次数

Makefile 中的 @echo 总是会导致错误“*** 缺少分隔符。停止。”

我放

@echo "============= $(TOOLPREFIX) ================="
Run Code Online (Sandbox Code Playgroud)

在许多操作系统课程使用的xv6 Makefile的第34行中,希望打印出变量TOOLPREFIX的值。但我总是出错

Makefile:37: *** missing separator.  Stop.
Run Code Online (Sandbox Code Playgroud)

该行位于任何目标之前。我尝试了所有能做的事情,比如在命令开头添加 Tab、将命令移动到 Makefile 中的任何位置,或者删除 echo 之前的符号 @,但无论如何我总是收到错误。但如果我注释掉这个命令,就没有错误了。那么,我应该如何正确打印出这个Makefile中的变量呢?

顺便说一句,如果我在命令开头添加 Tab,我得到的错误是“Makefile:37: *** 配方在第一个目标之前开始。停止。” 但如果我将 @echo 命令移至 Makefile 的底部,则会显示“Makefile:287: *** 缺少分隔符。停止。” 又出来了。

环境是Windows Subsystem for Linux,安装了ubuntu 20.04。

makefile gnu-make echo xv6 windows-subsystem-for-linux

2
推荐指数
1
解决办法
4374
查看次数