[英]Write to windows disk from WSL (Windows subsystem for Linux)
I'm in need to share files between Linux (using WSL) and Windows, so that I can edit in Windows and compile in Linux.我需要在 Linux(使用 WSL)和 Windows 之间共享文件,以便我可以在 Windows 中编辑并在 Linux 中编译。 According to recomendations from Microsoft I should then keep my shared files under the drive in /mnt/ (/mnt/c/ in my case).
根据微软的建议,我应该将我的共享文件保存在 /mnt/(在我的情况下为 /mnt/c/)的驱动器下。 Problem I have is that trying to write to that drive in Linux yields a Operation not permitted, I need to do sudo for all writes.
我遇到的问题是,尝试在 Linux 中写入该驱动器会产生不允许的操作,我需要对所有写入执行 sudo。 How can I change this so that I have write possiblitites from my Linux?
我该如何更改它以便我可以从我的 Linux 中编写可能的内容?
thanks谢谢
In WSL /mnt/c
is a mount of the root of drive C ( C:\\
) in Windows.在 WSL 中
/mnt/c
是 Windows 中驱动器 C ( C:\\
) 根目录的安装。 You should not store files in the root of Windows' system drive - this is normally write protected for normal users which I guess is what you experience.您不应该将文件存储在 Windows 系统驱动器的根目录中 - 这通常是对普通用户的写保护,我猜这就是您的体验。
The correct thing to do is moving in deeper to your Windows user folders, fx /mnt/c/Users/YOU/Documents
.正确的做法是深入到您的 Windows 用户文件夹 fx
/mnt/c/Users/YOU/Documents
。 Here you are permitted to write files from WSL.在这里,您可以从 WSL 写入文件。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.