MSL Wiki
MSL on GitHub

msl command reference

Every msl subcommand, what it does, and its options.

Chapter 19 of 205 min read
On this page 5 sections

msl talks to the same background service as the app. Run msl help for this list in your terminal.

Shells and commands#

CommandDoes
msl [instance]An interactive shell. An instance named after a distro (msl fedora) needs no setup.
msl [instance] <command>…Runs one command, like ssh; its exit code is returned.
msl -- <command>…The same, on the default instance.
-u, --user <name>Which Linux user. Every distro also has an unprivileged msl user.
-d, --distro <distro>Which distro, for an instance being used for the first time.

Instances#

CommandDoes
msl list (or ls, instances)Every instance.
msl new <name> [--distro <d>] [--cpus <n>] [--memory <size>] [--disk <size>]Creates an instance, sized, without opening a shell. --memory 2G-8G makes it dynamic.
msl resources [instance]Its CPUs, memory and disk. Also msl config.
msl resources <instance> --cpus 4 --memory 6G --disk 128GChanges them — the same settings as the Resources and Storage cards. --disk-fixed <size> reserves the space up front.
msl forward <instance> <mac port>:<linux port>Opens that port on this Mac, reaching the guest's. Bound to 127.0.0.1 only, so nothing outside this Mac can see it. Reaches a server the guest bound on 0.0.0.0; for one bound on 127.0.0.1 - which Flask, Vite, Rails and manage.py runserver all do by default - add --ssh, which forwards through the guest's own sshd and so connects from inside. Refused while the instance is sandboxed: a forwarded port would be a way out of the box.
msl unforward <mac port>Closes it. Never refused by a policy - it reduces what this Mac exposes.
msl admin certify <lineage|instance> [--label "..."]Signs a statement that this image is yours. The one tier a local user cannot forge: instance identities are signed by a key mslhd can read, a certificate by your MSLAP key — which a fleet keeps on another machine. Copy the file to /Library/Application Support/MSL/lineages/ on each Mac (needs sudo) so a non-administrator cannot add or remove one.
msl admin revoke <lineage|instance> [--reason "..."]Withdraws an image. Every instance of that lineage then refuses to start, and no capability can set it aside — a revocation a policy could override would be no revocation at all.
msl vault <instance> statusWhether its disk is in an encrypted container, and whose key opens it.
msl vault <instance> adoptMoves the container to a passphrase you hold instead of this Mac's own key. After this nothing on the Mac can open it until someone types it, including MSL after a reboot — and there is no recovery if it is lost. This is the rung that resists a determined administrator of this Mac; the default one does not.
msl vault <instance> unlock / lockSupplies that passphrase for this session, or forgets it and closes the container. The key is never written down, so a reboot asks again.
msl protect <instance>Moves the instance's disk into an encrypted container (AES-256), so a copy of the file is useless on any other Mac. The key is derived from the instance's identity and never stored. A real copy of the whole disk, so it takes minutes and needs that much free space while it runs; the original goes only after the copy inside has been read back and checked. What it does not do: anything inside the instance stays readable to anyone who can open a shell in it, and a determined administrator of this Mac can still reach the key.
msl unprotect <instance>Moves it back out as a plain file. Refused where the policy denies instance.clone — an administrator who sealed an image did not mean it unsealed.
msl identity [instance]Where an instance came from: a fresh original, or a copy, and how many copies deep. Every instance is issued a signed lineage when it is created; a clone keeps its parent's lineage and gains a generation, so a copy can be told from an original even if it arrived outside MSL. Reports only — nothing is refused on an identity in this version.
msl rename <instance> <new name>Renames it, carrying its disk, accounts, settings and per-app overrides. Refused while it is running, and while it has hibernated memory or a snapshot: a guest's network address is derived from its name, and macOS will not restore saved state whose address has changed. Its Launchpad entries and Dock pins are removed, since a generated app launches an instance by name.
msl clone <instance> <new name>Makes a second instance from it - the disk is an instant APFS copy, so it costs nothing until the two diverge. The copy keeps the original's SSH host key until the guest makes a new one. Refused while the original is running: copying a mounted filesystem captures it mid-write.
msl remove <instance> [--keep-disk]Removes it and its saved state. Removing a distro's last instance also deletes its disk, unless --keep-disk.
msl status [instance]Its state.
msl suspend [instance]Freezes it in memory.
msl resume [instance]Unfreezes or starts it.
msl hibernate [instance]Saves it to disk and stops it.
msl --hibernate [instance]The same — for every running instance if none is named.
msl --shutdown [instance]Asks Linux to power off, then stops it — every running instance if none is named.

Distros, disks and snapshots#

CommandDoes
msl install <distro> [--manifest <url>]Downloads, verifies and installs a distro: alpine, debian, ubuntu, kali, arch, fedora, rocky, alma, centos, oracle, opensuse or nix.
msl storage [instance] showShows its disk settings.
msl storage [instance] dynamic <size>A disk that takes only what it has written, up to <size>.
msl storage [instance] fixed <size>A disk that reserves <size> up front.
msl snapshot save <instance> <name>Saves a snapshot.
msl snapshot restore <instance> <name>Restores one.
msl snapshot list [instance]Lists them.

Apps#

CommandDoes
msl apps list [instance]Its Linux GUI apps, from the last scan.
msl apps scan [instance]Reads them from the guest again.
msl apps install <instance> <app>Makes a Mac app for it in ~/Applications/MSL.
msl apps install-all [instance]The same, for every app found.
msl apps uninstall <instance> <app>Removes that Mac app.
msl apps pin <instance> <app> / unpinAdds or removes its Dock tile.

Connecting and checking#

CommandDoes
msl ssh [instance] [--print]Connects over SSH, setting it up on first use. --print shows the command instead.
msl doctor [--fix]Checks the installation; --fix deletes only what it listed.
msl power-test <event>Runs MSL's response to sleep, shutdown, logout, switchaway, switchback, lowbattery or wake by hand; battery shows what the battery watcher sees.
msl install-toolsFrom a build: installs MSL's tools and its login item.