Troubleshooting
This page lists common issues and their solutions when working with macpine.
Stale PID File
Symptom: alpine list reports an instance as Running, but it is not. Attempts to stop or delete it might fail.
Cause: The QEMU process was terminated unexpectedly (e.g., kill -9, system crash), leaving behind a PID file (alpine.pid).
Solution: Manually delete the PID file from the instance's directory.
rm ~/.macpine/your-instance-name/alpine.pid
To be certain no QEMU processes are running, you can use killall qemu-system-aarch64 or killall qemu-system-x86_64.
Inaccessible Instance
Symptom: You cannot SSH into your instance or it fails to start properly.
Cause: This often happens if the SSH server configuration inside the VM is changed incorrectly.
Solution:
- Ensure
PermitRootLogin yes(orprohibit-passwordif using SSH keys) is set in/etc/ssh/sshd_configinside the VM. - If you changed the root password inside the VM, you must update the
rootpasswordfield in the instance'sconfig.yamlto match. Usealpine edit your-instance-nameto do this.
Time Drift
Symptom: The clock inside the VM is incorrect, especially after the host machine has been asleep.
Cause: When the host sleeps, the VM's clock stops ticking.
Solution:
-
Manual Sync: Run
hwclock -sto sync the hardware clock from the host. You can do this from outside the VM:alpine exec your-instance-name "hwclock -s" -
Automatic Sync (Recommended): Install an NTP client inside the VM to keep the time synchronized automatically.
# Connect to the VM alpine ssh your-instance-name # Install and enable an NTP client (e.g., chrony) apk update && apk add chrony rc-update add chronyd default rc-service chronyd start
Networking Issues
pingdoesn't work: In the default SLIRP networking mode, ICMP traffic (used byping) is not forwarded. This is expected behavior. Network connectivity for TCP/UDP should still work.- Port conflict on start: If an instance fails to start with a port-related error, it means another service (or another
macpineinstance) is already using that port on your host. Ensure that the SSH port and any other forwarded ports are unique for each simultaneously running instance. - Firewall Prompts: When you start an instance with port forwarding, macOS may ask if you want to allow incoming connections to
qemu-system-*. You can typically click "Deny". Port forwarding fromlocalhost(your host machine to the guest) will still work. If you need other machines on your network to access the forwarded ports, you must enable a host firewall and configure it appropriately.
Disk Resize Failure
Symptom: alpine launch fails with unable to resize disk: signal: abort trap.
Cause: This can be caused by a dynamic library issue with the qemu-img utility, often related to the gettext dependency installed via Homebrew.
Solution: Reinstall gettext using Homebrew.
brew reinstall gettext