It goes out over the networks and connected shares, usb drives etc.
macOS systems running virtualbox, vmware, etc with infected system who share directories, have the network card enabled , have shares, etc, can potentially risk losing more than the data inside the virtual image. I know there are features that let you share a partition or folder on macOS / vmware, etc. if that data gets encrypted, it's obviously also not usable on the osx side of things.
Those who run virtualized, be aware as well, I guess.
backup, patch, firewall, hugs osx