VirtualBox + vagrant

Source: Internet
Author: User

VirtualBox virtual machines don't have to say more

Vagrant is a virtualbox command-line image management tool written by Ruby

1 Install VirtualBox then install vageant Google is harmonious can Baidu this should not die

2 Downloads you need a. vagrantbox file suffix of. Box

(I downloaded the centos7.1 on the /users/jianmingyuan/documents/vagrantvms/centos7.1/vagrant-centos-7.1.box)

2 Open Terminal: VAGRANT-V will see the current vagrant version information

3 Terminal execution: CD to execute Vagrant box add centos7.1 /users/jianmingyuan/documents/vagrantvms/centos7.1/in the directory where you want to place the virtual machine files Vagrant-centos-7.1.box

(where the centos7.1 after add is the name you give to the virtual machine to facilitate later operation is the path of the downloaded image file)

4 vagrant Box list should be able to see the virtual machine you just created

5 vagrant Init centos7.1 After initialization will be generated in the current folder Vagrantfile profile each time the virtual machine is started, the configuration information is read first

Search Config.vm.synced_folder Remove the # symbol in front of this line of code. This configuration is followed by two parameters, the first parameter is the directory on the host, you can use the absolute location, you can use the relative position, if it is relative to the location of the project root, that is, relative to the location of the directory where the file vagrantfile. Two parameters is a comma, the second parameter is the directory on the virtual machine, if you set the directory on the virtual machine does not exist, Vagrant when the virtual machine is started, will automatically create this directory. This will enable you to share the file.

6 vagrant up the virtual machine

7 vagrant SSH Login to the virtual machine for operation

Ps:

# vagrant halt off virtualized development environment

# vagrant Reload After modifying the configuration file, restart the virtualized development environment

# vagrant Box List View the currently available virtualized development environment

# vagrant Box Remove Boxname Delete the specified box environment

# vagrant Package is currently running VirtualBox virtual environment packaged into a reusable box

# vagrant up the virtual machine

# vagrant destroy destroying virtual machines

VirtualBox + vagrant

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.