The output from top() you posted doesn't show any swapping, nor any significant load.
Does the guest report anything on its console? The guest's console is logged in /var/log/messages but that assumes syslogd(8) is still functional. You may find more info on the virtual machine's console, connected via vmctl(8).
I can build large packages on my guests, which is not the same as a system build, but should be similar in terms of resource consumption. But my host is not resource constrained. Yours might be.
Could you please post more information? For example:
- Host dmesg(8)
- Guest dmesg()
- Host top() report at the time of a hang