22

Is it possible to automate the creation of a Vagrant .box file for an OS install, from the original ISO?

To me, this is a significant gap in the end-to-end automation of Operating System install and configuration on a Virtual Machine that Vagrant provides.

Sure, VagrantBox.es provides many base .box OS install files for usage. But some are from third party suppliers and not from the original OS distribution maker. For example Arch Linux: Arch Linux 64 (2012-07-02) http://vagrant.pouss.in/archlinux_2012-07-02.box

Not wanting to be negative about the efforts of third-party suppliers, but some organisations may want the original install image from the original OS provider (e.g. for the Arch example above, this would be: https://www.archlinux.org/download/ ). Reasons for wanting original install image would be security (as it would not be possible to verify the third party image for security compromises and malware) and getting the image as the original suppliers intended without extra stuff not required. Another reason would be to take advantage of new releases direct from the original supplier and not have to wait for a third party to release it as a Vagrant .box

There are guides for creating a .box file from a .ISO image:

But these are manual steps - which goes against the philosphy behind Vagrant of automation and consistency. Especially if many want to achieve the end goal of being able to use the original - this would end up with duplicate effort on everyone's part.

So I would be looking here from a definitive answer that describes how to make a generic automation script to convert a .ISO OS install image into a Vagrant box.

therobyouknow
  • 6,604
  • 13
  • 56
  • 73
  • 1
    I wrote the post at practicalweb, it was largely a learning exercise to understand exactly what is in a base box. Veewee sounds like what you want – Sean Burlington Oct 21 '14 at 19:22
  • +1 Thanks Sean. I appreciate your method and certainly think that is the best way to learn, worthwhile sharing with others too. – therobyouknow Jun 01 '16 at 08:05

1 Answers1

27

I think VeeWee provides a great mechanism for preparing a Vagrant box from an ISO:

https://github.com/jedi4ever/veewee

It already provides a lot of out-of-the-box templates for most distributions, which you can customize if required (although this is often not needed). Alternatively you can create your own definitions.

Alternatively you can use Packer:

https://packer.io/

Which is produced by the same company that makes Vagrant, so it has fairly good integration. Packer itself doesn't provided sample templates I believe, but you can use the ones Puppet Labs uses for its own testing purposes if you like:

https://github.com/puppetlabs/puppetlabs-packer

This can be used as a solid base for your own templates and modified to taste, or you can raise a PR on the project to contribute back if desired.

Ken Barber
  • 697
  • 5
  • 14
  • +1 @Ken Barber thanks this looks like what I'm looking for. I will check it and leave the question open for a little while to give others the opportunity to contribute. – therobyouknow Mar 06 '13 at 09:57
  • Actually I'm going to accept this because I think it right on the money for what I am looking to do. Naturally the authors may continue to enhance it or indeed others may. But don't want to keep you waiting for an accept. Thank you. – therobyouknow Mar 06 '13 at 10:01
  • Finding references to VeeWee in search speeded up my inclination to accept. Here's a guide here: http://spilth.org/blog/2013/01/21/automated-vm-generation-with-veewee-jenkins-and-amazon-s3/ Loads of other search results. – therobyouknow Mar 06 '13 at 10:04