Laravel homestead and vagrant setup not working - laravel

I followed the original documentation for vagrant and homestead but every site.app:8000 you visit it just keeps loading and nothing happens. Is there an error within this configuration files?
Homestead.yaml
ip: "192.168.10.10"
memory: 2048
cpus: 1
provider: virtualbox
authorize: ~/.ssh/id_rsa.pub
keys:
- ~/.ssh/id_rsa
folders:
- map: ~/Developer/laravel
to: /home/vagrant/laravel
sites:
- map: hello-world.local
to: /home/vagrant/laravel/hello-world/public
databases:
- homestead
hosts
192.168.10.10 hello-world.local
vagrant up log
Bringing machine 'default' up with 'virtualbox' provider...
==> default: Clearing any previously set forwarded ports...
==> 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 (guest) => 8000 (host) (adapter 1)
default: 443 (guest) => 44300 (host) (adapter 1)
default: 3306 (guest) => 33060 (host) (adapter 1)
default: 5432 (guest) => 54320 (host) (adapter 1)
default: 22 (guest) => 2222 (host) (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: Machine booted and ready!
==> default: Checking for guest additions in VM...
default: The guest additions on this VM do not match the installed version of
default: VirtualBox! In most cases this is fine, but in rare cases it can
default: prevent things such as shared folders from working properly. If you see
default: shared folder errors, please make sure the guest additions within the
default: virtual machine match the version of VirtualBox you have installed on
default: your host and reload your VM.
default:
default: Guest Additions Version: 5.0.20
default: VirtualBox Version: 5.1
==> default: Setting hostname...
==> default: Configuring and enabling network interfaces...
==> default: Mounting shared folders...
default: /vagrant => /Users/nikla/Developer/homestead
default: /home/vagrant/laravel => /Users/nikla/Developer/laravel
==> default: Machine already provisioned. Run `vagrant provision` or use the `--provision`
==> default: flag to force provisioning. Provisioners marked to run always will still run.
nmap log
Starting Nmap 7.12 ( https://nmap.org ) at 2016-07-29 22:55 ART
Nmap scan report for 192.168.10.10
Host is up (0.00063s latency).
Not shown: 994 closed ports
PORT STATE SERVICE
22/tcp open ssh
80/tcp open http
443/tcp open https
3306/tcp open mysql
5432/tcp open postgresql
9000/tcp open cslistener
Nmap done: 1 IP address (1 host up) scanned in 13.19 seconds

I have check your "vagrant up" log and I see all things ok. I have compared your log with my machine's log and is similar.
Try to open the IP in the web browser (change the IP with your Vagrant VM IP):
http://192.168.10.10/
Do you have some firewall, antivirus or another software that could disable the communication?
Try to execute a nmap to see wich ports are open. I paste my nmap, from my host machine to my virtual machine, so you can see wich ports are open.
$ nmap 192.168.10.10
Starting Nmap 6.47 ( http://nmap.org ) at 2016-07-30 01:48 Hora de verano romance
Nmap scan report for homestead.app (192.168.10.10)
mass_dns: warning: Unable to determine any DNS servers. Reverse DNS is disabled. Try using --system-dns or specify valid servers with --dns-servers
Host is up (0.0019s latency).
Not shown: 993 closed ports
PORT STATE SERVICE
22/tcp open ssh
80/tcp open http
111/tcp open rpcbind
443/tcp open https
3306/tcp open mysql
5432/tcp open postgresql
9000/tcp open cslistener
MAC Address: 08:00:27:CD:99:8C (Cadmus Computer Systems)
Nmap done: 1 IP address (1 host up) scanned in 21.83 seconds

Check:
The id_rsa.pub and the id_rsa are in this folder.
The /Users/nikla/Developer/laravel folder exists in your host machine.
The /home/vagrant/laravel exists in your Vagrant VM machine. You can check it login in the machine using the command "vagrant ssh".
Try to access to the http://test.app without the 8000 port.
I don't see the database in your Homestead.yaml file. You should have the next text in this file
databases:
- homestead

Related

Vagrant upn "unknown state"

After running vagrant up command, I get this error:
Bringing machine 'default' up with 'virtualbox' provider...
==> default: Importing base box 'bento/ubuntu-16.04-i386'...
==> default: Matching MAC address for NAT networking...
==> default: Checking if box 'bento/ubuntu-16.04-i386' is up to date...
==> default: Setting the name of the VM: vagrant_default_1494490054450_47471
==> default: Clearing any previously set network interfaces...
==> default: Preparing network interfaces based on configuration...
default: Adapter 1: nat
==> default: Forwarding ports...
default: 8000 (guest) => 8000 (host) (adapter 1)
default: 8080 (guest) => 8080 (host) (adapter 1)
default: 5000 (guest) => 5000 (host) (adapter 1)
default: 22 (guest) => 2222 (host) (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
The guest machine entered an invalid state while waiting for it
to boot. Valid states are 'starting, running'. The machine is in the
'unknown' state. Please verify everything is configured
properly and try again.
If the provider you're using has a GUI that comes with it,
it is often helpful to open that and watch the machine, since the
GUI often has more helpful error messages than Vagrant can retrieve.
For example, if you're using VirtualBox, run `vagrant up` while the
VirtualBox GUI is open.
The primary issue for this error is that the provider you're using
is not properly configured. This is very rarely a Vagrant issue.
When I look at the virtualbox GUI everything seems to be fine, it's in running state and I can even log in into linux. Im running it on Windows 10 OS, Vagrant 1.9.4, VirtualBox 5.1.22
Ok, I solved the problem. I did not have virtualization enabled on my laptop.

Vagrant VM does not boot up properly

I am trying to get up my vagrant up, but am having some trouble with it. This is what happens when I do a vagrant up
Bringing machine 'default' up with 'virtualbox' provider...
==> default: Checking if box 'puphpet/centos65-x64' is up to date...
==> default: A newer version of the box 'puphpet/centos65-x64' is available! You currently
==> default: have version '20161004'. The latest is version '20161102'. Run
==> default: `vagrant box update` to update.
==> default: Clearing any previously set forwarded ports...
==> default: Clearing any previously set network interfaces...
==> default: Preparing network interfaces based on configuration...
default: Adapter 1: nat
==> default: Forwarding ports...
default: 8080 (guest) => 9090 (host) (adapter 1)
default: 8443 (guest) => 9443 (host) (adapter 1)
default: 8787 (guest) => 8787 (host) (adapter 1)
default: 3306 (guest) => 3307 (host) (adapter 1)
default: 9990 (guest) => 9990 (host) (adapter 1)
default: 22 (guest) => 2222 (host) (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
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.
When I do a vagrant ssh-config, I get the following
Host default
HostName 127.0.0.1
User vagrant
Port 2222
UserKnownHostsFile /dev/null
StrictHostKeyChecking no
PasswordAuthentication no
IdentityFile "/Users/ritwickgupta/.vagrant.d/insecure_private_key"
IdentitiesOnly yes
LogLevel FATAL
I tried looking what was happening in my VM, and everything looks ok. I can login into my VM without any issue. Does anyone what what's happening here?
I built the box version you are currently using, 20161004, with VirtualBox 5.1.x. This required users to upgrade to that version for boxes to work.
I have since rebuilt the boxes using VirtualBox 5.0.16, 20161102.
Please delete your local box and download the new version.

Vagrant up error /sbin/ifdown eth1 2> /dev/null

on ubuntu16x64 + virtualbox + vagrant
I'm trying add the laravel/homestead box
I get error in
$ Vagrant up
$ vagrant up
Bringing machine 'default' up with 'virtualbox' provider...
==> default: Importing base box 'laravel/homestead'...
==> default: Matching MAC address for NAT networking...
==> default: Checking if box 'laravel/homestead' is up to date...
==> default: Setting the name of the VM: homestead-7
==> 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 (guest) => 8000 (host) (adapter 1)
default: 443 (guest) => 44300 (host) (adapter 1)
default: 3306 (guest) => 33060 (host) (adapter 1)
default: 5432 (guest) => 54320 (host) (adapter 1)
default: 22 (guest) => 2222 (host) (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:
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: Setting hostname...
==> default: Configuring and enabling network interfaces...
The following SSH command responded with a non-zero exit status.
Vagrant assumes that this means the command failed!
/sbin/ifdown eth1 2> /dev/null
Stdout from the command:
Stderr from the command:
the output refers to a problem with the generated keys
I am not familiar with the key generation, so perhaps the problem is there, I report the steps I did to create them, maybe I made some big stupid
$ cd /home/ubiagio/.ssh/
$ ssh-keygen -t rsa -C biagiopas#yahoo.it
Generating public/private rsa key pair.
Enter file in which to save the key (/home/ubiagio/.ssh/id_rsa): biagiopas_sshrsakey
two keys generated
/home/ubiagio/.ssh/
biagiopas_ssh_key
biagiopas_ssh_key.pub
////////////////////////////////////////////
configuration
~/.homestead/Homestead.yaml
ip: "192.168.10.10"
memory: 2048
cpus: 1
provider: virtualbox
#authorize: ~/.ssh/id_rsa.pub
authorize: ~/.ssh/biagiopas_ssh_key.pub
keys:
# - ~/.ssh/id_rsa
- ~/.ssh/biagiopas_sshrsakey
folders:
- map: ~/Code
to: /home/vagrant/Code
sites:
- map: laraveltestblog01.app
to: /var/www/html/laravel/testblog01/public
////////////////////////////////////////////
if the cause is not due to the keys, then may be another problem encountered before
Launching The Vagrant Box
$ cd /home/ubiagio/Homestead/
$ vagrant up
This Vagrant environment has specified that it requires the Vagrant
version to satisfy the following version requirements:
>= 1.8.4
You are running Vagrant 1.8.1, which does not satisfy
these requirements. Please change your Vagrant version or update
the Vagrantfile to allow this Vagrant version. However, be warned
that if the Vagrantfile has specified another version, it probably has
good reason to do so, and changing that may cause the environment to
not function properly.
I tried to upgrade with
$ Sudo apt upgrade
but without success
so I manually changed the Vagrantfile
$ gedit /home/ubiagio/Homestead/Vagrantfile
#Vagrant.require_version '>= 1.8.4'
Vagrant.require_version '>= 1.8.1'
thanks from now for the help

Homestead/Vagrant - no mounted folders

I'm trying to get a Homestead VM setup for my laravel project. I have followed the instructions here exactly. The only difference is the folder I put the Homestead directory in; I simply put it in C:/.
Otherwise I have set up the Vagrant box, cloned and inited Homestead, and set up the homestead.yaml file exactly as instructed. I then start the VM with vagrant ssh. When I use ls to view the folders in the mapped directory - nothing.
This is my homestead.yaml file:
p: "192.168.10.10"
memory: 2048
cpus: 1
provider: virtualbox
authorize: ~/ssh/id_rsa.pub
keys:
- ~/ssh/id_rsa.pub
folders:
- map: c:/laravelprojects
to: /home/vagrant/Code
sites:
- map: app.dev
to: /home/vagrant/Code/username/public
databases:
- homestead
When I run vagrant up, this is the output:
Bringing machine 'default' up with 'virtualbox' provider...
==> default: Importing base box 'laravel/homestead'...
==> default: Matching MAC address for NAT networking...
==> default: Checking if box 'laravel/homestead' is up to date...
==> default: Setting the name of the VM: homestead-7
==> 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 (guest) => 8000 (host) (adapter 1)
default: 443 (guest) => 44300 (host) (adapter 1)
default: 3306 (guest) => 33060 (host) (adapter 1)
default: 5432 (guest) => 54320 (host) (adapter 1)
default: 22 (guest) => 2222 (host) (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: Remote connection disconnect. Retrying...
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: Setting hostname...
==> default: Configuring and enabling network interfaces...
==> default: Mounting shared folders...
default: /vagrant => C:/Homestead
As you can see, the last two lines seem to be mounted the wrong folder, ie the folder the Vagrant machine is being started from. However, checking in Virtualbox shows that both this and the folder specified in the .yaml file are set and mapped.
What gives?
/vagrant is mounted by default from the project where Vagrantfile is.
I am not sure if it can be disable from homestead.yaml file directly, but you can edit the Vagrantfile and add
config.vm.synced_folder ".", "/vagrant", disabled: true
so it will not create a /vagrant directory in the VM and VirtualBox will show only your folder specified from the yaml.

Port forwarding on Vagrant 1.8.1

I have a vagrant installed on Windows7 PC. I have jenkins, puppet other stuff installed on my centos7 vagrant box. When I do vagrant reload
==> default: Attempting graceful shutdown of VM...
==> default: Clearing any previously set forwarded ports...
==> default: Clearing any previously set network interfaces...
==> default: Preparing network interfaces based on configuration...
default: Adapter 1: nat
==> default: Forwarding ports...
default: 8082 (guest) => 8080 (host) (adapter 1)
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: Warning: Remote connection disconnect. Retrying...
==> default: Machine booted and ready!
GuestAdditions 5.0.12 running --- OK.
==> default: Checking for guest additions in VM...
==> default: Mounting shared folders...
default: /vagrant => C:/vagrant/projects/jenkins
default: /vagrant_data => C:/Devops
==> default: Machine already provisioned. Run `vagrant provision` or use the `-
provision`
==> default: flag to force provisioning. Provisioners marked to run always will
still run.
Now when I do curl -v
C:\>curl -v http://127.0.0.1:8082
* Rebuilt URL to: http://127.0.0.1:8082/
* timeout on name lookup is not supported
* Trying 127.0.0.1...
* connect to 127.0.0.1 port 8082 failed: Connection refused
* Failed to connect to 127.0.0.1 port 8082: Connection refused
* Closing connection 0
curl: (7) Failed to connect to 127.0.0.1 port 8082: Connection refused
Needless to say http://127.0.0.1:8082 doesnt fetch anything in the browser wither. What am I missing? BTW my vagrant and virtual box 5 is running on Windows7.
Thanks in advance
R

Resources