clarify "does not work". Is your VM Bridge or NAT?
Some VPN's mess with the DNS settings. When your VM does not work:
1. Can you ping by URL? Like ping yahoo.com
2. Can you ping by IP? Like ping 8.8.8.8
3. If a DNS failure, result of cat /etc/resolv.conf?