The Vagrantfile file in the virtual machine directory is a vagrant configuration file, and if you want to use the virtual machine as a server, you can access it via IP, and you need to modify the configuration file to configure it. This machine is using vagrant under Windows, in the process of configuration encountered problems, recording the resolution process.
Open the Vagrantfile file in the virtual machine directory and specify a private_network, as follows:
# Create a private network, which allows host-only access to the machine
# using a specific IP.
Config.vm.network "Private_network", IP: "192.168.10.31"
This specifies that the access IP for this virtual machine is 162.168.10.31.
Then in the terminal input: Vagrant reload command, restart the virtual machine, load the new configuration, but after the reboot to access this IP address, unable to access.
Open the Control Panel network and discover that multiple virtual network adapters are started:
I have the name VirtualBox host-only network with a numbered NIC to disable, and then reboot the first network card, again access to 192.168.10.31 or inaccessible. Right-click the first network adapter property and find that the address of the IPv4 configuration is not set to 192.168.10.31, but is otherwise, manually changed to the configuration file specified.
Access the server that 192.168.10.31 successfully accessed to the virtual machine again. You can also add a host locally, bound domain name access.
Another important configuration item for the Vagrantfile file is:
Config.vm.synced_folder "D:/xampp/htdocs", "/usr/share/nginx/html"
It represents a directory where Windows local directories are mapped to virtual machines.
So when you visit 192.168.10.31, you are accessing the directory on Windwos, which is the Web root directory.