Homestead ip different from configuration file - laravel-5

I'm trying to install Laravel+Vagrant+Homestead on my Ubuntu 14.04. My /etc/hosts have this line:
192.168.10.10 homestead.app
and my .homestead/Homestead.yaml have
ip: "192.168.10.10"
...
folders:
- map: ~/blog
to: /home/vagrant/blog
sites:
- map: homestead.app
to: /home/vagrant/blog/public
That's because I have made a test with "laravel new blog" before, so I'm trying to use this as a test.
But when I put "homestead.app" in my browser, it says:
The following error was encountered while trying to retrieve the URL: http://homestead.app/
Connection to 127.0.53.53 failed.
The system returned: (111) Connection refused
Where is this address "127.0.53.53" coming from?
Also, when I issued the command
vagrant box add laravel/homestead
and received
==> box: Adding box 'laravel/homestead' (v0.2.7) for provider: virtualbox
box: Downloading: https://atlas.hashicorp.com/laravel/boxes/homestead/versions/0.2.7/providers/virtualbox.box
==> box: Successfully added box 'laravel/homestead' (v0.2.7) for 'virtualbox'!
there shouldn't exist a "laravel/homestead" visible when I open virtualbox?

You don't own homestead.app so don't use it as a URL.
That IP is telling is ICANN informing you of a name collision.

Related

Laravel/Homestead Invalid IP Address

I am using Laravel 6.2, Vagrant 2.2.6 and VirtualBox 5.2. Followed the tutorial for Homestead setup. But when I visited myapp.local (out of the box without modifying any code), I got the following error message:
NotFoundHttpException in RouteCollection.php line 161
(Please see my comment below explaining why I was getting this error)
Mistakenly, I modified the ip address in my Homestead.yaml file and now, no matter what I do, I am getting the following error message.
Network settings specified in your Vagrantfile define an invalid
IP address. Please review the error message below and update your
Vagrantfile network settings:
Address: 192.168.10:10
Netmask:
Error: invalid address
Example:
machine1234:Homestead my_user_name$ vagrant destroy
homestead: Are you sure you want to destroy the 'homestead' VM? [y/N] y
==> homestead: Destroying VM and associated drives...
machine1234:Homestead my_user_name$ vagrant up --provision
Bringing machine 'homestead' up with 'virtualbox' provider...
==> homestead: Importing base box 'laravel/homestead'...
==> homestead: Matching MAC address for NAT networking...
==> homestead: Checking if box 'laravel/homestead' version '9.2.0' is up to date...
==> homestead: Setting the name of the VM: homestead
==> homestead: Clearing any previously set network interfaces...
Network settings specified in your Vagrantfile define an invalid
IP address. Please review the error message below and update your
Vagrantfile network settings:
Address: 192.168.10:10
Netmask:
Error: invalid address
Homestead.yaml looks like this:
> --- ip: "192.168.10:10" memory: 2048 cpus: 2 provider: virtualbox
>
> authorize: ~/.ssh/id_rsa.pub
>
> keys:
> - ~/.ssh/id_rsa
>
> folders:
> - map: ~/Sites/myapp
> to: /home/vagrant/myapp
>
>
> sites:
> - map: myapp.local
> to: /home/vagrant/myapp/public
> databases:
> - MY_APP_DEV
>
> features:
> - mariadb: false
> - ohmyzsh: false
> - webdriver: false "Homestead.yaml" 41L, 667C
Any idea on how I can fix this issue?
Your IP address has a colon!
Change:
Address: 192.168.10:10
To:
Address: 192.168.10.10

Laravel project wont serve to given ip via Homestead

I am having trouble setting up my laravel project on my mac. I have (As far as I can tell) set up the homestead.yaml config correctly within my Homestead directory:
---
ip: "192.168.10.10"
memory: 2048
cpus: 2
provider: virtualbox
authorize: ~/.ssh/id_rsa.pub
keys:
- ~/.ssh/id_rsa
folders:
- map: ~/Documents/GitHub/project-darwin
to: /home/vagrant/code
sites:
- map: homestead.test
to: /home/vagrant/code/public
php: "7.2"
databases:
- homestead
After I have used vagrant up, on using vagrant ssh I can see my project inside of vagrant/code/project-darwin.
My hosts file is as follows:
##
# Host Database
#
# localhost is used to configure the loopback interface
# when the system is booting. Do not change this entry.
##
127.0.0.1 localhost
255.255.255.255 broadcasthost
::1 localhost
192.168.10.10 homestead.test
Which looks correct as is no different to what I normally do when running other laravel projects on virtualbox, however on going to my url, I get a 500 error and the same applies if I go directly to the ip (198.168.10.10).
A further thing I find suspicious is the following. When I use vagrant up, this is part of what shows in my terminal:
homestead-7: Waiting for machine to boot. This may take a few minutes...
homestead-7: SSH address: 127.0.0.1:2222
homestead-7: SSH username: vagrant
Should this ip be the same as the ip I supplied? Anyway, I have run out of ideas as to how to go about fixing this, any suggestions?
So it turns out my mac had auto selected . hyperv as my provider when I ran vagrant box add laravel/homestead, oh well..
In your Homestead.yaml config file you are doing the following:
Making a shared folder mapping project-darwin to /home/vagrant/code
folders:
- map: ~/Documents/GitHub/project-darwin
to: /home/vagrant/code
But under sites you are mapping the folder /home/vagrant/code/public to homestead.test, meaning when you are requesting homestead.test or the IP of your Vagrant Box, you are not calling upon project-darwin but rather the "empty" public folder.
sites:
- map: homestead.test
to: /home/vagrant/code/public
I would recommend either moving your code to the public folder or mapping sites to your desired destination.
Hope this helps :)

