NixOS / nixpkgs

Nix Packages collection & NixOS
MIT License
18.04k stars 14.04k forks source link

NixOS VMs: feature request: allow configuring the owner and group of the 9P shares #95837

Open 8573 opened 4 years ago

8573 commented 4 years ago

In a NixOS virtual machine (the sort started with run-<hostname>-vm), there are two directories, /tmp/shared and /tmp/xchg, intended for exchanging data with the host via 9P. The latter directory corresponds on the host to a temporary directory owned by the user running the VM, and the former directory, by default, corresponds to the same. In the guest, however, these directories are owned by root:root. By default, the temporary directory on the host that corresponds to these is created with the host user's default umask, and the 9P-shared directories in the guest inherit its file mode, so, for me with umask 077, the directories are accessible only to root.

Currently, the only way for the host to make the 9P shares accessible to non-root users in the guest would seem to be making the corresponding directory on the host world-accessible, as there doesn't seem to be a means to control (from the VM's NixOS configuration or otherwise from the host) who owns the 9P shares in the guest. I would like to suggest that such a means could be useful.

(Searching for previous issues matching "vm 9p root" didn't seem to show any existing tickets for this; my own #21490 seemed the least irrelevant.)

stale[bot] commented 3 years ago

I marked this as stale due to inactivity. → More info