Any ideas why I can't get my VPN client working in a VirtualBox VM?

First of all, I've used this exact VPN client on 2 Windows machines and a Linux machine before, always working excellently. Now I'm unfortunately on a Windows machine, and I've installed Ubuntu in a VirtualBox VM in order to have a Linux environment to work in.

I'm using the Shrew Soft VPN client to connect to a Cisco Home Office VPN server.

The problem

As soon as I connect to the VPN using the client, DNS stops working. I can still ping IP addresses (e.g. 8.8.8.8) but packets still take the same route as without the VPN client running (checked using traceroute). All DNS lookups time out and fail. I am unable to ping any IP addresses in the network I'm connecting to.

My suspicion is that VirtualBox's "Guest Additions" are interfering with the VPN software in some way.
I've uninstalled VirtualBox Guest Additions and it made no difference :(

Any ideas?


Here is the ifconfig output before connecting:

enp0s3    Link encap:Ethernet  HWaddr 08:00:27:c0:28:c3  
          inet addr:192.168.1.128  Bcast:192.168.1.255  Mask:255.255.255.0
          inet6 addr: fe80::a00:27ff:fec0:28c3/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:1887173 errors:0 dropped:1 overruns:0 frame:0
          TX packets:810435 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:1823228735 (1.8 GB)  TX bytes:188693611 (188.6 MB)

lo        Link encap:Local Loopback  
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:65536  Metric:1
          RX packets:210862 errors:0 dropped:0 overruns:0 frame:0
          TX packets:210862 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:19176186 (19.1 MB)  TX bytes:19176186 (19.1 MB)

And here it is after connecting:

enp0s3    Link encap:Ethernet  HWaddr 08:00:27:c0:28:c3  
          inet addr:192.168.1.128  Bcast:192.168.1.255  Mask:255.255.255.0
          inet6 addr: fe80::a00:27ff:fec0:28c3/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:1906855 errors:0 dropped:2 overruns:0 frame:0
          TX packets:817511 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:1826304725 (1.8 GB)  TX bytes:191434042 (191.4 MB)

lo        Link encap:Local Loopback  
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:65536  Metric:1
          RX packets:211373 errors:0 dropped:0 overruns:0 frame:0
          TX packets:211373 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:19227460 (19.2 MB)  TX bytes:19227460 (19.2 MB)

tap0      Link encap:Ethernet  HWaddr 32:37:c2:69:d6:9d  
          inet addr:172.21.100.19  Bcast:172.21.100.255  Mask:255.255.255.0
          inet6 addr: fe80::3037:c2ff:fe69:d69d/64 Scope:Link
          UP BROADCAST RUNNING  MTU:1380  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:500 
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

These messages appear in the syslog when connecting:

Mar 23 21:35:39 beast-vm-ubuntu NetworkManager[842]: <info>  (tap0): link connected
Mar 23 21:35:39 beast-vm-ubuntu systemd-udevd[13615]: Could not generate persistent MAC address for tap0: No such file or directory
Mar 23 21:35:39 beast-vm-ubuntu NetworkManager[842]: <info>  (tap0): new Tun device (carrier: ON, driver: 'tun', ifindex: 9)
Mar 23 21:35:39 beast-vm-ubuntu NetworkManager[842]: <info>  devices added (path: /sys/devices/virtual/net/tap0, iface: tap0)
Mar 23 21:35:39 beast-vm-ubuntu NetworkManager[842]: <info>  device added (path: /sys/devices/virtual/net/tap0, iface: tap0): no ifupdown configuration found.
Mar 23 21:35:39 beast-vm-ubuntu NetworkManager[842]: <info>  keyfile: add connection in-memory (ae12e1f9-cec0-4e2d-82cf-63736cc610db,"tap0")
Mar 23 21:35:39 beast-vm-ubuntu NetworkManager[842]: <info>  (tap0): device state change: unmanaged -> unavailable (reason 'connection-assumed') [10 20 41]
Mar 23 21:35:39 beast-vm-ubuntu NetworkManager[842]: <info>  (tap0): device state change: unavailable -> disconnected (reason 'connection-assumed') [20 30 41]
Mar 23 21:35:39 beast-vm-ubuntu NetworkManager[842]: <info>  Device 'tap0' has no connection; scheduling activate_check in 0 seconds.
Mar 23 21:35:39 beast-vm-ubuntu NetworkManager[842]: <info>  (tap0): Activation: starting connection 'tap0' (ae12e1f9-cec0-4e2d-82cf-63736cc610db)
Mar 23 21:35:39 beast-vm-ubuntu NetworkManager[842]: <info>  (tap0): device state change: disconnected -> prepare (reason 'none') [30 40 0]
Mar 23 21:35:39 beast-vm-ubuntu NetworkManager[842]: <info>  (tap0): device state change: prepare -> config (reason 'none') [40 50 0]
Mar 23 21:35:39 beast-vm-ubuntu NetworkManager[842]: <info>  (tap0): device state change: config -> ip-config (reason 'none') [50 70 0]
Mar 23 21:35:39 beast-vm-ubuntu NetworkManager[842]: <info>  (tap0): device state change: ip-config -> ip-check (reason 'none') [70 80 0]
Mar 23 21:35:39 beast-vm-ubuntu NetworkManager[842]: <info>  (tap0): device state change: ip-check -> secondaries (reason 'none') [80 90 0]
Mar 23 21:35:39 beast-vm-ubuntu NetworkManager[842]: <info>  (tap0): device state change: secondaries -> activated (reason 'none') [90 100 0]
Mar 23 21:35:39 beast-vm-ubuntu NetworkManager[842]: <info>  (tap0): Activation: successful, device activated.
Mar 23 21:35:39 beast-vm-ubuntu nm-dispatcher: Dispatching action 'up' for tap0

My routes before connecting to the VPN (I haven't modified them in any way):

Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
default         router.asus.com 0.0.0.0         UG    100    0        0 enp0s3
link-local      *               255.255.0.0     U     1000   0        0 enp0s3
192.168.1.0     *               255.255.255.0   U     100    0        0 enp0s3

And after:

Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
default         192.168.1.1     0.0.0.0         UG    100    0        0 enp0s3
default         172.21.100.19   0.0.0.0         UG    950    0        0 tap0
77.88.79.74     192.168.1.1     255.255.255.255 UGH   0      0        0 enp0s3
link-local      *               255.255.0.0     U     1000   0        0 enp0s3
172.21.100.0    *               255.255.255.0   U     0      0        0 tap0
192.168.1.0     *               255.255.255.0   U     100    0        0 enp0s3

once you connect to vpn on your system you need to create a default gateway route.

windows doesn't know how to direct traffic on its own, you can only prioritize interface or set it with highest priority (lowest value).

Try deleting that first default route, the one for 192.168.1.1. I'd say it's overriding the default gateway configured by your VPN client.