How do I package an existing VM that was not created using vagrant up command?

前端 未结 9 1830
你的背包
你的背包 2021-01-30 02:29

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 t

9条回答
  •  陌清茗
    陌清茗 (楼主)
    2021-01-30 03:03

    Any VirtualBox can be packaged to Vagrant Base Boxes (basically OVA with a Vagrantfile).

    Problems are: the VM is not build as per the vagrant base boxes, if you are not sharing it on vagrantbox.es then it'll be fine.

    Just install vagrant (via gem or the installer), run the following command in the VM folder to package it to .box

    NOTE: For Vagrant 1.2.x, the recommended install method is using the OS specific package. Ruby Gem is NOT available for 1.2.x.

    vagrant package --base ubuntu --output /path/to/ubuntu.box

    Remember, if you want to share the vagrant base box with others, better to read the docs and follow those rules to make it easier for others.

提交回复
热议问题