

Beginners should avoid Kali Linux, but Kali is one example of a Linux distro that comes in ready-to-run virtual machines for VMware and VirtualBox, but not Parallels.) Now we run the firewall on its own hardware, but the server is still the family server. (Our firewall was available as a VMware virtual machine, and I ran it on a Mac mini Server for several years. Many products are available as downloadable VMware virtual machines, including ready-to-run Linux distros. I use VMware Fusion for many reasons, but mostly for compatibility with VMware virtual machines that run on Windows, and Linux, (and ESXi).

Another is VMware Fusion, which has not been mentioned before. Virtual machine software for Macs includes VirtualBox (free) and Parallels, which were mentioned above. One drawback of virtual machines is that they use a lot of drive space. You can create many snapshots, branch them, etc. Virtual machines offer advantages like "Snapshots", which allow you to save the machine, try something you are not sure about, and then restore the machine back to the snapshot. I run Linux on that Mac in virtual machines. On the other hand, that may not matter in some considerations. My reading on the matter suggests that linux is still most superior on intel or amd hardware, so I think that for optimal facility, one might consider matching hardware with software. The Macs are made to optimally run Apple's operating systems though linux can run on pretty much any of them. I'm a little out of date having given up my Mac a few years ago. You would need to get Mac's xcode program and perhaps some other generic program-assisting programs.

If you want to cross-compile for linux architectures, that's possible. The terminals and IDEs if you want them are mostly available. Nearly of the linux programs are downloadable to the Mac through the homebrew package management system, which includes the C coding essentials like gcc and clang and all manner of other programming languages. I can't tell you which is the best linux distro for the Mac M1, but what I can tell you is that your Mac can be run very similarly to a linux computer.
