Vagrant Building a virtual machine

Source: Internet
Author: User

Vagrant Configuring the Linux environment basic operation steps

1. Download the box file

http://www.vagrantbox.es/

Demo version is: Centos-6.4-x86_64-v20131103.box

2. Installing vagrant 1.8 and VirtualBox 5.0

3. Add box, switch to box directory, it is recommended not to have Chinese path, to prevent unknown errors

Vagrant Box Add--name (Vagrant-box own name) (Path and box name)

Example:vagrant box Add--name linux_learn./centos-7.0-x86_64.box

When there is no vagrantfile in a 4.vagrant virtual system, it needs to be initialized with Vagrant init + box name (own name)

Example:vagrant Init Linux_learn

5. Modify the Vagrantfile file to enable the function to access the virtual machine

Config.vm.network "Private_network", IP: "192.168.56.10"

Specific IP address needs to be completed according to the actual network segment

Click one of the View property IPs in the unrecognized network

If you do not set the private IP address corresponding Ethernet network segment ip,vagrant up will be an error

So the Config.vm.network "private_network", IP: "192.168.56.10" in the IP into the Ethernet segment, the first three breakpoint fields must be the same

For example: config.vm.network "Private_network", IP: "192.168.56. The last 10 can be arbitrarily modified;

Note: Why set up a private network IP here, because this confidential access to the virtual machine, pay attention to the private network settings, only native access, more secure, but the team

Members cannot access your virtual machine, it is recommended that you take a look at this article about the configuration of the vagrant three networks, and the features

Http://www.tuicool.com/articles/v6ZnUzm

6. Start the virtual machine

Vagrant up

Note: The following commands are to be performed in the Vagrant directory

1. Delete vagrant-box command: Vagrant box remove

2.vagrant Halt shut down the virtual machine

3.vagrant Destroy destroying virtual machines

The 4.vagrant box list lists all the loaded box

Vagrant Building a virtual machine

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.