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.)
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.)