Answer the question
In order to leave comments, you need to log in
Why is the forwarded port not working?
Using Vagrant, I set up a virtual machine with Ubuntu server and PHP.
Port forwarded:
host: '1234'
guest: '1144'
When starting vagrant (vagrant up) it says:
==> default: Preparing network interfaces based on configuration...
default: Adapter 1: nat
default: Adapter 2: hostonly
==> default: Forwarding ports...
default: 22 => 8016 (adapter 1)
default: 1144 => 1234 (adapter 1)
default: 22 => 2222 (adapter 1)
$ php -S 0.0.0.0:1144
PHP 5.5.29-1+deb.sury.org~trusty+3 Development Server started at Thu Dec 24 10:47:34 2015
Listening on http://0.0.0.0:1144
Document root is /home/vagrant
Press Ctrl-C to quit.
Answer the question
In order to leave comments, you need to log in
Found a solution, answering my own question.
1. The network setup in VirtualBox looks like this:
prntscr.com/9i3dld
2. We start the built-in PHP server on the virtual machine only under 0.0.0.0 IP, like this:
3. Open port 8081 on the virtual machine to the outside:
4. On the host machine (Windows) in the browser, specify the external IP address of the virtual machine and the port that we opened to the outside:
192.168.56.101:8081
After such "not tricky" :) manipulations it worked.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question