vsc连接wsl安装vsc时遇到权限问题的解决方案
- 手机
- 2025-08-17 01:51:01

当点击左下角的连接
遇到下面的权限提示时
mkdir: cannot create directory ‘/home/xxx(用户名)/.vscode-server’: Permission denied
可以新建文件 /etc/wsl.conf,并拷贝如下内容
# Automatically mount Windows drive when the distribution is launched [automount] # Set to true will automount fixed drives (C:/ or D:/) with DrvFs under the root directory set above. Set to false means drives won't be mounted automatically, but need to be mounted manually or with fstab. enabled = true # DrvFs-specific options can be specified. options = "metadata,umask=22,fmask=11" # Sets the `/etc/fstab` file to be processed when a WSL distribution is launched. mountFsTab = true参考文章:
wsl2使用vscode无法写入文件permission denied解决方法_阿正的梦工坊的博客-CSDN博客
stackoverflow /questions/61973385/vscode-unable-to-save-files-inside-my-wsl2-home-folder
docs.microsoft /en-us/windows/wsl/file-permissions
vsc连接wsl安装vsc时遇到权限问题的解决方案由讯客互联手机栏目发布,感谢您对讯客互联的认可,以及对我们原创作品以及文章的青睐,非常欢迎各位朋友分享到个人网站或者朋友圈,但转载请说明文章出处“vsc连接wsl安装vsc时遇到权限问题的解决方案”