My project is based on the Linux environment, so the first step is to set up the Linux environment.
1 | $ vagrant init centos/7 |
Start the Virtual Machine: Execute the following command to start the virtual machine:
1 | $ vagrant up |
Connect to the Virtual Machine: Once the virtual machine is running, use SSH to connect to it:
1 | $ vagrant ssh |
Installation process is missed.
To set a fixed gateway for a Vagrant virtual machine, you can modify the network configuration in the Vagrantfile
.
The default file location is under C:\Users\your_username
, or under the directory where you install vagrant.
find the line config.vm.network "private_network", ip: "192.168.56.10"
and uncomment it.
Use ipconfig/all
to check your virtualbox ip. The description of which is VirtualBox Host-Only Ethernet Adapter
Restart the vagrant
1 | $ vagrant reload |
Connected to vagrant
1 | $ vagrant ssh |
Check its IP
1 | $ ip addr |
Jut check its IP.
Finally, use ping xxx.xxx.xxx
to test the connection.