0

I currently have to set up a virtual machine to a public IP. I'm using a second Ethernet adapter for that. That adapter is directly connected to the wall socket with the public IP. Here's the thing:

I only have one public IP (and port forwarding isn't possible with that application), so I'd like to use that adapter exclusively for the VirtualBox virtual machine. How can I do that, without having to give the adapter an IP in the host OS?

I've tried setting the connection to "Network bridge" and to that adapter in Virtual Box and in the host OS I just gave the adapter an IP that doesn't exist in that network (since it's directly connected to the wall socket...), but the VM wasn't ping-able like this...

I've also built a network bridge with that second ethernet adapter and the VirtualBox host-only adapter in Windows (host OS), but the VM wouldn't start like that. As far as I can tell from what I've read afterwards, that doesn't make sense anyway, since the host-only adapter is only used for internal networking.

However, in theory, that actually sounded like what I'm looking for: just "connect" the actual, physical adapter to an adapter that VirtualBox can use, to make the VM use the physical adapter like they're physically connected... Can anyone help?

Cheers, Silas

2
  • I wonder if you need a router for what you want to achieve. Bridged networking is probably what you should use, however, I wonder how your ISP would react when there are two devices/MACs from the same port talking to it (no matter if it's DHCP or static), so I think you need a router (and expose whichever machine needs the public IP through DMZ or so)
    – Tom Yan
    Apr 5, 2016 at 15:00
  • By the way, do you need Internet connection for the host? And do you need the host and the guest to be able to communicate with each other?
    – Tom Yan
    Apr 5, 2016 at 15:19

2 Answers 2

0

Update: I've found a solution that seems to work: I'm just using VMware Player now, it can do exaclty what I was looking for.

In the VM settings in VMware, you can specify the virtual network you want to use. There, you should find two adapters, one of which is host-only, the other one NAT. Choose the NAT one. In Windows (network connections system control item), create e network bridge between that VMware adapter and the physical adapter you want to use and everything should work just fine.

Just out of curiosity, does anyone know if that would have been possible with VirtualBox?

Cheers, Silas

0

In VirtualBox, you can select which adapter the VM should use.

The configuration of the networking mode depends on host OS setup as well as any router/DHCP/etc settings, but your setup sounds simple enough. Try "Bridged adapter", then select the physical adapter that has a WAN connection.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .