Virtualbox "auto-capture keyboard" option in the enabled state crashes stumpwm. The message "another window manager is running" is printed by the stumpwm process and stumpwm attempts a restart.
;;previous and current window
(NIL #S(TILE-WINDOW "my-virtualbox-vm [Running] - Oracle VM VirtualBox" #x1400002))
Another window manager is running.
(:ASYNCHRONOUS T :CURRENT-SEQUENCE 55442 :MAJOR 33 :MINOR 0 :SEQUENCE 52947)
I've successfully worked around the issue by:
1. Disabling "auto-caputre keyboard" option in Virtualbox
2. Redefining the "error-handler" function as below to both comment out the (throw :top-level :quit) to prevent crash, and to print some more debugging info:
;(throw :top-level :quit)
;; all other asynchronous errors are printed.
(message "Caught Asynchronous X Error: ~s ~s" error-key key-vals))
(apply 'error error-key :display display :error-key error-key key-vals))))
I'm not familiar enough with the X protocol or whatever Virtualbox might be doing with it to understand what is causing this problem, but I'm pretty sure stumpwm shouldn't crash in this case. It doesn't seem like it's Virtualbox' fault since other window managers don't crash with virtualbox (eg gnome).