简体   繁体   English

Vagrant是否可以直接使用OS .ISO安装映像/或即时从ISO创建Vagrant框?

[英]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? 是否可以从原始ISO自动为OS安装创建Vagrant .box文件?

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. 对我来说,这是Vagrant提供的虚拟机上的操作系统安装和配置的端到端自动化的一个重大缺口。

Sure, VagrantBox.es provides many base .box OS install files for usage. 当然,VagrantBox.es提供了许多基本的.box OS安装文件供使用。 But some are from third party suppliers and not from the original OS distribution maker. 但是有些来自第三方供应商,而不是原始的OS发行商。 For example Arch Linux: Arch Linux 64 (2012-07-02) http://vagrant.pouss.in/archlinux_2012-07-02.box 例如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/ ). 不想对第三方供应商的努力持消极态度,但是某些组织可能希望原始OS提供商提供原始安装映像(例如,对于上面的Arch示例,这是: https : //www.archlinux.org/下载/ )。 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 另一个原因是直接利用原始供应商的新版本,而不必等待第三方将其作为Vagrant .box发布。

There are guides for creating a .box file from a .ISO image: 有从.ISO映像创建.box文件的指南:

But these are manual steps - which goes against the philosphy behind Vagrant of automation and consistency. 但是,这些都是手动步骤-与Vagrant自动化和一致性背后的哲学背道而驰。 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. 因此,我将从一个明确的答案中寻找问题,该答案描述了如何制作通用自动化脚本以将.ISO OS安装映像转换为Vagrant框。

I think VeeWee provides a great mechanism for preparing a Vagrant box from an ISO: 我认为VeeWee提供了一种从ISO准备Vagrant盒子的好机制:

https://github.com/jedi4ever/veewee 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: 或者,您可以使用Packer:

https://packer.io/ https://packer.io/

Which is produced by the same company that makes Vagrant, so it has fairly good integration. 它由制造Vagrant的同一家公司生产,因此具有相当好的集成度。 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: 我相信Packer本身并未提供示例模板,但是您可以根据需要使用Puppet Labs用于其测试目的的模板:

https://github.com/puppetlabs/puppetlabs-packer 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. 这可以用作您自己的模板的坚实基础并可以修改以使其具有品味,或者可以根据需要提高项目的PR以回馈。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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