Question

About Win10 Homestead virtualbox ,Nginx

Hi, I still got failed after trying many times. I was so said . Please help me to check it ! Many Thanks !

Failed to visit all below uri : http://homestead.io:8000 http://homestead.io http://192.168.10.10:8000 http:192.168.10.10 127.0.0.1:8000 127.0.0.1

No any Response from Virtual Host.

Of course I can ping 192.168.10.10 from 192.168.1.25(my address). And also can ping from Virtualhost 192.168.10.10 to 192.168.1.25.

All the steps and configurations are following.

**Windows10 Home
Vagant :       2.15.0
VirtualBox : VirtualBox-5.2.18-124319-Win.ext 64bit
VirtualBox.box:      virtualbox_6.3.0.box
**
**$ vagrant box add laravel/homestead virtualbox_6.3.0.box
$ git clone https://github.com/laravel/homestead.git Homestead
$ cd homestead
$ git checkout v7.18.0
$ vagrant init laravel/homestead
$ vagrant box list**


laravel/homestead (virtualbox, 0)

Administrator@DESKTOP-GKURVF2 MINGW64 ~/homestead ((v7.18.0))
$ vagrant up --provision
Bringing machine 'default' up with 'virtualbox' provider...
==> default: Importing base box 'laravel/homestead'...
==> default: Matching MAC address for NAT networking...
==> default: Setting the name of the VM: Homestead_default_1538398439271_53279
==> default: Clearing any previously set network interfaces...
==> default: Preparing network interfaces based on configuration...
    default: Adapter 1: nat
    default: Adapter 2: hostonly
==> default: Forwarding ports...
    default: 22 (guest) => 2222 (host) (adapter 1)
==> default: Booting VM...
==> default: Waiting for machine to boot. This may take a few minutes...
    default: SSH address: 127.0.0.1:2222
    default: SSH username: vagrant
    default: SSH auth method: private key
    default:
    default: Vagrant insecure key detected. Vagrant will automatically replace
    default: this with a newly generated keypair for better security.
    default:
    default: Inserting generated public key within guest...
    default: Removing insecure key from the guest if it's present...
    default: Key inserted! Disconnecting and reconnecting using new SSH key...
==> default: Machine booted and ready!
==> default: Checking for guest additions in VM...
==> default: Configuring and enabling network interfaces...
==> default: Mounting shared folders...
    default: /vagrant => C:/Users/Administrator/Homestead

**$ vagrant global-status**
id       name    provider   state   directory
------------------------------------------------------------------------
8ea2592  default virtualbox running C:/Users/Administrator/Homestead


**$ vagrant ssh**


Welcome to Ubuntu 18.04.1 LTS (GNU/Linux 4.15.0-32-generic x86_64)

 * Documentation:  https://help.ubuntu.com
 * Management:     https://landscape.canonical.com
 * Support:        https://ubuntu.com/advantage

  System information as of Mon Oct  1 12:57:14 UTC 2018

  System load:  0.22              Processes:           127
  Usage of /:   9.5% of 61.80GB   Users logged in:     0
  Memory usage: 40%               IP address for eth0: 10.0.2.15
  Swap usage:   0%                IP address for eth1: 192.168.10.10


0 packages can be updated.
0 updates are security updates.


**vagrant@vagrant:~$ php -v
**PHP 7.2.9-1+ubuntu18.04.1+deb.sury.org+1 (cli) (built: Aug 19 2018 07:16:54) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.2.0, Copyright (c) 1998-2018 Zend Technologies
    with Zend OPcache v7.2.9-1+ubuntu18.04.1+deb.sury.org+1, Copyright (c) 1999-2018, by Zend Technologies
    with blackfire v1.22.0~linux-x64-non_zts72, https://blackfire.io, by Blackfire

**vagrant@vagrant:~$ mysql -u homestead -p
**Enter password:
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 4
Server version: 5.7.23-0ubuntu0.18.04.1 (Ubuntu)

Copyright (c) 2000, 2018, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> show databases;
+--------------------+
| Database           |
+--------------------+
| information_schema |
| homestead          |
| mysql              |
| performance_schema |
| sys                |
+--------------------+
5 rows in set (0.00 sec)

