I am using a Windows 10 laptop connected to the internet via Wifi. On it I run a VirtualBox with Ubuntu 20.04.5.
As I want to connect to the internet AND to the local network I plan to configure two network adaptors as layed out below. I especially want to be able to ping 8.8.8.8
and to ping a device in the local network with the IP address 192.168.200.10
. On the Windows host I can ping the two addresses without any issues.
Adaptor 1 Configuration
VirtualBox Config
- NAT
- Adapter Type: PCnet-FAST III (AM79C973)
- Cable connected is checked
Guest Config
- IPv4: DHCP
- IPv6: Automatic
Adapter 2 Configuration
VirtualBox Config
- Host-Only Adapter
- Adapter Type: PCnet-FAST III (AM79C973)
- Cable connected is checked
- Tools -> Host-only Network:
Guest Config
- IPv4: Manual
- IPv6: Disable
Results
Adapter 2 disabled
When I only have Network Adapter 1 enabled I can ping both addresses from the VM, 8.8.8.8
and the local device under 192.168.200.10
.
Adapter 2 enabled
When I enable the Network Adapter 2, to which I configured a local IP address in the local network, I would expect that I also can ping both IP addresses.
But as it turns out, I only can ping 8.8.8.8
, and not the IP address in the same local network, 192.168.200.10
!
Questions
- I appreciate if a network expert can explain me in detail what is going on, ideally in lame terms, so I can understand.
- Also I would like to know how I can fix this problem, i.e. to configure the VM in such a way that (i) I can ping the outside world (i.e.
8.8.8.8
), (ii) I can ping the device in the local network (i.e.192.168.200.10
) and (iii) to assign a fixed IP address to the VM so the VM can be pinged in the local network setup.
Thanks a lot
Additional information
ipconfig of host machine
Windows IP Configuration
Ethernet adapter Ethernet 5:
Media State . . . . . . . . . . . : Media disconnected
Connection-specific DNS Suffix . :
Ethernet adapter Ethernet 4:
Connection-specific DNS Suffix . :
Link-local IPv6 Address . . . . . : fe80::64a6:b4ee:7b73:aa63%10
IPv4 Address. . . . . . . . . . . : 192.168.200.44
Subnet Mask . . . . . . . . . . . : 255.255.255.0
Default Gateway . . . . . . . . . :
Wireless LAN adapter LAN-Verbindung* 3:
Media State . . . . . . . . . . . : Media disconnected
Connection-specific DNS Suffix . :
Wireless LAN adapter LAN-Verbindung* 4:
Media State . . . . . . . . . . . : Media disconnected
Connection-specific DNS Suffix . :
Ethernet adapter Ethernet:
Connection-specific DNS Suffix . :
Link-local IPv6 Address . . . . . : fe80::978c:ae31:388b:1086%9
IPv4 Address. . . . . . . . . . . : 192.168.200.5
Subnet Mask . . . . . . . . . . . : 255.255.255.0
Default Gateway . . . . . . . . . : 192.168.200.1
Wireless LAN adapter WLAN:
Connection-specific DNS Suffix . :
IPv6 Address. . . . . . . . . . . : 2a01:cb16:9:1946:333a:61e4:9de4:bd4e
Temporary IPv6 Address. . . . . . : 2a01:cb16:9:1946:5fc:6037:3f84:8a32
Link-local IPv6 Address . . . . . : fe80::5c2a:e902:799d:9451%8
IPv4 Address. . . . . . . . . . . : 192.168.249.238
Subnet Mask . . . . . . . . . . . : 255.255.255.0
Default Gateway . . . . . . . . . : fe80::f4d8:35ff:feb4:93c5%8
192.168.249.79
Ethernet adapter Bluetooth-Netzwerkverbindung:
Media State . . . . . . . . . . . : Media disconnected
Connection-specific DNS Suffix . :
Ethernet adapter vEthernet (WSL):
Connection-specific DNS Suffix . :
Link-local IPv6 Address . . . . . : fe80::be63:31b4:cebb:e898%64
IPv4 Address. . . . . . . . . . . : 172.29.64.1
Subnet Mask . . . . . . . . . . . : 255.255.240.0
Default Gateway . . . . . . . . . :