Vagrant in Disconnected Environments

I’m just getting started with Vagrant. I want to use it in a disconnected environment. I’ve installed it, and VirtualBox on a server that has no Internet connectivity. When I run any vagrant commands it immediately tries to reach out to the Internet to install plugins (e.g. vagrant-reload, vagrant-proxyconf). Is there any documentation on using Vagrant in a disconnected environment? I’m wondering if it’s even possible…

The new guy certainly appreciates any advice. :slight_smile:

Hi there,

Yes it’s possible to use Vagrant in a disconnected environment, however there is no documentation for that specific use case. You will need to manually provide the resources to Vagrant which you are intending to use.

For example, you are attempting to use some plugins, so you will need to provide them to Vagrant. You can do this by downloading the plugins directly (they are RubyGems so you can use the gem command for this: gem fetch vagrant-reload for example). If the plugins have other dependencies, you’ll need to download those RubyGems as well.

Once you have the plugins on disk, you can install them using the plugin file instead of just the plugin name. This would look like: vagrant plugin install /path/to/vagrant-reload.gem. And if the plugin had other RubyGem dependencies, you would want to install those RubyGems before the actual plugin using the same command: vagrant plugin install /path/to/vagrant-reload-dependency.gem command.

Likewise, you’ll also need to provide a box. If you are getting the box from Vagrant Cloud, you can download it directly from the web UI. Once you have the box on disk, you can then add it to Vagrant using the box command: vagrant box add --name hashicorp/bionic64 /path/to/

There is no requirement for Vagrant to have access to the internet for it to be functional. It simply makes it easier for things like box retrieval and plugin installation.