ash-rebuild-db - rebuild a VM's Nix store database
Deletes the named VM's strategy-specific Nix store state, then regenerates it from the VM's saved ash-state.toml and current NixOS closure.
For strategy=shared, rebuild-db removes only the Nix-related directories below shares/{ro,rw}/system, including local-overlay metadata, upper, and work directories. For strategy=image, it removes nix-store.img and its closure marker but preserves the closure base under $XDG_CACHE_HOME/$ASH_NAME/nix-store-images. ASH_NAME defaults to ash. The replacement image reuses that cache when the closure matches. In either case, guest-installed store paths are discarded.
The VM must be stopped. persist.img, workspace, SSH keys, runtime mount state, and other non-store share data are preserved.
After removing the store state, ash resolves the saved flake again, prepares the configured store strategy, and regenerates virtle.toml and SSH helper scripts. The next normal spawn starts with the rebuilt store.
ash stop work
ash rebuild-db work
ash attach --spawn work
Generated from ash Cmdliner manpage metadata.