Quantcast
Channel: Active questions tagged windows-subsystem-for-linux - Ask Ubuntu
Viewing all articles
Browse latest Browse all 2810

Preserving file permissions between Ubuntu and WSL

$
0
0

As part of my workflow, I have a dual-boot system with Ubuntu 16.04 for development and Windows 10 for other work. I use WSL 1 for smaller linux tasks when I don't want to reboot into Ubuntu. As part of this, I use Zim for taking notes and I wish these to be accessible and editable from both native Ubuntu and WSL.

I have stored these notes in WSL's home directory which is accessible to Ubuntu through my mounted Windows system drive under Users\<user>\AppData\Local\Packages\CanonicalGroupLimited.Ubuntu16.04onWindows_79rhkp1fndgsc/LocalState/rootfs/. It is not advised to access these files in Windows because it erases their permissions, but I assumed accessing them from another Ubuntu instance should be OK. This works fine and my files are accessible from both OSes. But I am having an issue with file permissons. If it's relevant, I access this location through a symlink in my home directory on Ubuntu.

When I edit or add files from WSL, permissions work correctly and I am able to see and access them in native Ubuntu. But when I create or edit files in native Ubuntu, their permissions seem to be erased on WSL (ie. I have no permissions). I can then chmod these files in WSL, but it's frustrating to have to do this every time.

I have made sure users on both Ubuntu and WSL have the same name and password, as well as the same uid and gid (1000). I have noticed that the users are members of different groups. For example, my native Ubuntu user is a member of a group related to Docker, but I don't have this installed on WSL.

Are there any other system settings I need to ensure are the same between OSes to preserve file permissons?

Edit: I've eliminated it being as Zim-specific issue. Even creating a new file in Ubuntu using touch will result in it having no permissions back on WSL.


Viewing all articles
Browse latest Browse all 2810

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>