Hi @Robert-Broley can you post your homestead.yaml and your hosts file?
Laravel Homestead 2.0 Windows 7 Help
Hi,
I have decided to start using Homestead instead of Xammp. I have an issue:
In order to run homestead up I have to be in this folder: C:\Users\Robert\AppData\Roaming\Composer\vendor\bin I then use the command homestead up and it runs then the connection times out.
I have added the ip: "192.168.10.10" sites: - map: homestead.app to my hosts file.
I have visualization enabled in the bios
But I have Xammp still installed, could this be the issue? I wanted to keep it as a backup as I have everything working on it.
I run Homestead alongside xampp with no problems.
Also with current Homestead, there should be no reason to run homestead up from any particular directory.
If that's the case I'd take another look at the installation instructions.
---
ip: "192.168.10.10"
memory: 2048
cpus: 1
provider: virtualbox
authorize: ~/.ssh/id_rsa.pub
keys:
- ~/.ssh/id_rsa
folders:
- map: C:\Projects
to: /home/vagrant/projects/test
sites:
- map: homestead.app
to: /home/vagrant/Projects/Laravel/public
databases:
- homestead
variables:
- key: APP_ENV
value: local
# blackfire:
# - id: foo
# token: bar
# client-id: foo
# client-token: bar
# ports:
# - send: 93000
# to: 9300
# - send: 7777
# to: 777
# protocol: udp
192.168.10.10 homestead.app
I installed it using the cmd with Windows in no particular directory
vagrant box add laravel/homestead - no problem
composer global require "laravel/homestead=~2.0" - no problem
Then when I type homestead - not recognised as an internal or external command, I even tried with Git Bash.
But when I run homestead up from C:\Users\Robert\AppData\Roaming\Composer\vendor\bin - it works??
If someone could explain where I have gone wrong or @sitesense Can you explain your set up please?
Hi Bobby B!
Do you know if you've set the environment path correctly yet? It's a step I missed at first too- give this a go:
- Control Panel
- System
- Advanced system settings (on the left side bar)
- Environment Variables
- Under 'System variables', scroll to Path and select it, then hit Edit
- There should be a whole bunch of variables next to 'Variable value:' At the very end of this string, add:
;C:\Users\Robert\AppData\Roaming\Composer\vendor\bin
(each variable needs to be separated with a semi-colon, so make sure you include the one preceding C:\)
- Keep hitting Okay, then you should be able to open a terminal from anywhere and run "homestead" commands
Not a problem- please report back and let us know if you managed to get it working!
@coderooney I was able to get homestead working. I just keep getting connection time out when running homestead up
Great that Homestead is working!
In your homestead.yaml, your SSH directories are using UNIX shortcuts for your home folder. Since you're using Windows, instead of:
authorize: ~/.ssh/id_rsa.pub
keys:
- ~/.ssh/id_rsa
you'll need to use:
authorize: C:/Users/Robert/.ssh/id_rsa.pub
keys:
- C:/Users/Robert/.ssh/id_rsa
I would also change:
folders:
- map: C:\Projects
to: /home/vagrant/projects/test
sites:
- map: homestead.app
to: /home/vagrant/Projects/Laravel/public
to:
folders:
- map: C:/Projects
to: /home/vagrant/projects
sites:
- map: homestead.app
to: /home/vagrant/projects/test/public
Have you generated an SSH key by the way?
@coderooney I have changes those details in my .yaml file. Yes I have generated my SSH keys.
I now get this error:
$ homestead up
Bringing machine 'default' up with 'virtualbox' provider...
==> default: Checking if box 'laravel/homestead' is up to date...
==> default: Clearing any previously set forwarded ports...
Vagrant cannot forward the specified ports on this VM, since they
would collide with some other application that is already listening
on these ports. The forwarded port to 8000 is already in use
on the host machine.
To fix this, modify your current projects Vagrantfile to use another
port. Example, where '1234' would be replaced by a unique host port:
config.vm.network :forwarded_port, guest: 80, host: 1234
Sometimes, Vagrant will attempt to auto-correct this for you. In this
case, Vagrant was unable to. This is usually because the guest machine
is in a state which doesn't allow modifying port forwarding.
Robert@ROBERT-PC ~
$
Go to your homesteadb.rb file, which is located in:
C:\Users\Robert\AppData\Roaming\Composer\vendor\laravel\homestead\scripts
You should see a section that looks like this:
# Default Port Forwarding
default_ports = {
80 => 8000,
443 => 44300,
3306 => 33060,
5432 => 54320
}
Change 8000 to 8123 or something else ridiculous and save the homestead.rb file. Then close your terminal and run 'homestead up' again. I sure hope you've already added your vagrant box, because it took me eight hours to download haha.
@coderooney I still get connection timeout. I will do a system reboot. I also noticed that the
keys: - C:/Users/Robert/.ssh/id_rsa (C:/) Is red on the .yaml file.
I also changed the port from 8000 to 8123 and it says its in use on the hosting machine
The red isn't anything to worry about- just your IDE doing its best to interpret the text as code. Vagrant will read the .yaml with its own interpreter and see the correct syntax.
I still cant get it to run, ive got a new error - Connection refused I changed the port to 8125 as it said that 8123 would collide with another application. I then run homestead up again after saving my homestad.rb file and get connection refused.
Welcome to Git (version 1.9.4-preview20140929)
$ homestead up
Bringing machine 'default' up with 'virtualbox' provider...
==> default: Checking if box 'laravel/homestead' is up to date...
==> 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: 80 => 8888 (adapter 1)
default: 443 => 44300 (adapter 1)
default: 3306 => 33060 (adapter 1)
default: 5432 => 54320 (adapter 1)
default: 22 => 2222 (adapter 1)
==> default: Running 'pre-boot' VM customizations...
==> 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: Warning: Connection timeout. Retrying...
Timed out while waiting for the machine to boot. This means that
Vagrant was unable to communicate with the guest machine within
the configured ("config.vm.boot_timeout" value) time period.
If you look above, you should be able to see the error(s) that
Vagrant had when attempting to connect to the machine. These errors
are usually good hints as to what may be wrong.
If you're using a custom box, make sure that networking is properly
working and you're able to connect to the machine. It is a common
problem that networking isn't setup properly in these boxes.
Verify that authentication configurations are also setup properly,
as well.
If the box appears to be booting properly, you may want to increase
the timeout ("config.vm.boot_timeout") value.
Any ideas?
Hrm, I can see that when I run 'homestead up', I get 2 extra lines at the start:
Bringing machine 'default' up with 'virtualbox' provider...
==> default: Importing base box 'laravel/homestead'...
==> default: Matching MAC address for NAT networking...
Unfortunately I don't know what significance that has and what difference our setups might have :( I'm guess you have VirtualBox installed and you ran this earlier?:
vagrant box add laravel/homestead
What do you have inside here?:
C:\Users\Robert\.vagrant.d\boxes\laravel-VAGRANTSLASH-homestead
In C:\Users\Robert.vagrant.d\boxes\laravel-VAGRANTSLASH-homestead
I have a folder called 0.2.6 and a file called metadat_url In the folder 0.2.6 is another folder called virtual box and in there are files
box box-disk1 metadata.json Vagrantfile
I was thinking could the path of my ssh keys be wrong?
If I run
vagrant box add laravel/homestead
It starts off by asking which provider I am working with virtual box or vmware_desktop I chose virtual box
Also in the file C:/Projects this is empty, should this contain anything??
If you have those files and box-disk1.vmdk is about 1GB in size, then you've already added the vagrant box, which is good.
Sadly, someone with more insight will have to chime in here. We were able to fix a few problems with setting up your homestead.yaml, environment path and port, but I don't have much experience with time out issues with Homestead.
If you don't get any more advice, you might consider taking the plunge and deleting/uninstalling everything, then starting again from scratch. If you followed the official documentation last time, then give Jeffrey's instructions a try this time: https://laracasts.com/series/laravel-5-fundamentals/episodes/2
If you originally followed that video/some other instructions, they try the official docs on Laravel at: http://laravel.com/docs/5.0/homestead
Sorry I can't be of more help!
Thanks for your help. Its annoying. As they say its suppose to be better, seems like more issues to me. Xammp was a breeze compared it this
Not a problem. Give Laragon a try if you're going to give up on Homestead. It's essentially WAMP for Laravel plus a few extras, though I've never tried it myself and you won't be using nginx.
@coderooney I just unistalled both Virtual Machine and Vagrant, reinstalled it and I am going to try again :)
Well done for trying again :) Make sure you delete any .ssh, .vagrant.d or .VirtualBox folders in your C:\Users\Robert directory and any Homestead or project directories.
By VM do you mean VMware by the way?
@coderooney Virtual Machine. That is an option when I run
vagrant box add laravel/homestead
- virtualbox 2)vmware_desktop
Should I chose 2?
No that's fine, option 1 if you have VirtualBox installed of course. I just wasn't sure if "VM" (before your edit) was short for VMware which definitely would have been a problem haha. Run 'homestead destroy' for what it's worth as well.
It looks like you're setting things up your own way, so I can't tell you what works for you!
If it doesn't work though, you can follow my suggestions and run 'laravel new test' in your Projects folder.
Good news! No failures this time :) But when I run homestead up it , Vagrant detected an insecure key and removed it and replace it and then I tried to go to homestead.app and got the following error: No input file specified.
---
ip: "192.168.10.10"
memory: 2048
cpus: 1
provider: virtualbox
authorize: C:/Users/Robert/.ssh/id_rsa.pub
keys:
- C:/Users/Robert/.ssh/id_rsa
folders:
- map: C:/Code
to: /home/vagrant/Code
sites:
- map: homestead.app
to: /home/vagrant/Code/Laravel/public
databases:
- homestead
variables:
- key: APP_ENV
value: local
@Robert-Broley where did you get "projects" in /home/vagrant/projects from?
Try changing to this:
folders:
- map: C:\Projects
to: /home/vagrant/Code
sites:
- map: homestead.app
to: /home/vagrant/Code/Laravel/public
Homestead by default creates a Code folder in the VM where your apps reside.
Anything you create/add to C:\Projects will get synced to your VM under /home/vagrant/Code
So for example, if you open a command prompt at C:/Projects and then create a Laravel application there CALLED Laravel, it will be 'copied' to /home/vagrant/Code/Laravel - which matches the mapping here /home/vagrant/Code/Laravel/public.
So I have everything working but it says "No input file specified." when I visit homestead.app
I have included my .yaml file.
So basically if I now open cmd prompt and go to my C:\Code ( which is empty) and install a local version of Laravel in a folder called Laravel then it should work?
Have you created your Laravel app in C:\Code ?
Also I notice that you messed up your Hometead.yml with C:/Code instead of C:\Code - note the backslash.
@sitesense It's just the directory he wanted to work from. I don't think there's anything wrong with working from a 'Projects' folder VS a 'Code' folder, as long as you map everything correctly.
- So basically if I now open cmd prompt and go to my C:\Code ( which is empty) and install a local version of Laravel in a folder called Laravel then it should work?
Yes that should work but be sure to change that path in the yaml file.
Please or to participate in this conversation.