Not sure whether you know something I don't but I'm not aware of any VM when I'm running Docker containers directly on my Mac?
This is because it’s running in a VM, not natively on the host. On Linux you can do any of those things from the host directly, without needing to shell into the container.
I actually found this so incredibly frustrating when I started working at a job that uses docker that I argued in vain against using docker at all, and then when that failed, I switched to doing all my coding and other technical work on a Linux VM and only using macOS for email.
[1] https://www.docker.com/blog/speed-boost-achievement-unlocked...
Not as good as native linux though.