Drive Mappings

The session.driveMappings array mounts Windows drives inside the user session — an SMB share, a host path, or a WebStream virtual share. Mounts are scoped to the session and removed at logoff.

Editor Drive Mappings accordion  ·  JSON session.driveMappings[]
The drive-mappings table: one row per mapping with letter, type, target, credentials and mount options.

Core fields (schema)

Each array entry is an object. The first five fields are required.

PropertyTypeDefaultRules / notes
enabled *booleantrueWhether this mapping is active.
name *stringMin length 1. Shown in the client UI.
driveLetter *stringSingle letter, pattern ^[D-Zd-z]$ (A/B/C reserved by Windows). Letters must be unique across mappings.
type *enumsmb: UNC share; localpath: host path via SMB loopback; virtualshare: a WebStream virtual share via SMB loopback.
target *stringMin length 1. smb: \\server\share; localpath: D:\path; virtualshare: a share name from security.fileSystem.virtualShares. Supports macros (below).

Credentials

PropertyTypeDefaultRules / notes
usernamestringOptional SMB credentials, e.g. DOMAIN\user. Omit for integrated auth.
passwordRefstringSecret reference. Pattern ^(dpapi:|env:).+ — either dpapi:<base64> (machine-scope DPAPI) or env:<VARNAME>. Plaintext is rejected.

Mount behaviour

PropertyTypeDefaultMin / maxNotes
reconnectbooleanfalseAuto-remount on network-change events (laptop sleep, host network blip).
readOnlybooleanfalseMount read-only (enforced via share permissions and NTFS ACL where possible).
quotaMBintegermin 0Optional disk quota (best-effort; requires FSRM on the host).
persistOnDisconnectbooleantrueKeep the mapping on disconnect (true) or drop it (false). Always removed on logoff.
mountTimeoutMsinteger150001000 – 60000Per-mapping mount timeout, in milliseconds.
mountModeenumeagereager: mount at session start. lazy: reserve the letter, mount on first access. blocking (runtime): session start waits for the mount.
failFastReachbooleantrueRun a 500 ms TCP/445 reachability probe before mounting to fail fast on unreachable targets.

In the editor the Required checkbox maps to mountMode: checked = blocking, unchecked = eager. The fields quotaMB, persistOnDisconnect, mountTimeoutMs, failFastReach and the lazy mount mode are set only through the Advanced Session JSON.

Runtime extensions

These fields are supported by the runtime and the editor but are not part of the published JSON schema.

PropertyTypeDefaultNotes
autoCreateTargetbooleanfalseCreate the target directory if missing. Disabled for virtualshare.
volumeLabelstringOverride the mounted volume label. Max 32 characters.
volumeSerialHexstringOverride the volume serial. 8 hex digits.
envVarsobjectString→string map of environment variables (macro values supported) injected for the mapping.

Target macros

The target (and envVars values) support substitution at session start:

$USERNAME   $SESSIONID   $TENANT   $DOMAIN   $DATE   ${NAME}

Sample

"driveMappings": [
  {
    "enabled": true,
    "name": "Team Share",
    "driveLetter": "P",
    "type": "smb",
    "target": "\\\\files.example.com\\teams\\$USERNAME",
    "username": "EXAMPLE\\svc_webstream",
    "passwordRef": "dpapi:AQAAAN...",
    "reconnect": true,
    "readOnly": false,
    "mountMode": "eager",
    "failFastReach": true
  }
]
Note

Drive mappings are policy-only — there is no app.config.xml equivalent. Secrets must be DPAPI- or environment-referenced; plaintext passwords are rejected at parse time.