Share internet from VirtualBox guest to Mac host

1

I have specific VPN application (.exe) for Windows only. Need to establish connection on VirtualBox Win guest machine and share connection to my Mac host.

picture - overview.jpg

I’m unable to route packets from Mac to Win and to VPN tunnel.

I created Host-only adapter on VirtualBox and assigned 192.168.0.1 on windows side. On Mac side it is vboxnet0 adapter with IP 192.168.0.2. Atapters are connected to each other.

Windows has another adapter which is marked as NAT in VirtualBox with IP 10.0.3.15. It provides internet to Mac machine.

So Windows 10 has 2 adapters one host-only and one NAT adapter provided by VirtualBox.

And Mac has also 2 adapters one Wifi and one vboxnet0 192.168.0.2 connected directly to host-only on win side 192.168.0.1

I would like to re-route traffic for customer network (10.128/9) to first win network adapter (VirtualBox host-only adapter) and then through second windows adapter (NAT adapter) out to VPN tunnel established on Win.

I can access internet from Windows on VirtualBox using NAT adapter. Internet is accessible also from Mac using wifi adapter. I can also establish a client-server VPN tunnel on Win.

So the last network segment which is not working for me is inside Windows - connection between 2 windows adapters. Adapters are “shared” - I marked this - Allow other network users to connect through this computer’s internet connection. I’m not sure if this works and how to test it.

I can ping Windows host-only adapter 192.168.0.1 from Mac. It means I can reach Windows. However, I cannot ping 10.0.3.15 which is second Windows adapter.

Windows firewall is off

Pings:

$ ping 192.168.0.2
PING 192.168.0.2 (192.168.0.2): 56 data bytes
64 bytes from 192.168.0.2: icmp_seq=0 ttl=64 time=0.072 ms
64 bytes from 192.168.0.2: icmp_seq=1 ttl=64 time=0.131 ms

$ ping 192.168.0.1
PING 192.168.0.1 (192.168.0.1): 56 data bytes
64 bytes from 192.168.0.1: icmp_seq=0 ttl=128 time=0.549 ms
64 bytes from 192.168.0.1: icmp_seq=1 ttl=128 time=0.385 ms

$ ping 10.0.3.15
PING 10.0.3.15 (10.0.3.15): 56 data bytes
Request timeout for icmp_seq 0
Request timeout for icmp_seq 1

Mac routes:

Destination        Gateway            Flags        Refs      Use   Netif Expire
default            10.31.3.1          UGSc           90        0     en0       
10/16              link#14            UCSc            0        0 vboxnet      !
10.0.3/24          192.168.0.1        UGSc            0       12 vboxnet       
10.31.3/24         link#5             UCS            12        0     en0      !
10.31.3.1/32       link#5             UCS             2        0     en0      !
10.31.3.1          24:a4:3c:3c:46:1a  UHLWIir         8       31     en0   1200
10.31.3.85         d0:c5:f3:92:bc:8f  UHLWI           0        0     en0    579
10.31.3.104        88:e9:fe:86:30:e0  UHLWI           0        0     en0     68
10.31.3.106        e4:a7:a0:88:2a:66  UHLWIi          1       34     en0   1017
10.31.3.110        f8:38:80:72:16:ae  UHLWI           0        0     en0    313
10.31.3.124        44:6e:e5:c1:6f:86  UHLWI           0        0     en0    939
10.31.3.127        50:a6:7f:a4:41:67  UHLWI           0        0     en0     29
10.31.3.145        5c:9:47:bf:f3:3b   UHLWI           0        0     en0   1194
10.31.3.164/32     link#5             UCS             0        0     en0      !
10.31.3.168        8:11:96:6a:92:14   UHLWI           0      390     en0    532
10.31.3.180        0:28:f8:78:a:b4    UHLWI           0        0     en0      !
10.31.3.186        38:f9:d3:c5:3c:52  UHLWI           0        0     en0    617
10.31.3.194        9c:b6:d0:bb:56:53  UHLWI           0       17     en0    250
10.128/9           192.168.0.1        UGSc            0        4 vboxnet       
127                127.0.0.1          UCS             0        6     lo0       
127.0.0.1          127.0.0.1          UH              2    49395     lo0       
169.254            link#5             UCS             1        0     en0      !
192.168.0          link#14            UCSc            3        0 vboxnet      !
224.0.0/4          link#5             UmCS            1        0     en0      !
224.0.0.251        1:0:5e:0:0:fb      UHmLWI          0        0     en0       
255.255.255.255/32 link#5             UCS             0        0     en0      !

Windows routes with VPN off:

Network Destination        Netmask          Gateway       Interface  Metric
         0.0.0.0          0.0.0.0         10.0.3.2        10.0.3.15     25
        10.0.3.0    255.255.255.0         On-link         10.0.3.15    281
       10.0.3.15  255.255.255.255         On-link         10.0.3.15    281
      10.0.3.255  255.255.255.255         On-link         10.0.3.15    281
       127.0.0.0        255.0.0.0         On-link         127.0.0.1    331
       127.0.0.1  255.255.255.255         On-link         127.0.0.1    331
 127.255.255.255  255.255.255.255         On-link         127.0.0.1    331
     192.168.0.0    255.255.255.0         On-link       192.168.0.1    281
     192.168.0.1  255.255.255.255         On-link       192.168.0.1    281
   192.168.0.255  255.255.255.255         On-link       192.168.0.1    281
       224.0.0.0        240.0.0.0         On-link         127.0.0.1    331
       224.0.0.0        240.0.0.0         On-link       192.168.0.1    281
       224.0.0.0        240.0.0.0         On-link         10.0.3.15    281
 255.255.255.255  255.255.255.255         On-link         127.0.0.1    331
 255.255.255.255  255.255.255.255         On-link       192.168.0.1    281
 255.255.255.255  255.255.255.255         On-link         10.0.3.15    281

Win adpters.jpg

Thanks a lot. Jozef

Jozef Strom

Posted 2019-09-10T13:16:40.767

Reputation: 11

No answers