Log in to the Homestead virtual machine with the command vagrant ssh to log in to the homestead virtual machine, and the login fails and does not respond
1. Log in to the Homestead virtual machine with the command vagrant ssh to ssh, and the login fails and does not respond. as shown in Figure 1
Lenovo@DESKTOP-QLPK8QM MINGW64 ~/Homestead (v12.1.0)
$ vagrant ssh
Lenovo@DESKTOP-QLPK8QM MINGW64 ~/Homestead (v12.1.0)
2. Use folders to indicate the folder that the machine is mapped to on the Homestead virtual machine. The reason is that the native folder e:/wwwroot specified by map is too large.
folders:
- map: E:/wwwroot
to: /home/vagrant/Code
3. I finally decided to change to a folder of this machine e:/wwwroot/vagrant
folders:
- map: E:/wwwroot/vagrant
to: /home/vagrant/Code
4. Execute the command vagrant provision && vagrant reload on the host means “apply homestead.yaml configuration” and “restart virtual machine”. Log in again, the login is successful. as shown in Figure 2
Lenovo@DESKTOP-QLPK8QM MINGW64 ~/Homestead (v12.1.0)
$ vagrant provision && vagrant reload
==> homestead: VM is not currently running. Please, first bring it up with `vagr
==> homestead: Checking if box 'lc/homestead' version '11.0.0' is up to date...
==> homestead: Clearing any previously set forwarded ports...
==> homestead: Clearing any previously set network interfaces...
==> homestead: Preparing network interfaces based on configuration...
homestead: Adapter 1: nat
homestead: Adapter 2: hostonly
==> homestead: Forwarding ports...
homestead: 80 (guest) => 8000 (host) (adapter 1)
homestead: 443 (guest) => 44300 (host) (adapter 1)
homestead: 3306 (guest) => 33060 (host) (adapter 1)
homestead: 4040 (guest) => 4040 (host) (adapter 1)
homestead: 5432 (guest) => 54320 (host) (adapter 1)
homestead: 8025 (guest) => 8025 (host) (adapter 1)
homestead: 9600 (guest) => 9600 (host) (adapter 1)
homestead: 27017 (guest) => 27017 (host) (adapter 1)
homestead: 22 (guest) => 2222 (host) (adapter 1)
==> homestead: Running 'pre-boot' VM customizations...
==> homestead: Booting VM...
==> homestead: Waiting for machine to boot. This may take a few minutes...
homestead: SSH address: 127.0.0.1:2222
homestead: SSH username: vagrant
homestead: SSH auth method: private key
homestead:
homestead: Vagrant insecure key detected. Vagrant will automatically replace
homestead: this with a newly generated keypair for better security.
homestead:
homestead: Inserting generated public key within guest...
homestead: Removing insecure key from the guest if it's present...
homestead: Key inserted! Disconnecting and reconnecting using new SSH key...
==> homestead: Machine booted and ready!
==> homestead: Checking for guest additions in VM...
==> homestead: Setting hostname...
==> homestead: Configuring and enabling network interfaces...
==> homestead: Mounting shared folders...
homestead: /vagrant => C:/Users/Lenovo/Homestead
homestead: /home/vagrant/Code => E:/wwwroot/vagrant
==> homestead: Detected mount owner ID within mount options. (uid: 1000 guestpat
==> homestead: Detected mount group ID within mount options. (gid: 1000 guestpat
==> homestead: Machine already provisioned. Run `vagrant provision` or use the `
==> homestead: flag to force provisioning. Provisioners marked to run always wil
Lenovo@DESKTOP-QLPK8QM MINGW64 ~/Homestead (v12.1.0)
$ vagrant ssh
Welcome to Ubuntu 20.04.2 LTS (GNU/Linux 5.4.0-65-generic x86_64)
Last login: Sun Feb 28 03:12:16 2021 from 10.0.2.2
vagrant@homestead:~$

