To solve some common issues:
- Ensure
PermitRootLogin yes
remains set in/etc/ssh/sshd_config
(in the instance) or the machine may become inaccessible/fail to start. - If a custom root password (e.g.
pass
) is set (in the instance), addrootpassword: pass
inconfig.yaml
viaalpine edit machine-name
or directly with any text editor. - If
alpine list
reports a machine isRunning
but the process has been terminated/killed, deleting the PID file at~/.macpine/machine-name/alpine.pid
may resolve the issue.killall qemu-system
may also be useful to hard stop any running instances if needed.
Time sync issues between the host and a VM are well known. For example, when the host is suspended, the VM clock will also stop ticking.
To re-adjust a macpine
instance real-time clock to its system clock, execute (inside the instance):
hwclock -s
Or on the host:
alpine exec instance-name "hwclock -s"
Also, consider an ntp
daemon within your instance to maintain the system clock. This can be added inside your instance:
apk update; apk add openntpd
rc-update add openntpd default
rc-service openntpd start
or
apk update; apk add chrony
service chronyd start
More information on chronyd
can be found on the Arch wiki
- Due to how
qemu
forwards network connections from the guest out via the host, utilities such asping
may not work (as ICMP is not handled). - If an instance fails to start with a port error, there may be a listener already bound to the requested port(s). Ensure that the
ssh
port and any ports on the host side in thePorts
configuration are mutually exclusive between instances which must run simultaneously. netstat -anp tcp
andnetstat -anp udp
can be used to discover activeLISTEN
connections on the host. Ensure no other running services have bound ports that are configured to be forwarded to an instance (ssh
or otherwise).qemu
binds0.0.0.0
for forwarded ports. This means that by default any source IP may send traffic to a guest. If the host system does not have a firewall enabled then any machines which can reach the host can send traffic to the guest. If this is not desired, enable a host firewall. You do not need to click "Allow" for incoming connection toqemu
when prompted by macOS as loopback connections (i.e. directly from the host itself) will still be allowed.
- If alpine is not able to resize the disk, it will error out with this message:
unable to resize disk: signal: abort trap
. Internally, it runs the commandqemu-img resize <IMAGE_LOCATION> <+SIZE>
. If theqemu-img resize
command errors out withdyld[...]: Library not loaded: /opt/homebrew/opt/libunistring/lib/libunistring.2.dylib
then re-installinggettext
viabrew reinstall gettext
may resolve the issue.