Skip to main content
An exe.dev VM is a persistent Linux machine you create and reach over SSH. Its disk belongs to that one VM. Mount an Archil disk in your VMs and they can all read and write the same files, which your other machines and the Archil SDK can reach too. exe.dev VMs support FUSE and run systemd, so the disk mounts as a regular directory. Mount it with a systemd service, which mounts the disk when the VM boots and unmounts it when the VM shuts down.

Prerequisites

  • An exe.dev account with a plan, and your SSH key added to it. ssh exe.dev whoami should print your account.
  • jq on your machine.
  • An Archil disk in the Archil region of your choice.
Set your Archil API key and region:
Create the disk with the disk CLI. The output includes the disk ID and a one-time mount token, which grants access to this disk only:
Export both for the steps below:

Mount the disk in a VM

Save this unit on your machine as archil.service. It mounts the disk at /mnt/archil, gives the exedev user ownership of it, and unmounts it when the service stops:
archil.service
Create a VM and install the archil client in it. Answer yes if SSH asks to trust the new VM’s host key:
Write the disk ID, region, and token to a file only root can read, then install and start the service:
Write a file to the disk:

Share the disk between VMs

Create a second VM and repeat the same steps:
Both VMs have the disk mounted at the same time, and the second one finds the line the first one wrote:

How the disk behaves in a VM

The mount uses conditional mode. With --conditional, every VM can read and write anywhere on the disk at the same time, and none of them holds a lock that another VM has to wait for. See Sharing disks. Restarts need no special handling. When the VM shuts down, systemd stops the service, which unmounts the disk and sends every buffered write to it. When the VM boots, systemd mounts the disk again. Stop the service to unmount. sudo systemctl stop archil unmounts the disk until you run sudo systemctl start archil. To stop mounting it at boot, run sudo systemctl disable --now archil.

Clean up

Delete the VMs and the disk once you no longer need them:

Next steps