I have a similar setup on a Windows 10 machine that doesn't have any such issues. This tread about macOS version 10.15.2.
If the QEMU window is not visible (hidden, minimized or another application is in full screen mode), the QEMU process gradually freezes: it still runs, but the VM does not respond to external requests such as Telnet or SSH until the QEMU window is visible on the desktop.
I need to run QEMU as a separate background process so i use additional
stty command to prevent job suspending. Full command line looks like that:
(sudo sleep 1; sudo ifconfig bridge0 addm tap0) &! sudo stty -tostop sudo qemu-system-x86_64 -nodefaults \ -cpu host -accel hvf -smp 1 -m 384 \ -device virtio-blk-pci,drive=flash0 \ -drive file=vios-adventerprisek9-m.vmdk.SPA.156-1.T.vmdk,if=none,format=vmdk,id=flash0 \ -device e1000,netdev=local -netdev tap,id=local,ifname=tap0,script=no,downscript=no \ -serial vc &
I didn't use the
-daemonize argument because nothing happens when QEMU starts with it: the process opens the TAP interface, but does not respond to external requests (when using
-monitor telnet:127.0.0.1:<PORT>,server,nowait, the connection is not possible).
I have also tried playing around with other ways, with no success:
I think it's a feature of macOS desktop environment processes handling, somehow related to power consumption, but I don't know how to manage it.
The problem is in App Nap mechanism, but methods like
defaults write NSGlobalDomain NSAppSleepDisabled -bool YES now wokring, QEMU still goes to App Nap enabled state.
How to turn it off for selected terminal process?
Only one method was able to solve this problem — start process without desktop window with
-display none argument (and with output from serial line to STDIO with
-serial stdio argument).