Adding port forwarding on an existing vagrant box -
my running vagrant box (ubuntu, on os x mavericks host) has been running fine.
i trying set pgadmin host, , having trouble opening new port sql traffic.
i added line vagrantfile (the last one):
config.vm.network "forwarded_port", guest: 3000, host: 8080 # http config.vm.network :forwarded_port, guest: 35729, host: 35729 config.vm.network "forwarded_port", guest: 5432, host: 7001 # postgres
i ran vagrant provision , bounced vagrant box several times. when reboots new port forwarding not listed:
==> default: clearing set forwarded ports... ==> default: clearing set network interfaces... ==> default: preparing network interfaces based on configuration... default: adapter 1: nat default: adapter 2: hostonly ==> default: forwarding ports... default: 3000 => 8080 (adapter 1) default: 35729 => 35729 (adapter 1) default: 22 => 2222 (adapter 1) ==> default: running 'pre-boot' vm customizations... ==> default: booting vm... ==> default: waiting machine boot. may take 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... ==> default: machine booted , ready!
curl gives negative response also:
➜ ~ curl -v 'http://localhost:7001/' * adding handle: conn: 0x7fde1a004400 * adding handle: send: 0 * adding handle: recv: 0 * curl_addhandletopipeline: length: 1 * - conn 0 (0x7fde1a004400) send_pipe: 1, recv_pipe: 0 * connect() localhost port 7001 (#0) * trying ::1... * trying 127.0.0.1... * trying fe80::1... * failed connect localhost:7001; connection refused * closing connection 0 curl: (7) failed connect localhost:7001; connection refused
related posts:
vagrant port forwarding not working
cannot connect postgres running on vm host machine using md5 method
since 5432<-->7001 port mapping not listed in vagrant sequence, it's not happening.
i try vagrant reload
supposed reload part of vagrantfile again.
if doesn't work, try manually adding port mapping, @ least confirm connection application. accepted answer change vagrant port forwarding on running system explains how in virtualbox ui.
Comments
Post a Comment