pyite22
pyite22

Reputation: 53

Custom Vagrant Box on Google Compute Engine

I have a custom vagrant box that is currently being hosted on the hashicorp vagrant page. Is it possible to somehow provision this specific vm, using google compute as the host machine?

i've looked at the vagrant plugin for gce, but im not sure i can accomplish what i would like to do with it.

Upvotes: 1

Views: 793

Answers (1)

Frederic Henri
Frederic Henri

Reputation: 53793

how did you create the box ? (you could point to the box URL so it can be reviewed.)

The short answer is that if you created the box using tool such as packer and specify the Google Compute Engine as provider, the box would work with gce provider, else no it will not work.

From vagrant box documentation

Creating a base box is actually provider-specific. This means that depending on if you're using VirtualBox, VMware, AWS, etc. the process for creating a base box is different

it could be added that "... and the box can only be used with the provider for which it has been created"

Follow up

The box you referenced is for VirtualBox so it will not work with any other provider.

From there you would have 2 possibilities

  1. download the example box from hashicorp

    vagrant box add gce https://github.com/mitchellh/vagrant-google/raw/master/google.box
    

and make change as you would need - repackage if needed

  1. build the box yourself, I would suggest you look at packer with the GCE provider

Upvotes: 2

Related Questions