<^>vagrant@vagrant:~$ nginx
nginx: [alert] could not open error log file: open() "/var/log/nginx/error.log" failed (13: Permission denied)
2018/10/01 13:23:14 [warn] 2608#2608: the "user" directive makes sense only if the master process runs with super-user privileges, ignored in /etc/nginx/nginx.conf:1
2018/10/01 13:23:14 [emerg] 2608#2608: open() "/var/log/nginx/access.log" failed (13: Permission denied)
<^>

vagrant@vagrant:~$ sudo passwd root
Enter new UNIX password:
Retype new UNIX password:
passwd: password updated successfully
vagrant@vagrant:~$ su
Password:
root@vagrant:/home/vagrant# nginx
root@vagrant:/home/vagrant# nginx -t
nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
nginx: configuration file /etc/nginx/nginx.conf test is successful

**Homestead.yaml:**
______________________________________________________
ip: "192.168.10.10"
memory: 2048
cpus: 1
provider: virtualbox

authorize: ~/.ssh/id_rsa.pub

keys:
    - ~/.ssh/id_rsa

folders:
    - map: D:/WWW/Laravel
      to: /home/vagrant/code

sites:
    - map: homestead.io
      to: /home/vagrant/code/public

databases:
    - homestead


**Vagrantfile:**
_________________________________________
 # Every Vagrant development environment requires a box. You can search for
  # boxes at https://vagrantcloud.com/search.
  config.vm.box = "laravel/homestead"

  # 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.10"


**hosts**
_____________________________________
192.168.10.10 homestead.io
127.0.0.1 homestead.io

VirtualBox Configration:
_____________________________
IPv4 address: 192.168.10.10
mask:  255.255.255.0

Link: NAT

Please help me ! thank a lot !


Submit an answer


This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Bobby Iliev
Site Moderator
Site Moderator badge
May 11, 2023

Hi there,

Based on your descriptions, it seems like you have set up everything correctly. Here are a few things you can try:

  1. Check Nginx Configuration: Connect to your homestead machine using vagrant ssh and check the Nginx configuration. The site configurations are typically stored under /etc/nginx/sites-available. You should see a configuration file for your site. Make sure the root directive points to your application’s public directory and the server_name directive includes your site’s domain.

  2. Restart Nginx: After verifying the Nginx configuration, try restarting the Nginx service with sudo service nginx restart.

  3. Check /etc/hosts file on your host machine: You need to map your Homestead site domain to the Homestead IP address in your host machine’s hosts file. On Windows, this file is typically located at C:\Windows\System32\drivers\etc\hosts. You should add a line like this:

    192.168.10.10  homestead.io
    

    Make sure you save the file as an administrator to allow changes to take effect.

  4. Firewall settings: Ensure that your firewall isn’t blocking the connection. Try temporarily disabling it to check if that’s the problem.

  5. Try accessing the site from within the Homestead box: SSH into the box using vagrant ssh and then use a text-based browser such as lynx or curl to try to access your site. For example, curl http://localhost or curl http://homestead.io.

  6. Check Nginx error logs: The error logs might contain useful information about why the site can’t be accessed. They’re typically located in /var/log/nginx/.

Remember that any changes to the Homestead.yaml file require you to reprovision the Vagrant box with vagrant reload --provision.

If all these steps don’t resolve your issue, it might be worth trying to destroy the Vagrant box with vagrant destroy and recreating it with vagrant up. Make sure to backup any important data in your Vagrant box before destroying it.

What I personally do is to use the 1-Click Laravel installation image from the Marketplace:

https://marketplace.digitalocean.com/apps/laravel

And then use the Visual Studio Code remote development extension and use the Droplet as a remote staging environment:

Remote Development in Visual Studio Code

That way I don’t have to install anything on my laptop and the setup process is very straight forward compared to running multiple machines locally.

Best,

Bobby

Try DigitalOcean for free

Click below to sign up and get $200 of credit to try our products over 60 days!

Sign up

Featured on Community

Get our biweekly newsletter

Sign up for Infrastructure as a Newsletter.

Hollie's Hub for Good

Working on improving health and education, reducing inequality, and spurring economic growth? We'd like to help.

Become a contributor

Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.

Welcome to the developer cloud

DigitalOcean makes it simple to launch in the cloud and scale up as you grow — whether you're running one virtual machine or ten thousand.

Learn more
DigitalOcean Cloud Control Panel