机器定义是可直读的 JSON 文件,每项设置都有点分键。
1vm config dev # the whole definition
1vm get dev # list every available key
1vm get dev network.mode # read one
1vm set dev network.mode nat
设置在写入时验证,而非启动时——无效值会立即失败并给出原因,而不是凌晨 3 点
启动时才报错。引擎支持在运行中修改的设置会即时生效,否则下次启动生效。
运行中的机器默认拒绝硬件变更,除非设置明确说明支持。
Machine
| Key | Notes |
|---|
cpuCount | Virtual CPUs |
memory | e.g. 8GiB |
diskSize | A ceiling; the disk is sparse |
macAddress | The guest's MAC |
clipboardSharing | Both directions. Linux needs spice-vdagent; macOS guests cannot |
rosetta | x86 translation in a Linux guest, Virtualization.framework only |
Network
| Key | Notes |
|---|
network.mode | nat, host-only, or bridged:en0 |
portForwards.add | e.g. tcp:2222:22 |
portForwards.remove | Same form |
Shared folders
| Key | Notes |
|---|
sharedFolders.add | tag=projects path=~/Projects |
sharedFolders.remove | By tag |
Graphics
| Key | Notes |
|---|
graphics.resolution | Guest display size |
graphics.displays | Number of heads |
graphics.hiDPI | Retina scaling |
graphics.acceleration | Where the engine and guest support it |
Input
| Key | Notes |
|---|
input.commandKey | What ⌘ sends to the guest |
input.optionKey | What ⌥ sends |
input.translateMacShortcuts | Map Mac shortcuts to guest equivalents |
input.translateOptionArrows | Word-wise cursor movement |
input.captureSystemShortcuts | Let the guest take system shortcuts |
input.matchHostKeyboardLayout | Follow the Mac's layout |
input.keyboardProfile | Keyboard model presented to the guest |
input.mouse | Pointer device type |
input.releaseChord | The keys that release keyboard capture |
SSH
| Key | Notes |
|---|
ssh.access | Enable or disable Mac-to-guest SSH |
ssh.disable | Turn it off |
ssh.users | Which guest users are reachable |
ssh.hostPort | Host-side port |
ssh.alias | Name used in ~/.ssh/config |
ssh.identity / ssh.identityFile | Key selection |
ssh.passwordAuthentication | Allow password auth |
关于不可用设置
Mac 或所选引擎不支持的选项会保持可见并禁用,同时给出原因,而不是
消失。消失的选项教不会你任何东西;会自我说明的选项告诉你换引擎或换
Mac 是否会改变结果。