coreapp-vm command, uninstall.sh, stale-system check

- bin/coreapp-vm replaces scripts/create-coreserver-vm.sh: create (downloads
  and checks the CoreServer image when it's missing, resumes an interrupted
  download), list, ip, ssh (own known_hosts), start, stop, delete (asks for
  the name). update.sh symlinks it into ~/.local/bin.
- uninstall.sh removes coreapp-vm, the coreapp network, its hook and ufw
  rules; asks before deleting VMs, the image and keys.
- install.sh runs CoreDesktop's update first when the system wasn't
  upgraded in the last day, as `sibling add` does.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-12-03 11:40:04 -07:00
co-authored by Claude Opus 5.5
parent b405e35ea8
commit 0654d4c712
9 changed files with 443 additions and 143 deletions
+40 -11
View File
@@ -17,22 +17,22 @@ sibling add https://gitea.federated.computer/Federated_Computer/coreapp-dev.git
```
This installs libvirt and QEMU/KVM, adds you to the `libvirt` group (log out
and back in afterwards), and sets up the `coreapp` VM network
(10.123.0.0/24). CoreDesktop's `update` keeps them current.
and back in afterwards), sets up the `coreapp` VM network (10.123.0.0/24) and
installs the `coreapp-vm` command. CoreDesktop's `update` keeps them current.
## A Core in a VM
1. Download the CoreServer image to
`~/.local/share/coreapp-dev/images/coreserver-enterprise-x86-26-05-12.qcow2`
(see [PLAN.md](PLAN.md) for the URL).
2. Put the SSH public key from Federated's dashboard (Cores) in
1. Put the SSH public key from Federated's dashboard (Cores) in
`~/.config/coreapp-dev/authorized_keys`, so the Provisioner can log in.
3. Create the VM:
2. Create the VM:
```
scripts/create-coreserver-vm.sh
coreapp-vm create
```
It gets 10.123.0.10. Log in with
`ssh -i ~/.local/share/coreapp-dev/ssh/id_ed25519 root@10.123.0.10`.
The first time, it downloads the CoreServer image (1.3 GB) to
`~/.local/share/coreapp-dev/images/`. The VM is called `coreserver` and
gets 10.123.0.10.
3. Log in with `coreapp-vm ssh`, or run a command on it:
`coreapp-vm ssh docker ps`.
4. Federated's Provisioner has to reach the VM over SSH, and the Core must be
reachable from the internet. Behind a home router, use
[corerelay](https://gitea.federated.computer/Federated_Computer/corerelay)
@@ -41,11 +41,40 @@ and back in afterwards), and sets up the `coreapp` VM network
([Provisioning a Core](https://documentation.federated.computer/self-hosted/cores/provisioning-a-core/)),
with the public IP as `ip`.
## Commands
| Command | Does |
|---|---|
| `coreapp-vm create [name]` | Create a VM (downloads the image if it's missing) |
| `coreapp-vm list` | VMs, their state and address |
| `coreapp-vm ip [name]` | A VM's address |
| `coreapp-vm ssh [name] [cmd]` | Log in as root, or run a command |
| `coreapp-vm start` / `stop [name]` | Start / shut down |
| `coreapp-vm delete [name]` | Delete a VM and its disk (asks first) |
`name` defaults to `coreserver`. Before deleting a VM that has a Core on it,
delete the Core in Federated's dashboard, or at least before putting another
VM behind the same public IP: deleting a Core makes Federated log in to its
IP and tear down whatever it finds there.
## Uninstall
`sibling remove` only deletes the clone, so first run
```
bash ~/.local/share/siblings/coreapp-dev/uninstall.sh
```
It removes `coreapp-vm`, the `coreapp` network and its firewall rules, and
asks before deleting VMs, the downloaded image and your keys. libvirt and QEMU
stay installed.
## Files
| Path | What it is |
|---|---|
| `install.sh`, `update.sh` | Run by CoreDesktop's `sibling add` and `update` |
| `libvirt/network-hook.sh` | NAT and firewall rules for the `coreapp` network |
| `scripts/create-coreserver-vm.sh` | Creates a CoreServer VM |
| `bin/coreapp-vm` | Creates and manages CoreServer VMs (`coreapp-vm help`) |
| `uninstall.sh` | Removes what coreapp-dev set up |
| [PLAN.md](PLAN.md), [TEST.md](TEST.md) | What's next, and how to test it |