Laravel Homestead - nothing running on port 80 - laravel

I've managed to get the Laraval Homestead vagrant VM up and running, and I can ssh into the VM with vagrant ssh, and I can also ping the IP address that is set for the machine which is 192.168.10.10, and it responds fine.
When I do an nmap 192.168.10.10 from WSL, I don't see anything is running on port 80. Shouldn't Homestead have an already running and configured HTTP server running?

Related

Cannot access brew-installed Jenkins in VirtualBox

I installed the Jenkins through brew install jenkins-lts in macOS.
The macOS is running as VirtualBox VM instance on Windows Host.
On VirtualBox host Windows, I cannot access Jenkins through http://localhost:8080 or http://10.0.2.15:8080 from browser. (10.0.2.15 is my guest VM macOS's IP address)
What I've setup
Jenkins-lts service is started. macOS safari can access through http://localhost:8080
VirtualBox port forwarding is set, TCP/HOST: 0.0.0.0:8080 /GUEST: 10.0.2.15:8080
By the same port forwarding setup for SSH HOST: 0.0.0.0:22 /GUEST: 10.0.2.15:22, I can successfully connect to SSH.
By the default config file /usr/local/Cellar/jenkins-lts/2.x.x/homebrew.mxcl.jenkins-lts.plist. brew-installed Jenkins's default listening address is 127.0.0.1 instead of 0.0.0.0. This causes Jenkins's web server only listen request from localhost instead of any network adapter.
Steps
Edit config file, vi /usr/local/Cellar/jenkins-lts/2.x.x/homebrew.mxcl.jenkins-lts.plist
Find the row <string>--httpListenAddress=127.0.0.1</string> and change to <string>--httpListenAddress=0.0.0.0</string>
Restart Jenkins, brew services restart jenkins-lts
References
https://www.jenkins.io/doc/book/installing/, denoted httpListenAddress
https://medium.com/#vishnuteja/install-jenkins-as-a-service-on-macos-and-change-port-number-9aa097e5cfbf, denoted where brew-install Jenkins's config file.

Vagrant - vagrant cannot forward the specified ports on this VM

When i run vagrant up i get the following error:
Vagrant cannot forward the specified ports on this VM, since they
would collide with another VirtualBox virtual machine's forwarded
ports! The forwarded port to 3306 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.forward_port 80, 1234
I checked and i don't have any processes using port 3306 locally.
I also tried vagrant destroy and vagrant up, didn't help.
vagrant suspend followed by vagrant resume didn't help as well.
What else could be the issue?
What's your command to find the port?
Maybe you can see this. Vagrant Port Collision on Port 80, but Port 80 is not Forwarded in the VagrantFile
Turns out there was a process on my machine running on port 3306.
Running lsof -i :3306 didn't show it, only when i used sudo it did.

Cannot access application running on JBOSS EAP 7 outside vagrant box

I am actually trying to access the application outside the vagrant box which is running on JBOSS EAP 7 server on port 8080. I did add the settings for port forwarding in vagrant file that is
config.vm.network :forwarded_port, guest: 3000, host: 8080
Port forwarding does shows in terminal log when i reloaded the vagrant. However when i access the application from browser outside of the vagrant box am getting error as ERR_CONNECTION_REFUSED on the browser. I also binded the address to 0.0.0.0 by running the below command but still no luck. Any suggestions please what i may be missing? I also did set the proxy settings but still no luck.
sudo ./standalone.sh -b 0.0.0.0
Below is the port binded with 0.0.0.0
Below is the log for my vagrant reload
Below is the port forwarding i set in my ubuntu vagrant box
Below is the error on the browser
I found something that could help.
I'm using a RHEL 7.6 and the firewall was on:
$ sudo firewall-cmd --state
running
After disabling:
$ systemctl stop firewalld
$ sudo firewall-cmd --state
not running
I successfully access Jboss console from the outside

How to Ssh into docker container that is running inside Vagrant?

