Skip to content

Commit

Permalink
python: cbl_vmm: Add '--translate-uid' to virtiofsd if in systemd-nspawn
Browse files Browse the repository at this point in the history
Signed-off-by: Nathan Chancellor <nathan@kernel.org>
  • Loading branch information
nathanchance committed Dec 27, 2024
1 parent 0053622 commit b9bea1a
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions python/scripts/cbl_vmm.py
Original file line number Diff line number Diff line change
Expand Up @@ -285,6 +285,10 @@ def run(self):
'--socket-group', group_name,
'--socket-path', vfsd_sock,
] # yapf: disable
if lib.utils.in_nspawn():
# In systemd-nspawn, our host UID is different from the guest
# UID, so we need to map it to avoid permission errors.
virtiofsd_args += ['--translate-uid', f"map:1000:{os.getuid()}:1"]

# Python recommends full paths with subprocess.Popen() calls
virtiofsd_cmd = [*base_virtiofsd_cmd, *virtiofsd_args]
Expand Down

0 comments on commit b9bea1a

Please sign in to comment.