Assure that the Apache Web Server is available and started on the guest OS:
`sudo httpd start`
Assure that firewall allows the guest OS to handle web requests.
Type ` sudo system-config-firewall` and enable the WWW service.
Configure port forwarding for the VM. Go to the VM settings in the Oracle VM VirtualBox Manager / Page ‘Network’.
Click on the button [Port Forwarding] and add an entry such as the following:
Now, on your host OS, you should be able to see the Apache Server test page when opening `http://localhost:8080` in a browser.
Since every system is configured differently there might be some problems you encounter. If you don’t see the test page, you could try the following:
- Disable SELinux by opening the file ` /etc/selinux/config` and setting the configuration to ` SELINUX=disabled` (see a more detailed guide here)
- This tutorial assumes that you use the default NAT network adapter for you VM. If you use a ‘host-only’ or ‘bridged’ connection, the process will be a bit different.
Stackoverflow – How to SSH to a VirtualBox guest externally through a host? Very helpful, also read the comments
CentOS Board – Basic firewall config (just port 80 and ssh 22)