简体   繁体   English

如何通过Vagrant启动VM

[英]How to start a VM though Vagrant

I have never used Vagrant before. 我以前从未使用过Vagrant。 Now, Im investigating to use it for my project. 现在,我正在研究将其用于我的项目。 Here is my problem so need some help from every one. 这是我的问题,因此需要每个人的帮助。

Currently , I have a CentOS guest that has been installed via Virtual Machine in MAC host. 目前,我有一个通过MAC主机中的虚拟机安装的CentOS来宾。 Im going to install Vagrant into MACbook then I want to use Vagrant command line for control CentOS by terminal. 我打算将Vagrant安装到MACbook中,然后我想使用Vagrant命令行通过终端控制CentOS。 As far as I know, after install Vagrant we have to add a box then start up this box ( Windows, *Unix,...). 据我所知,在安装Vagrant之后,我们必须添加一个框,然后启动该框(Windows,* Unix等)。 So in my case I ALREADY have a CentOS VM , I do NOT want add a box (because I have to install all of package, soft again). 因此,就我而言,我已经拥有一个CentOS VM,我不想添加一个盒子(因为我必须再次安装所有软件包,再安装一次)。 How to integrate the current CentOS with vagrant ? 如何将现有的CentOS与无业游民集成?

Please help me if you know. 如果您知道,请帮助我。 Thank you so much ! 非常感谢 !

How to create a "base box", as it's known in vagrant, is all there in the documentation: http://docs.vagrantup.com/v2/virtualbox/boxes.html 正如在vagrant中所知,如何创建“基本框”已在文档中找到: http//docs.vagrantup.com/v2/virtualbox/boxes.html

Honestly though, if you're new to it all, I would advise that it would be easier to start with vagrant and a fresh CentOS VM, rather than the approach you're trying. 不过,老实说,如果您不熟悉它,我建议您比使用您尝试的方法更容易从无所事事和全新的CentOS VM开始。 eg: 例如:

$ vagrant init chef/centos-7.1
$ vagrant up --provider virtualbox

The installation of packages, software etc can all be defined in the Vagrantfile (see: http://docs.vagrantup.com/v2/provisioning/ ). 软件包,软件等的安装都可以在Vagrantfile中定义(请参阅: http ://docs.vagrantup.com/v2/provisioning/)。

This approach avoids ending up with a snowflake server . 这种方法避免以雪花服务器结尾。

By far, the easiest way to configure and use virtual machines is with PuPHPet . 到目前为止,配置和使用虚拟机的最简单方法是使用PuPHPet Check it out! 看看这个!

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

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