相关疑难解决方法(0)

如何配置 Windows Subsystem for Linux 2 (WSL2) 以使用 fstab 自动挂载 Windows 网络文件共享?

我正在尝试使用在 Windows 10 的 Linux 子系统上运行的 Debian 10 Linux 发行版来挂载 Windows 共享 (SMB/CIFS),并使用 fstab 在启动时自动挂载。我的软件规格是

\n
OS: Windows 10 Pro 21H2\nOS Build: 19044.1526\n    \nWindows Subsystem for Linux 2 (WSL2)\nDistribution: Debian 10.11\n
Run Code Online (Sandbox Code Playgroud)\n

根据 Microsoft 的以下文章,您可以创建一个文本文件来/etc/wsl.conf存储 WSL2 的用户配置设置。

\n

https://docs.microsoft.com/en-us/windows/wsl/wsl-config

\n

我开始使用wsl.conf将mountFsTab键设置为 true。这应该确保 WSL 处理 fstab 文件。我知道该设置应该无关紧要,因为它默认为 true,但我想确保它设置为 true。我的wsl.conf文件当前如下所示:

\n
# Automatically mount Windows drive when the distribution is launched. \n[automount]\n# Automatically mount the fixed drives (C:) under /mnt.\nenabled = false\n# Sets the `/etc/fstab` …
Run Code Online (Sandbox Code Playgroud)

linux mount cifs windows-10 windows-subsystem-for-linux

11
推荐指数
1
解决办法
1万
查看次数