如何打包未使用vagrant up命令创建的现有VM? [英] How do I package an existing VM that was not created using vagrant up command?

查看:83
本文介绍了如何打包未使用vagrant up命令创建的现有VM?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我安装了VirtualBox,然后在其中安装了Ubuntu 12.10 Server Base OS.我已经在其中安装了各种php软件包和其他软件包.我的朋友建议我使用Vagrant,这样我就可以轻松地与队友共享设置.

I installed a VirtualBox and then installed a Ubuntu 12.10 Server Base OS in it. I have installed all kinds of php packages and other packages in it. My friends recommended me to use Vagrant so I can share my setup with my team mates easily.

因为我当前的VirtualBox VM不是使用vagrant up创建的,所以我不确定如何打包它. Vagrant上的文档讨论了包装,但首先说了:

Because my current VirtualBox VM was not created using vagrant up, I am not sure how to package it. The documentation over at Vagrant talks about packaging but starts by saying:

在完成本页面的其余部分之前,请确保虚拟 通过运行无家可归者来建立环境.

Before working through the rest of this page, make sure the virtual environment is built by running vagrant up.

就我而言,我的现有VM最初不是使用流浪汉创建的.

In my case, my existing VM was NOT created initially using vagrant up.

如何打包现有的VM?

推荐答案

要意识到的重要一点(流浪文档对此不太清楚)是包装有两种味道":

The important thing to realize (and the vagrant docs are not overly clear on that) is that there are two "flavors" of packaging:

  1. 入门"中的包装指南指的是假设您是从一个无业游民的基本框开始的,并使用vagrant up对其进行了初始化,而您还没有.这样,您就可以打包对无业游民的基本框所做的任何自定义.
  2. 如果从头开始或从普通" VirtualBox VM开始,则需要创建无用的基本框.您应该遵循基于Ubuntu的指南.
  1. The packaging guide in "getting started" you are referring to assumes you have started from a vagrant base box and initialized it with vagrant up, which you have not. This allows you to package any customizations you have made to a vagrant base box.
  2. If you start from scratch or from a "plain" VirtualBox VM, as you do, you need to create a vagrant base box. You should be fine following the guide, which is based on Ubuntu.

有一个详细的创建指南使用Oracle Enterprise Linux从零开始的无聊的盒子,这可能会有所帮助.您也可以尝试 VeeWee .

There's a detailed guide for creating vagrant boxes from scratch using Oracle Enterprise Linux, which might be helpful. You could also try VeeWee.

或者,您可以从 Ubuntu 12.10基本框开始并移植您的自定义设置,在这种情况下,您可以使用更简单的第一种包装方式.

Alternatively, you could start with a Ubuntu 12.10 base box and port your customizations, in which case you could use the simpler first way of packaging.

以上指的是流浪者1.0.在1.1版中情况有所变化,特别是文档已被重写:

The above refers to Vagrant 1.0. Things have changed slightly in 1.1 and in particular the docs have been rewritten:

  1. vagrant package 命令允许您打包任何自定义内容您已经以与1.0中相同的方式制作了一个现有的无业游民的基本框.
  2. 使用VirtualBox创建基本框的文档已在1.1中删除,但是文档建议该过程保持不变,但现在增加了一个metadata.json文件是必需的,因为Vagrant 1.1支持
  1. The vagrant package command allows you to package any customizations you have made to an existing vagrant base box in the same way as in 1.0.
  2. The documentation for creating base boxes with VirtualBox has been removed in 1.1, but the docs suggest the process has stayed the same, but now an additional metadata.json file is required as Vagrant 1.1 supports multiple providers.

这篇关于如何打包未使用vagrant up命令创建的现有VM?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