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:
–BDub

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/vagrant.box

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.

Using Vagrant in disconnected (offline) environments, where internet access is limited or unavailable, requires additional considerations and planning for roof installations monroe. Vagrant typically relies on the internet to download box images, provisioners, and plugins.

Hey BDub,

Using Vagrant in a disconnected environment is definitely possible. You’ll need to pre-download any required plugins and boxes before moving to the server without internet connectivity. Install plugins with vagrant plugin install <path-to-plugin.gem> using the local .gem files, and add boxes with vagrant box add for local box files. Unfortunately, Vagrant doesn’t have specific documentation for disconnected environments, but these steps should help you set up everything you need offline. Best of luck with your Vagrant projects!