Skip to main content

ENV_FILE_MOUNTS

Constant ENV_FILE_MOUNTS 

Source
pub const ENV_FILE_MOUNTS: &str = "MSB_FILE_MOUNTS";
Expand description

Environment variable carrying virtiofs file volume mount specs for guest init.

Used when the host path is a single file rather than a directory. The SDK wraps each file in an isolated staging directory (hard-linked to preserve the same inode) and shares that directory via virtiofs. Agentd mounts the share at FILE_MOUNTS_DIR/<tag>/ and bind-mounts the file to the guest path.

Format: tag:filename:guest_path[:opts][;tag:filename:guest_path[:opts];...]

  • tag — virtiofs tag name (required, matches the tag used in --mount)
  • filename — name of the file inside the virtiofs share (required)
  • guest_path — final file path inside the guest (required)
  • ro / rw — access mode option (optional)
  • noexec — disable direct execution from the mount (optional)
  • nosuid — mount with nosuid flag (optional)
  • nodev — mount with nodev flag (optional)

Entries are separated by ;.

Examples:

  • MSB_FILE_MOUNTS=fm_config:app.conf:/etc/app.conf
  • MSB_FILE_MOUNTS=fm_config:app.conf:/etc/app.conf:ro,noexec
  • MSB_FILE_MOUNTS=fm_a:a.sh:/usr/bin/a.sh;fm_b:b.sh:/usr/bin/b.sh