我正在尝试使用在 Windows 10 的 Linux 子系统上运行的 Debian 10 Linux 发行版来挂载 Windows 共享 (SMB/CIFS),并使用 fstab 在启动时自动挂载。我的软件规格是
\nOS: Windows 10 Pro 21H2\nOS Build: 19044.1526\n \nWindows Subsystem for Linux 2 (WSL2)\nDistribution: Debian 10.11\nRun Code Online (Sandbox Code Playgroud)\n根据 Microsoft 的以下文章,您可以创建一个文本文件来/etc/wsl.conf存储 WSL2 的用户配置设置。
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)