Download VirtualBox with Vagrant

VirtualBox: download.virtualbox.org/virtualbox/…

The Vagrant: releases.hashicorp.com/vagrant/2.2…

If CPU virtualization is not enabled on the PC, enable it first

Once you have downloaded Vagrant, open the CMD window

Type Vagrant to see if the installation was successful

Type vagrant init centos/7 to initialize the Vagrantfile created in the user directory on drive C

Type Vagrant Up to download the image and start it

Enter vagrant SSH connection

Of course, the above is the steps in the video, my words were a little unexpected, I made a mistake in executing Vagrant Up, and then automatically shut down the service, which took a long time for Baidu to accept, but did not solve the problem. Later, I simply went to the official websites of the two products to download the latest versions of VirtualBox and Vagrant. Vagrant Plugin install prompts you with incomplete plugin name, and it starts normally

Once connected, the Linux interface can use whoami to view the current user ls/view the root directory exit

Next time just type the following command

vagrant up

vagrant ssh

 

Port forwarding: Port configuration is required for each software installed on Linux. The port of the software on Linux is mapped to a certain port on the local host

To avoid port forwarding, you need to modify the following configuration

Virtualbox IP: 192.168.56.1

Open Vagrantfile in the user directory of drive C and uncomment it and change the first three digits of the following to be the same as the first three digits of virtualBox above

After the modification, ping each other and find that the network is connected