Skip to main content
A stop saves the disk, then removes the machine. A stopped sandbox costs nothing. Run boat resume to get it back.

What a stop does

Boat does these steps in this order:
  1. Boat runs your pre-stop command, if you have one.
  2. Boat stops your Docker containers. Each container gets 30 seconds to exit.
  3. Boat takes the last snapshot of the disk.
  4. Boat turns off the machine and removes it.
Boat does not shut down the operating system. Only Docker containers get a stop signal. Your other programs get no signal. A program that runs during the stop does not run its cleanup code. Its files go into the snapshot as they are at that moment. To clean up, use one of these:
  • Clean up when the sandbox starts again. An enabled systemd service with an ExecStartPre= step runs at every resume. Read Long-Running Tasks.
  • Run your own cleanup first, then run boat stop.

Save app state before a stop

Some apps keep recent changes in memory. They write them to disk later. Chrome is an example. Chrome writes new cookies to disk every 30 seconds, or when it closes. If you stop the sandbox a few seconds after a login, the snapshot has the old cookies. A kill signal does not help, because Chrome then exits without saving. To fix this, put a command in the file ~/.boat/pre-stop. Boat runs it at every stop, before the last snapshot. The example below closes Chrome. It needs Chrome to have a debug port. Start Chrome with --remote-debugging-port=9222.
A Chrome that you started without the flag does not answer, so the command does not close it. A Chrome that you opened from the desktop is an example. Start it again with the flag. How the pre-stop command runs:
  • It runs as user, in your home folder.
  • It has 60 seconds. After that, Boat stops it.
  • It runs on boat stop and on auto-stop.
  • It does not run on boat stop --force. It does not run when you save a named snapshot.
  • If it fails or takes too long, the stop continues.
  • The file is on the disk. Resumes, forks and templates keep it.

When a stop is refused

A stop saves the disk first. If the save fails, Boat refuses the stop. The sandbox keeps running, so you do not lose work. Boat tries again by itself and sends you an email. You do not pay while the stop waits. Billing pauses at the first refused stop. Your balance and your invoice both show the pause. You do not need to ask for a refund.
  • The pause continues while the stop waits, even if you or your scripts use the sandbox.
  • The pause ends when the sandbox stops.
  • The pause also ends when you resume the sandbox, because a resume cancels the stop.
  • If the refused stop was an auto-stop, the pause ends when you use the sandbox again.
The stop waits until a save works. Then the sandbox stops by itself. If this happens again and again, snapshots fail on that sandbox. We get an alert. Please also contact us, so that we look at your sandbox. To stop the sandbox now, run boat stop --force. The sandbox stops with its last good snapshot. You lose everything written after that snapshot. After 3 days of failed saves, Boat does a forced stop by itself. Boat sends you an email before it does this.

Stop without saving

To never save a sandbox, turn snapshots off for your account or for one sandbox. Boat then never saves it, and a stop erases it.