Hi,
I'm trying to understand whether this is a bug or feature of VirtualBox
Here's my config in question. I have a number of Linux Guest VMs running on a Windows 10 Host with single adapters configured with NAT Network running on 10.0.3.x. One of the VMs is configured with 2 adaptors: a Bridged Adapter on adapter #1, and a Nat Network Adaptor on adapter #2 configured to use the same above Nat Network as all other VMs. This Guest VM has a NAT Network IP assigned of 10.0.3.8, and a bridged IP address via its bridged adapter of 192.168.1.35. The IP address of the Windows 10 Host is 192.168.1.101. I typically use WinSCP to ssh into each of my Guest VMs from the Host via a NAT Networking Port Forwarding Rule, such as for example, Host IP 192.168.1.101, Host Port 236 to Guest IP 10.0.3.8, Guest Port 22. This setup works fine.
However for the Guest VM configured with the Bridged Adapter, this doesn't work. WinSCP is only able to reach this Guest VM via its Bridged Adapter address of 192.168.1.135 at port 22. Also, to be thorough, for this specific Guest VM, i have also configured the sshd_config file to listen on both 192.168.1.135 and 10.0.3.8, Port 22. Both Netstat -lntp and UFW status confirms that this is indeed working correctly (see below):
$ sudo netstat -tapn | grep :22
tcp 0 0 10.0.3.8:22 0.0.0.0:* LISTEN 609/sshd
tcp 0 0 192.168.1.135:22 0.0.0.0:* LISTEN 609/sshd -
$ sudo ufw status
Status: active
To Action From
-- ------ ----
Apache ALLOW Anywhere
22/tcp ALLOW Anywhere
443/tcp ALLOW Anywhere
80/tcp ALLOW Anywhere
At this point, I'm at a loss as to why such a setup doesn't work. Is this a feature or limitation of using bridged networking or a bug in VirtualBox?? I am running VirtualBox Version 6.0.16 r135674 (Qt5.6.2).
Thanks all!
Issue with Guest VM with Bridged and NAT Network Adapter
Issue with Guest VM with Bridged and NAT Network Adapter
Last edited by Integrion on 17. Mar 2020, 19:57, edited 1 time in total.
-
BillG
- Volunteer
- Posts: 5106
- Joined: 19. Sep 2009, 04:44
- Primary OS: MS Windows 10
- VBox Version: VirtualBox+Oracle ExtPack
- Guest OSses: Windows 10,7 and earlier
- Location: Sydney, Australia
Re: Issue with Guest VM with Bridged and NAT Network Adapter
Are you sure it only happens on virtual machines? Have you tried it with physical machines?
Bill
Re: Issue with Guest VM with Bridged and NAT Network Adapter
Ah no. Why would one try to see if this also happens with physical machines? To replicate such a setup with physical machines would be a daunting task to say the least.
That said, the question is why would a Guest VM configured with a Nat Network adapter with Port Forwarding not be reachable via the Host's local IP address just because the Guest VM in question also has a Bridged adapter as well?? One would presume that such a VM would be reachable via both the bridged adapter and the nat network adapter if they are both actively listening and not blocked by any internal process, such as a firewall, etc. Something else must be going on, but what? Or is this actually a bug with VirtualBox?
That said, the question is why would a Guest VM configured with a Nat Network adapter with Port Forwarding not be reachable via the Host's local IP address just because the Guest VM in question also has a Bridged adapter as well?? One would presume that such a VM would be reachable via both the bridged adapter and the nat network adapter if they are both actively listening and not blocked by any internal process, such as a firewall, etc. Something else must be going on, but what? Or is this actually a bug with VirtualBox?