Homestead / Vagrant not provisioning or serving additional sites

I'm attempting to run multiple sites in my Homestead box, wordpress.dev and responsible.dev. However, upon navigating to http://responsible.dev it displays the content from wordpress.dev.
I've set up the sites in my Homestead.yaml and hosts file, and ran various attempts of:
vagrant provision
vagrant provision <vm_id>
vagrant reload --provision
vagrant destroy followed by vagrant up
vagrant ssh followed by serve responsible.dev /home/vagrant/Code/responsible
but nothing seems to be working.
The output of vagrant up / vagrant provision shows it creating the wordpress.dev site, but not provision.dev
but I'm not sure what I am doing wrong for it to be skipping over.
My Homestead.yaml file:
---
ip: "192.168.10.10"
memory: 2048
cpus: 1
provider: virtualbox
authorize: ~/.ssh/id_rsa.pub
keys:
- ~/.ssh/id_rsa
folders:
- map: ~/Projects
to: /home/vagrant/Code
sites:
- map: wordpress.dev
to: /home/vagrant/Code/wordpress
- map: responsible.dev
to: /home/vagrant/Code/responsible
databases:
- homestead
and hosts file:
192.168.10.10 wordpress.dev
192.168.10.10 responsible.dev
I assume it is something basic and obvious that I am over-looking, but I can't for the life of me see it.
Thanks in advance!

How to troubleshoot and enable folder synchronisation in Laravel Homestead?

I have followed instructions (https://laravel.com/docs/5.2/homestead) to set up laravel running in a Vagrant/Homestead box.
In the end, I should be able to the website from virtual machine by accessing homestead.app in browser on my host machine.
I´ve tried accessing in different ways, with and without specifying port 8000:
http://homestead.app - connection timeout
http://192.168.10.10 - connection timeout
http://localhost - connection timeout
http://127.0.0.1 - connection refused
After troubleshooting I have found that files are not synced to the virtual machine.
E:\homestead_local\Laravel\public\ contains index.php which I try to access. It is not synced to the VM.
I can´t find any error logs on server.
Also, on VM home/vagrant folder was empty after I did everything from instructions. I´m not sure if that was supposed to happen.
Instructions of what I did, keeping them short:
Installed Virtualbox 4.2 and Vagrant 1.8.1
Dowloaded vagrant box:
vagrant box add laravel/homestead
Installed Homestead 0.4.1
git clone https://github.com/laravel/homestead.git Homestead
Initialized homestead:
bash init.sh
Edited homestead.yaml file
Edited hosts file
Hosts file:
192.168.10.10 homestead.app
127.0.0.1 homestead.app
homestead.yaml file:
ip: "192.168.10.10"
memory: 768
cpus: 1
provider: virtualbox
authorize: ~/.ssh/id_rsa.pub
keys:
- ~/.ssh/id_rsa
folders:
- map: E:\HSprojects
to: /home/vagrant/Code
sites:
- map: homestead.app
to: /home/vagrant/Code/Laravel/public
databases:
- homestead
Questions
After running "vagrant up" my CMD shows this:
....
default: Mounting shared folders...
default: /vagrant => E:/Homestead
Why is it showing E:/Homestead and not E:/HSProjects?
Is sharing between folders bidirectional? I can't find a clear answer on this, but I assume they are.

Laravel Homestead shared folder missing

I've got Vagrant and Virtual Box installed. I'm in the process of trying to get Homestead working. My .yaml file looks like
---
ip: "192.168.10.10"
memory: 2048
cpus: 1
authorize: C:/Users/GiggleSquid/.ssh/id_rsa.pub
keys:
- C:/Users/GiggleSquid/.ssh/id_rsa
folders:
- map: D:/Code
to: /home/vagrant/Code
sites:
- map: 8Byte.app
to: /home/vagrant/Code/Projects/8Byte/public
databases:
- homestead
variables:
- key: APP_ENV
value: local
But every time I run vagrant up in Git Bash, it throws an error
GiggleSquid#SQUID-RIG /d/Code/Homestead (master)
$ vagrant up
Bringing machine 'default' up with 'virtualbox' provider...
There are errors in the configuration of this machine. Please fix
the following errors and try again:
vm:
* The host path of the shared folder is missing: ~/Code
Any ideas?
Exactly same answer to error log. You Code folder is missing in your Windows environment. Create a folder name Code placed in D:/
You should check VirtualBox version. VirtualBox5.0 version doesn't work shard folder. it is working on VirtualBox 4.3 version.

Resources