scrotwmos

how to

The examples use the world from hello world: alice and aliceb, a session dev, and rescue alicer. Every option is in swmtool(8); swmtool help lists the commands, one line each.

Where the commands run

dom0 has no shell. The swmtool commands run as root in one of two places:

rescue
boot the rescue world's username, alicer, and open a terminal with MOD+Shift+Return. It has every disk and the repair tools, and no network.
the stick
boot it, answer the Install and Network questions so the network comes up, then press Ctrl-Alt-F4 for a root shell. Ctrl-Alt-F1 goes back to the wizard. Anything that fetches packages runs here.

Each command asks for the username and password of the world it changes. A change takes effect at the world's next boot.

Get an old file back

In the session the file lived in: MOD+F11, select the hour, press m. The point is mounted read-only. In a terminal:

ls /points/
cp -p /points/20261028T13Z/notes.txt ~/

u unmounts it. b browses a point's files in the tab instead. The hour is UTC.

Roll your home back

The whole home, to the point of three hours ago. In rescue:

swmtool points alice
swmtool points --back 3 alice

Nothing is lost: the home as it was becomes the newest point, so swmtool points --back 1 alice undoes it. --session dev does the same for that session.

Set up a backup place

A USB disk, from the desktop: let it in on F7 (below), then MOD+F11, p, select the disk, Enter, your password. The disk needs ext4, XFS, or btrfs. F11 sets the place of the session in focus.

The same from rescue, in a directory backups on the disk, after F7 let it in:

swmtool place init alice /dev/sdb backups

It shows the recovery phrase when it is done. Set up an NFS export or an SMB share the same way; swmtool(8) has the details under place init. F6 shows when each image was last copied.

Read a file from a backup

On any box with the stick or rescue, the place's disk plugged in:

swmtool place list /dev/sdb backups alice
swmtool place open 20261025T09Z /dev/sdb backups alice
cp -p /mnt/alice/place/notes.txt /root/
swmtool close alice

A place made from F11 is at the disk's root: use / for backups.

Add a package

From the stick's shell, into the world's default session, then into the dev VM:

swmtool add alice htop mpv
swmtool add --session dev alice chromium

Add a session

From the stick's shell:

swmtool session

It asks for the world's username and password, lists the sessions, and asks Session to change, or add. Type add, then answer as in the install: name, isolation, workspaces, network, packages. The same command changes a session's network or process limit, and removes an extra session.

Add or remove a world

From the stick's shell:

swmtool world

It asks for a world already on the box, then World: add one, or remove one. To add, it asks the install's world questions and the new passwords. To remove, it asks for that world's credentials. You cannot remove the world you opened it with.

Join Wi-Fi

MOD+F5, select the network, Enter, type the passphrase, Enter. Other network, the last row, joins a hidden one by its name. u changes the uplink mode: wired first, Wi-Fi first, wired only, Wi-Fi only, or both. The world keeps its saved networks.

Let a USB device in

MOD+F7, r starts a 30-second scan. Plug the device in. Select it, a, y. d removes an accepted one again. Only a real keyboard can do this: a program cannot let a device in.

Change a password

In rescue, or from the stick's shell:

swmtool passwd

It asks for the username, the password, and the new one twice. Only that username's entry changes; nothing is encrypted again.

Turn the TOTP codes on

Do this on the box's own screen. From the stick's shell:

swmtool unlock alice
swmtool totp on

It asks for any world's username and password, then shows two secrets, one at a time, as a QR code: dom0-loader, then dom0-login. Scan each into your phone's authenticator app and type its code back. From the next boot:

LOADER CODE 123 456  21S
NOTE: if authenticator does not match boot has been tampered with.
NOTE: hit enter to refresh loader code.

READY.
LOGIN CODE:

If the loader code matches your phone, type the login code, then the username and the password. If it is missing or wrong, type nothing and power off. swmtool totp off takes the codes away again. They prove the loader to you. They do not guard the disk. The limits are on the threat page.

Update from the stick

  1. Boot a stick of the new release.
  2. At Install (dom0/byol/update) [dom0]: type update, then set up the network.
  3. Answer Package repository, then slot A's username and password (alice), then slot B's (aliceb).
  4. It writes the new release to slot A, the old one to slot B, and updates every package of the world. It ends at Done (reboot/shell/shutdown) [reboot]:, or with UPDATE FAILED and a shell.
  5. Do it again for rescue and the decoy: their username as slot A, slot B empty.

swmtool refuses a release older than the one installed.

Unattended install

  1. Write a plan. swmtool plan -o plan on the stick's shell saves the wizard's answers, or write it by hand from swmtool-answer(5):
    base = dom0
    keyboard = us
    disk = only
    erase = yes
    unattended = yes
    timezone = UTC
    hostname = orchard
    world[ab] = ab
    world_users[ab] = alice,aliceb
    world_packages[ab] = shell,firefox
    world[rescue] = rescue
    world_users[rescue] = rescue
  2. Mount the stick's partition, labeled SWMINSTALL. Copy the plan to swm/plan. For dom0, put the passwords in swm/passwords, one username password per line. For byol, put the one password in swm/passphrase.
  3. Boot the stick on the box. It asks nothing, installs, and powers off.

disk = only refuses a box with no disk or more than one. /dev/disk/by-id/<name> refuses every box but one. Without unattended = yes, the stick shows the plan and asks for the disk's name first. A refused plan writes nothing, and the stick starts the wizard. Whoever holds that stick holds the passwords.

When it does not boot

  1. The new release does not boot. Type slot B's username, aliceb. It boots the release that ran before.
  2. The world does not open. Boot alicer, the rescue world. It still asks the world's password before it opens that world.
  3. Rescue does not boot. Boot the stick and answer update: it writes the release and the loader again. For the other commands, open the disk first in the stick's shell:
    swmtool unlock alice
  4. The loader does not start, or the ESP does not mount. From the stick's shell or rescue:
    swmtool esp restore
    It makes the ESP again from its twin at the end of the disk.

A band with a code across the top of the screen says what failed and what to do. scrotwmos(7) lists every code, and F4 takes the alert apart.

Bring a world back on a new box

You need the backup place and the password, or the recovery phrase if the password is gone.

  1. Install the new box with a world of the same name and the same usernames, with slot B and a share if the dead box had them.
  2. Boot its rescue world. Plug in the place's disk and let it in on F7.
  3. Make the world the dead box's again, then put each image back from an hour that place list shows:
    swmtool place world /dev/sdb backups alice
    swmtool place list /dev/sdb backups alice
    swmtool place restore --session main 20261025T09Z /dev/sdb backups alice
    place world names each image and the restore that brings it back. Add --root for a root or a VM disk. With a new password, add --phrase to each command and type the phrase.
  4. Boot the world. Approve each GPU and network card in F9 and F5.

byol: time travel and a first VM

On a byol box, as root, the root's points:

swmtool tt status
swmtool tt mount 20261115T10Z
swmtool tt back 20261115T10Z

tt mount puts a point read-only at /points/<hour>. tt back makes the next boot boot it; tt back undo boots the root from before the last rollback. A first VM, on a Void image named for the day it was built:

swmtool vm image build void
swmtool vm image list
swmtool vm create web void-20261115 small
swmtool vm start web
swmtool vm pass web
swmtool vm console web
swmtool vm enable web

scrotwmos-byol(7) has the boot, the TPM modes, and the rest.