为什么 Windows 文件系统使用 noexec 和 nodev 选项挂载在 WSL 上?

问题描述 投票:0回答:0

我问这个问题是因为我很好奇,我想更好地了解WSL

我的环境是Windows 11,使用WSL 2运行Ubuntu。我正在学习容器基础知识,在运行 debootstrap 时遇到了一个有趣的错误。

当我在安装的 Windows 文件系统中运行它时 (

/mnt/c/
):

user@laptop:/mnt/c/Users/user/workshop$ sudo debootstrap --arch amd64 jammy container_fs http://archive.ubuntu.com/ubuntu

我收到以下错误:

mknod: /mnt/c/Users/user/workshop/container_fs/test-dev-null: Operation not supported
E: Cannot install into target '/mnt/c/Users/user/workshop/container_fs' mounted with noexec or nodev

我试图用

/mnt/c/Users/user/workshop/container_fs
exec
选项重新安装
dev

user@laptop:/mnt/c/Users/user/workshop$ sudo mount -o remount,exec,dev /mnt/c/Users/user/workshop/container_fs

输出:

mount: /mnt/c/Users/user/workshop/container_fs: mount point not mounted or bad option.

正是在这一点上,我尝试在

/home/user/
上运行 debootstrap,它没有任何问题。

ubuntu windows-subsystem-for-linux mount
© www.soinside.com 2019 - 2024. All rights reserved.