I've got a VirtualBox CentOS 7.0 Guest OS on a Windows Ten Host for the purposes of development, and the port forwarding simply isn't working.
I have a NAT'd network adapter (I can't use Bridged Adapters on this network) and to be fair I am much more comfortable with Bridged Adapters. But everything else works swimmingly. Except the ports 4567 and 9292 will not forward, while port 22 and port 80 work fine.
I have
- Added port forwarding on the client for the ports
22,80,4567,9292in VirtualBox on the NAT'd adapter. - disabled the firewalld on
CentOS 7.0completely (and restarted) then ruled that out - all ports work fine on local host i.e. in the vm
localhost:4567is perfect as islocalhost:9292 - switched of
SELINUXon guest (for good measure) - restarted the whole VM on host systematically every time I did a network->portforward alteration
- tried
10.0.2.15:4567/10.0.2.15:9292in a vain attempt to get purchase
all the time I am ssh'd in on port 22 and port 80 works fine
Is this a traffic issue or a firewall issue, is there some sort of network filtering on the VirtualBox interface that's hidden from me?
I'd love some help.
NB: THE CAUSE IS SHOTGUN/RUBY NOT VirtualBox nor Firewalls nor port forwarding
@Matt fixed this... his link in the comments is correct, the fix to this is one of two things: (it's actually
shotgunrunning ruby in development mode that causes it)CAUSE:
set :bind, 'localhost'development mode. (link)SOLUTION:
set :bind, '0.0.0.0'(can also be in the config.ru)Good news is if you're looking to make localhost:4567 work this is your ticket, add the line
set :bind, '0.0.0.0'to your config and you're good to goANNOYINGLY IF YOU RUN SHOTGUN THIS ISN'T GOING TO BE PICKED UP
Bad news is if you're looking to make localhost:9292 work shotgun does it's own thing here:
shotgunwon't LOOK at those ruby configs, it'll adopt it's own boot strategy, so you have to MAKE shotgun run in--host=0.0.0.0mode: EG:# shotgun --server=thin --port=9292 --host=0.0.0.0 config.ru