I used to have my Vagrant running on a Windows machine, SSH listening to port 2222 (host: 2222, guest: 22, by default) and I used to forward port 80 to port 80 (host: 80, guest: 80, so i was able just to type http://localhost/foo/bar instead of http://localhost:8080/foo/bar)

Unfortunately this setup won't work in Ubuntu. It seems not to forward port 80 on the host to the VM.

pascal@Lenovo-2013:~/VM/foobar$ sudo netstat -tapen | grep ":80 "
tcp        0      0      VERBUNDEN   1000       17616       3880/dropbox    
tcp        0      0        TIME_WAIT   0          0           -               
tcp        0      0         VERBUNDEN   1000       133141      8940/firefox    
tcp        0      0           TIME_WAIT   0          0           -               
tcp        0      0        TIME_WAIT   0          0           -               

Do I understand it right, that there is no program using port 80 on my computer? So why isn't it forwarding the port then?

Any idea?


If I understand correctly, you are using Ubuntu as your main distro and trying to use WinXP on a virtual machine so you can use Vagrant the way your used to, or its not available on Ubuntu (not familiar with it).

Sounds to me you forgot to set your networking to Gateway in the Virtual Machine. It's probably currently set to NAT so your Virtual Machine has no networking path Ubuntu.

Edit: Based on comments, it was discovered that the two computers have different ranges. Try with both computers in same ip range.

|improve this answer|||||
  • Hi (: You almost got it. I used to have Win7 as host and Ubuntu as guest, now I switched my host to an Ubuntu and am still using Ubuntu as guest. (The guest Ubuntu has no GUI and is basically a web server, with the same setup as the one in the hosting center). But it could be that exactly what you said could be the problem. How do I set the networking Gateway? Or is there a way to check if it's set yet? – wawa Dec 30 '14 at 10:50
  • Do both machines have an ip address in the same range, like 192.168.1.x or something simular – geoffmcc Dec 30 '14 at 13:24
  • Host is on 192.168.100.x, Guest is on 192.168.101.x (but I could put them on the same if needed) – wawa Dec 30 '14 at 13:52
  • Yeah, I think that may be your problem. – geoffmcc Dec 30 '14 at 20:33
  • Did that solve it for you? – geoffmcc Dec 31 '14 at 20:36

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.