Lima (Linux virtual machines, pronounced lee-mah) lets macOS developers run full Linux VMs with automatic port forwarding, file sharing, and containerd support — no Docker Desktop license required. It's popular for running Linux-specific tools, local Kubernetes clusters, and containerized development environments. Services running inside Lima VMs are locally accessible but typically invisible to external monitoring. Vigilmon bridges that gap: wire your Lima-hosted services to cloud-based uptime monitoring so you know immediately when a shared development VM or staging service goes down.
What You'll Set Up
- HTTP uptime monitor for services running inside Lima VMs
- Cron heartbeat for background workers and daemons in Lima VMs
- SSL certificate monitoring for locally signed certificates in staging VMs
- TCP port checks for database and cache services
Prerequisites
- Lima 0.16+ installed on macOS (
brew install lima) - At least one VM running (
limactl start) with a service inside - A free Vigilmon account
Step 1: Expose Your Lima VM Service to Monitoring
Lima forwards ports from the guest VM to 127.0.0.1 on the host by default. For external monitoring you need one of:
- A VPN or tunnel (Tailscale, ngrok) that exposes the VM's port publicly
- Cloud deployment of the same service, with Lima as the local mirror
- Vigilmon's agent running inside the VM and reporting to Vigilmon's cloud
For shared development VMs on a VPS running Lima, the service is already externally accessible. Add a monitor directly:
- Log in to vigilmon.online and click Add Monitor.
- Set Type to
HTTP / HTTPS. - Enter the service URL:
http://your-vps-ip:8080orhttps://dev.example.com. - Set Check interval to
2 minutes. - Set Expected HTTP status to
200. - Click Save.
For a purely local Lima VM, use Tailscale or a similar mesh VPN to expose the VM's address to Vigilmon:
# Inside the Lima VM
limactl shell default
curl -fsSL https://tailscale.com/install.sh | sh
sudo tailscale up --authkey=YOUR_TAILSCALE_KEY
After joining Tailscale, the VM has a stable 100.x.x.x address that Vigilmon can reach.
Step 2: Add Health Endpoints to Lima-Hosted Services
Services inside Lima should expose a /health endpoint that returns machine-readable status. This lets Vigilmon (and developers) quickly confirm the service is running.
For a containerd/nerdctl service
# compose.yaml inside the Lima VM
services:
api:
image: my-api:latest
ports:
- "8080:8080"
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8080/health"]
interval: 30s
timeout: 5s
retries: 3
For a native Linux service
# systemd service file: /etc/systemd/system/my-api.service
[Unit]
Description=My API Service
After=network.target
[Service]
ExecStart=/usr/local/bin/my-api
Restart=on-failure
[Install]
WantedBy=multi-user.target
Deploy the service in the VM:
limactl shell default -- sudo systemctl enable --now my-api
The /health endpoint now answers on port 8080 inside the VM, forwarded or exposed through Tailscale.
Step 3: Monitor Background Daemons with Heartbeats
Lima VMs often run background processes — build daemons, test runners, local CI pipelines. These have no HTTP endpoint to probe. Use Vigilmon's cron heartbeat instead.
- In Vigilmon, click Add Monitor → Cron Heartbeat.
- Set the expected interval:
30minutes for a half-hourly job,1440minutes for a daily task. - Copy the heartbeat URL.
Inside the Lima VM, add the ping to your daemon or cron job:
# /etc/cron.d/build-job inside the Lima VM
*/30 * * * * ubuntu /home/ubuntu/scripts/build.sh && curl -s https://vigilmon.online/heartbeat/abc123
Or in a systemd timer:
# /etc/systemd/system/build-job.service
[Unit]
Description=Build job with Vigilmon heartbeat
[Service]
Type=oneshot
ExecStart=/home/ubuntu/scripts/build.sh
ExecStartPost=curl -s https://vigilmon.online/heartbeat/abc123
User=ubuntu
If the VM suspends, crashes, or the cron daemon dies, the heartbeat stops and Vigilmon alerts.
Step 4: TCP Port Monitoring for Databases and Caches
Lima VMs are popular for running development databases (PostgreSQL, MySQL, Redis) without installing them natively on macOS. Monitor the forwarded ports so you know if the database inside the VM goes down.
Lima port forwarding configuration (~/.lima/default/lima.yaml):
portForwards:
- guestPort: 5432
hostPort: 5432
- guestPort: 6379
hostPort: 6379
After the VM starts, add TCP monitors in Vigilmon for the host ports — or, if the VM is on a VPS, for the VPS IP:
- In Vigilmon, click Add Monitor → TCP.
- Enter the host:
your-vps-ipand port:5432. - Set Check interval to
1 minute. - Click Save.
Repeat for Redis on port 6379. A crashed PostgreSQL inside the VM shows up within one minute.
Step 5: SSL Certificate Alerts for Local HTTPS Setups
Development VMs often use self-signed certificates or mkcert-generated certificates for local HTTPS. These have short validity periods (typically 1–2 years) and no auto-renewal. Add SSL monitoring in Vigilmon to catch upcoming expirations:
- Open the HTTP monitor for your Lima-hosted service.
- Enable Monitor SSL certificate.
- Set Alert when certificate expires in less than
30 days. - Click Save.
To regenerate a mkcert certificate inside the VM before it expires:
limactl shell default
mkcert -install
mkcert dev.example.com localhost 127.0.0.1
# Restart your service to pick up the new certificate
sudo systemctl restart my-api
Step 6: Configure Alerts and Maintenance Windows
Lima VMs are frequently stopped and restarted. Configure Vigilmon to tolerate brief downtime during VM restarts:
- Go to Alert Channels and add your preferred channel (Slack, email, webhook).
- Set Consecutive failures before alert to
3on HTTP and TCP monitors — Lima VMs typically restart in 30–60 seconds. - Use Maintenance windows when doing VM snapshots or upgrades:
# Pause monitoring before stopping the VM
curl -X POST https://vigilmon.online/api/maintenance \
-H "Authorization: Bearer YOUR_API_KEY" \
-d '{"monitor_id": "abc123", "duration_minutes": 10}'
limactl stop default
limactl start default
# Window expires automatically after 10 minutes
Summary
| Monitor | Target | What It Catches | |---|---|---| | HTTP health | Lima VM service endpoint | Service crash inside VM | | Cron heartbeat | Background daemon / cron job | VM suspended or daemon died | | TCP port | Forwarded DB/cache port | Database inside VM down | | SSL certificate | VM HTTPS endpoint | Self-signed cert expired |
Lima makes Linux development on macOS seamless — but the services inside VMs are a blind spot for standard monitoring tools. With Vigilmon watching your Lima-hosted endpoints, heartbeats, and TCP ports, you get the same visibility into VM-hosted services that you expect from any cloud deployment.