Mic92 / nixos-shell

Spawns lightweight nixos vms in a shell
MIT License
677 stars 39 forks source link

Odd file permissions? #63

Closed chrissound closed 1 year ago

chrissound commented 1 year ago

Apologies I don't really expect the maintainers of the software to respond to this, just more for my own reference and if I or anyone else finds an answer.


When I create a file in a mounted directory, the permissions seem a bit odd. It seems to be created with the userid of the parent host system.

Which means if I try to edit files with nvim it starts complaining about not being able to write a backup file.

From within the guest:

touch example
touch: setting times of 'example': Permission denied

How could I shared a mounted directory while also allowing any necessary permission to write/create files?

Mic92 commented 1 year ago

qemu can only write files as the user it was started, which is what's happening if you share files with 9p. If you wanted to share files with arbitrary permissions you would need something like NFS, where you directly talk to the host kernel. Not quite sure about touch, but maybe it tries to use some systemcall that is not implemented by this filesystem?