I have a host system running Fedora 15 and I have a guest system running CentOS 5.5 in VirtualBox.

I did set up a virtualmin install and added port forwarding to the virtual machine. When I forward port 80 on the guest to port 8080 on the host I can access localhost:8080 and it serves me the page. However if I forward port 80 on the guest to port 80 on the host I can not access it.

Since I want to access the sites on the VM from the web and do not want to add a port number when accessing those (by a domain or subdomain that points to my ip) I assume I need to use port 80 here.

I read that people do forward port 80 to the host, so I assume this should be possible.

Output from nmap for host (Fedora):

Nmap scan report for localhost (
Host is up (0.000078s latency).
Not shown: 992 closed ports
22/tcp    open  ssh
25/tcp    open  smtp
111/tcp   open  rpcbind
631/tcp   open  ipp
2121/tcp  open  ccproxy-ftp
2222/tcp  open  EtherNet/IP-1
11111/tcp open  vce
Device type: general purpose
Running: Linux 2.6.X
OS details: Linux 2.6.19 - 2.6.36

So port 80 is not taken by the host, which might be a good sign, local processes don't intervene or is it a bad sign, should the port be open in order to function to server data from the guest?

I am using the P-2601HN-F1 router which works correctly (managed to show the output from the web with a local apache server)

In the network Tab of the VM it says: Attached to: NAT. And for the port forwarding I have defined forwards of which:

80 / 80 tcp
2121 / 21 tcp
2222 / 22 tcp
11111 / 10000 tcp

Not that when I change 80 / 80 tcp to 8080 / 80 tcp then I can access it from http://localhost:8080/.

What am I doing wrong / how can achieve this (access on port 80)?

  • Generally if you're serving something like web content from a VM, you would use Bridged Networking (it would make your setup easier to configure because you can just forward the port in your router to the guest VM ip). I see your VM is setup with NAT type networking, can you confirm this? – David Chen Aug 14 '11 at 18:05
  • @Bearocalypse: It's set up with NAT type networking. NAT type networking worked when I assigned 8080 to be used so I suppose it could work with port 80. Also I doubted if bridged was a good idea since I use multiple virtual machines quite often, it will probably complicate things. – Roderik Aug 14 '11 at 18:46
  • 1
    I noticed the problem is the restriction of port numbers under 1024, which are not supported. I now made it a bridged set up. I think the virtual machine gets a local IP address dynamically assigned now; how do I ensure that this keeps the same (because otherwise I need to change the forwarding in the router each time it changes). @Bearocalypse – Roderik Aug 15 '11 at 15:56

Your Answer

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

Browse other questions tagged or ask your own question.