Setting up Vagrant 2.3.0 for Virtual Machine Management in Mac ( Apple M1 Pro)
For developer’s it is always need a local environment to try out different development tasks and this enables a need for multiple VM management in local PC’s. Vagrant is the most convenient tool used these days to setup and manage multiple VMs in a local environment.
In this article my intention is to explain how we can setup this is in Mac Apple M1 CPU architecture — where which installation need some dependencies as currently the virtual box not supported in the Apple M1.
What we are going to setup
- Rosetta 2: This is to run an app built for a Mac with an Intel processor on top of the Mac with Apple silicon.
- Vagrant 2.3.0: Vagrant distribution to use for the VM setup and Management
- vagrant-vmware-desktop ( 3.0.1 ): Main part of the vmware provider for vagrant.
- vagrant vmware utility ( 1.0.21 ): Service that the vagrant-vmware-desktop plugin interacts with. The purpose of this part of the plugin is to do operations which require privileged access on the host. This includes network operations and verification of fusion/workstation. ( Content fectched from https://github.com/hashicorp/vagrant-vmware-desktop )
- Hypervisor ( VMware Fusion Public Tech Preview 22H2 ): As mentioned this will be used as the hypervisor.
- As initial step, setup the Rosetta 2. Execute the below command to achieve it.
2. Install Vagrant. Go to https://www.vagrantup.com/downloads and download the one for the Mac and install the dmg.
Check the version of vagrant using the below command.
3. Install the Hypervisor ( VMware Fusion Public Tech Preview 22H2 ). Go to https://customerconnect.vmware.com/downloads/get-download?downloadGroup=FUS-PUBTP-22H2 and install the VMware-Fusion-e.x.p-20191287_universal.dmg.
Execute the below command as well
4. Now install the vmware utility. Go to https://www.vagrantup.com/vmware/downloads and download and install the Vagrant vmware Utility 1.0.21.
After installing check the log at the below location. This is to check whether the vm-utility running properly.
to check whether running
If not to start it
5. Now execute the below command to install the vagrant-vmware-desktop.
6. Now we can create the vagrant file and execute the commands to create the needed VMs.
7. Now execute the vagrant up command to create and start the VM. Note that when run this command there will be a GUI will open and just minimise and run it at the background. When we execute without that GUI option the vagrant up command hangs and seems it’s a known issue .
8. To SSH into the servers
9. Likewise other VMs also can be started. That’s it for this blog.
10. More useful commands and cheat sheet can be found at https://gist.github.com/wpscholar/a49594e2e2b918f4d0c4