Accessing services running in guest from another host?

This is for discussing general topics about how to use VirtualBox.
Post Reply
karthick87
Posts: 9
Joined: 15. Mar 2017, 08:55
Primary OS: MS Windows 10
VBox Version: OSE other
Guest OSses: Linux
Location: India

Accessing services running in guest from another host?

Post by karthick87 »

Just wanted to know, whether it is possible to access a service (i.e httpd) running inside a guest operating system (i.e Linux (Centos/Red Hat)) from another Host?

To give you more detail, here is a small hint about my setup:-

- My Host System Runs Windows 10 (i.e lets consider as Host-A as an example which is connected to official network).
- I use the following version of VirtualBox in the Host, with the same version of Extension Pack too.
VirtualBox Graphical User Interface
Version 5.1.18 r114002 (Qt5.6.2)
Copyright © 2017 Oracle Corporation and/or its affiliates. All rights reserved.
- Guests run different flavour of operating systems (mostly linux platforms i.e fedora, Red Hat, Centos, Ubuntu). And each of these Guest systems runs specific services (mostly i.e httpd).
- All the Guest systems has only one Network Adapter which is attached to 'Nat Network' and from the Host-A, I used to access these services by enabling port-forwarding and it works fine without any issues.

But now i wanted to access these Guests from some other Hosts (i.e Host-B, or Host-C which is also connected to the same official network). Is this possible? If yes, someone give me some steps on how we can achieve this? Thanks in advance.
Just because something doesn’t do what you planned it to do doesn’t mean it’s useless.
BillG
Volunteer
Posts: 5102
Joined: 19. Sep 2009, 04:44
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Windows 10,7 and earlier
Location: Sydney, Australia

Re: Accessing services running in guest from another host?

Post by BillG »

The best way to do it is to set it up as you would with a physical network of physical machines. Put the vms in their own virtual network and set up a virtual router between that and the physical network. I would put all of the vms in the same internal network and set up a routing appliance like pfSense to connect that network to your physical network. You can configure it so that you can route directly between the two networks or you can configure it as a NAT router and use port forwarding to reach the devices behind NAT. I would use normal IP routing so that any of the vms is accessible from any machine on your network (including the host machine).

The router has two NICs, one in the internal network and on set to bridged mode so that it has access to the physical network.
Bill
Post Reply