This is a quick guide on how to fix issues with vagrant plugins that can happen when upgrading from an older vagrant version on Mac.
Most of my work today is either in Ping One Advanced Identity Cloud or in a kubernetes based ForgeOps deployment. But every now and then, all I need is a VM running some software, for example, a standalone PingAM. I find the easiest way to manage VMs is by using vagrant. It’s been a while since I last used it, so I ran an update to the latest version and tried to initiate a box.
The issue
You want to create a new linux box using vagrant, so you run:
| |
But instead of initialising a Vagrant file, I got an error message:
| |
The error message gives some good suggestions on resolving the issue, so I tried following them one by one up to:
| |
This would still throw an error, albeit a different one:
Why does this error happen
When Vagrant upgrades, its internal Ruby‑gem ecosystem can end up with mismatched plugin versions. The expunge command clears out old gems; vbguest or disksize then must be reinstalled to resolve dependencies.
The fix
So to resolve this, I had to run the plugin expunge --reinstall command, then install the failing vagrant-vbguest plugin and then again run the plugin expunge --reinstall command
- Backup existing plugins (optional):
| |
- Expunge and reinstall everything:bashCopyEdit
| |
- Install any failing plugin manually:bashCopyEdit
| |
- Re‑verify:
The vagrant box should now initialise just fine.
Hope this helps if someone comes across the same error.