Teach you how to quickly use vagrant to build your own virtual machine?

1. Download vagrant:
open Baidu input/:vagrant
Insert picture description here
Insert picture description here
2. Select windows, click download
Insert picture description here

Download and install directly, the next step is foolish! After the installation is complete, restart your system.
3. Windows + R, enter cmd, press Enter, enter vagrant on the dos window, press Enter,
Insert picture description here

When the vagrant command prompt appears, it means that our installation is successful!
4. Enter the website and check the name of linux that needs to be installed: https://app.vagrantup.com/boxes/search , as shown in the figure below, find centos/7 (the name is too much" /")
Insert picture description here
5. Then enter vagrant init centos/7 and Insert picture description here
press Enter in our dos command, 6. You can see that he created a vagrantfile folder under our c:\User\lfy file
Insert picture description here
and then enter: vagrant up, Start the virtual environment. It takes a long time, because he needs to download the image from the official, and then start the virtual container according to the image. When the download is complete, the following prompt appears, indicating that the installation is successful!
Insert picture description here
7. Here, vagrant has created it for us ssh is connected and has helped us start the virtual machine (virtualbox or VMware), so at this time, we Ctrl+C, stop the process, enter vagrant ssh,
you can connect to the virtual machine, if you use administrator permissions, switch users Yes!
When we need to use the virtual machine in the future, let the virtual machine start without interface directly, and enter vagrant ssh in the dos window!

Guess you like

Origin blog.csdn.net/lq1759336950/article/details/112135366