I am running a Vagrant VM under Windows 7 . The Vagrant VM is running a docker container. So the configuration is :
Windows7[Vagrant[Docker]]
I want to ssh from Windows into the Docker container.
The docker container is running sshd and I can successfully ssh from Vagrant VM to Docker container.
sudo docker ps
gives:
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
64b13daab5f2 ubuntu:12.04 "/bin/bash" 14 minutes ago Up 14 minutes 0.0.0.0:49153->22/tcp thirsty_morse
From the Vagrant VM:
ssh root#localhost -p 49153
works just fine. So Vagrant VM's port 49153 is forwarded to Docker container's port 22.
I've added
config.vm.network "forwarded_port", guest:49153, host:49155
to Vagrantfile so that localhost:49155 on Windows is forwarded to Vagrant VM:49153
This is where things break down. When I try to ssh from Windows to localhost:49155, I get:
ssh: connect to host localhost port 49155: Connection refused
So Windows:49155 -> Vagrant:49153 is not working. I thought that it may be a problem related to listening on a port on Vagrant VM's external ip so I've installed rinetd into Vagrant VM and I've done:
bindadress bindport connectaddress connectport
0.0.0.0 49153 127.0.0.1 49153
Still no luck. What am I missing here?
Ok, answering my own question. It works now. I think the most likely reason for the problem was that port 49153/55 and its neighbours is actually used by some windows services by default. I changed to mapping for ports in the Vagrant file to use 9090 for Windows and everything worked. No need to rinetd either. I've also done:
sudo docker run -v /vagrant:/opt/data -p 0.0.0.0:49153:22 -i -t ubuntu:12.04
Notice the 0.0.0.0: it may or may not be relevant but this configuration is working for me.

Empty reply from server - can't connect to vagrant vm w/port forwarding

I'm running werkzeug (as part of a Tilestache setup) inside a Vagrant VM, running ubuntu 'precise.'
In my Vagrantfile, I have:
config.vm.network :forwarded_port, guest: 8080, host: 8080
When I start the server in the VM, I see:
* Running on http://127.0.0.1:8080/
If I curl that address from within the VM, I get the expected result. When I curl it from the host machine, I get:
curl: (52) Empty reply from server
And Chrome says "No data received."
Troubleshooting info:
The server responds to pings from the host machine
a port sniffer verifies that the port is open
running netstat -ntlp | grep 8080 in the vm shows that the server is listening on 8080
My local hostsfile doesn't have any weird conflicts
I'm also forwarding 22 => 2222, and I can ssh in with no trouble
I've disabled the firewall on the host, and i don't believe there's one on the guest (iptables and ufw are disabled, at least)
I've set auto_correct: true in case there are conflicts (there aren't)
I know I could set up a private network, but I'd like to understand why this isn't working and how to troubleshoot it.
Any other ideas?
When running a server from within a VM, start the server on 0.0.0.0 instead of 127.0.0.1.
127.0.0.1 is only accessible to the local machine, which for a VM means nothing outside of the VM can reach it! 0.0.0.0 is accessible from anywhere on the local network, which to a VM includes the host machine.
The answer came from here: Connection Reset when port forwarding with Vagrant
(Which apparently got its answer from here: https://stackoverflow.com/a/5999945/738675)
With help from: https://serverfault.com/questions/78048/whats-the-difference-between-ip-address-0-0-0-0-and-127-0-0-1
Google-bait:
Here are the errors you might receive if this is the problem:
Chrome: "No data received"
Firefox: "The connection was reset - The connection to the server was reset while the page was loading."
Safari: "Safari can’t open the page [URL] because the server unexpectedly dropped the connection"
curl: "Empty reply from server"
In the /etc/hosts inside the VM, change line
127.0.0.1 localhost -> 0.0.0.0 localhost
and then restart server
This can also be a problem with your firewall on the vagrant machine. If you can curl the address while on the vagrant box, then check your firewalld settings or turn it off:
on CENTOS:
sudo service firewalld stop
Then you should update your firewalld settings and restart it ;)

Resources