简体   繁体   中英

Is it possible for Vagrant to use an OS .ISO install image directly/or create a Vagrant box from an ISO on the fly?

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 (eg 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.

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM