I run a lot of Linux software (e.g. emacs) on macOS by ssh-ing into a Linux virtual machine. I share a folder with the virtual machine to make everything more seamless.
I'm currently using Parallels to achieve this and it works pretty well. Does anyone have a preference for some other virtualisation software (e.g. VMWare Fusion) over this? I am using a macOS laptop so battery life is something I should consider too.