Automating this setup is also somewhat easily possible with, e. G., Lima[0] or HashiCorp vagrant[1].
[0]: https://lima-vm.io/
[1]: https://developer.hashicorp.com/vagrant