Tag Archives: Vagrant

Vant configures multiple sites, and new sites 404 error [How to Solve]

1.configure the homestead.yaml file
Add folder mapping, domain name directory mapping (note the layer mapped to the entry file)

2. Configure hosts file

3. Reload vagrant (reload the modified configuration file)

vagrant provision&&vagrant reload

#After reloading the configuration, open vagrant
vagrant up && vagrant ssh

4. Restart nginx

service nginx restart

5. Successfully open the newly added site

Vacuum box installation CentOS encountered the pit

Vagrant Box installation Centos encounter pit
The main thing is that there are some pits when installing Centos. Moreover, most of the online tutorials are not complete, so I am writing this blog to help some of the newcomers to the pit of Vagrant Box.
virtualBox>
virtualBox>
virtualBox>
virtualBox>
virtualBox>
virtualBox>
virtualBox>
virtualBox>
virtualBox>
virtualBox>
virtualBox>
virtualBox>
virtualBox> Virtualbox-6.0.18-136238-win
1. CMD below to initialize your virtual environment vagrant init your environment name, which I use when

D:\self\vagrant_workspace>vagrant init  centos7

2. Generally, this process is extremely slow and may not succeed, because it needs to go to the remote factory to download, you can use the University of Science and Technology of China mirror this is faster

D:\self\vagrant_workspace>vagrant init centos7 https://mirrors.ustc.edu.cn/centos-cloud/centos/7/vagrant/x86_64/images/CentOS-7.box

3. Don’t worry about the following errors that may occur in the first and second steps

A `Vagrantfile` has been placed in this directory. You are now
ready to `vagrant up` your first virtual environment! Please read
the comments in the Vagrantfile as well as documentation on
`vagrantup.com` for more information on using Vagrant.
again.

4. Use the following command to view the Vagrant installation list to see if the installation was successful

D:\self\vagrant_workspace>vagrant box list

5. Start the vagrant

D:\self\vagrant_workspace>vagrant up

The following error may occur

An error occurred while downloading the remote file. The error
message, if any, is reproduced below. Please fix this error and try
again.
Couldn't open file D:/self/vagrant_workspace/base

Box = “base”, default is “base”, you need to change the name of your own environment, here I will change it to “config.vm.box =” centos7 “
and then execute the command again

D:\self\vagrant_workspace>vagrant up

The presence of this indicates successful startup

default: SSH username: vagrant
default: SSH auth method: private key

VBoxManage.exe: error: Failed to create the host-only adapter

system type and software version

  • system: Win10 professional edition
  • Vagrant: Vagrant 2.2.4
  • VM VirtualBox: 6.0.12

error message

PS E:\Develop\Vagrant\Ubuntu_ser_18_bmg> vagrant up
Bringing machine 'default' up with 'virtualbox' provider...
==> default: Checking if box 'peru/ubuntu-18.04-server-amd64' version '20191202.01' is up to date...
==> default: Clearing any previously set network interfaces...
There was an error while executing `VBoxManage`, a CLI used by Vagrant
for controlling VirtualBox. The command and stderr is shown below.

Command: ["hostonlyif", "create"]

Stderr: 0%...
Progress state: E_FAIL
VBoxManage.exe: error: Failed to create the host-only adapter
VBoxManage.exe: error: Could not find Host Interface Networking driver! Please reinstall
VBoxManage.exe: error: Details: code E_FAIL (0x80004005), component HostNetworkInterfaceWrap, interface IHostNetworkInterface
VBoxManage.exe: error: Context: "enum RTEXITCODE __cdecl handleCreate(struct HandlerArg *)" at line 94 of file VBoxManageHostonly.cpp

error cause

Could not find Host Interface Networking driver! Please reinstall can’t find the host interface network driver! Please reinstall

then it occurred to me that before I thought the network connection inside the network card too many , in the device management > also removes the VirtualBox virtual network card driver.

because the driver is gone and you cannot create a virtual network card, start the virtual machine with the vagrant up command and throw the above error message.

solution

  1. find XXX \Oracle\VirtualBox\drivers\network\netadp6 directory, file as follows.
  2. right-click VBoxNetAdp6. Inf file, select install


3. Now execute vagrant up and the virtual machine can be started normally!