Vagrant provide you to isolate your development environment, Helps you not dirty your machine. To run vagrant in M1 you need to install the vagrant first, as well as VMware fusion hypervisor. Virtualbox only supports intel-based process architecture.
vagrant plugin install vagrant-vmware-desktop
VagrantFile the Ubuntu VM.Vagrant.configure("2") do |config|
config.vm.box = "hashicorp/precise64"
end
vagrant upvagrant ssh