Issue Description
There has been a big issue with the local dev environments after upgrading to Mac OS BigSur. Basically, it stopped working. This has happened previously but not to this scale.
The issue is mainly due to the new OS having some structure changes and also the new M1 chip in the latest hardware.
If using a machine with the M1 chip, VirtualBox simply doesn’t work and there are no plans to support it moving forward (at the time of writing).
The issue that’s been plaguing my laptop’s local environment is that virtualbox wouldn’t run correctly without errors, vagrant didn’t ‘up’ correctly and the IP address change wouldn’t load anything other than static HTML pages when it could.
How to Fix the Issue
Finally, after weeks of trying different things, it’s finally working.
The following steps seemed to do the trick:
- Completely remove VirtualBox from the machine and restart
- Delete the folder VirtualBox VMs from the user folder, if it still exists
- Completely remove Vagrant from the machine and restart
- Remove the hidden files from Vagrant in user > .vagrant.d
- Clear the trash to remove all files (if possible)
- Restart
- Re-install the latest VirtualBox version
- Re-install the latest Vagrant version
- In the homestead.yaml, change the local IP address to something else e.g. 192.168.30.5
- Update the hosts file (using GasMask) to have the same IP as above
- Run vagrant up to create the environment
If that works then you’re good to go!
The next issue I faced was the PHP version deprecated a bunch of WP functions. To run an older version of PHP simply add ‘php: “7.4”‘ under the domain map in the homestead.yaml file.
If that causes a 502 gateway error, you need to SSH in to the vagrant box and then run the following command:
sudo service php7.4-fpm restart
This will restart the php version and should get it running again!