Oracle Virtual Box through VPN

Questions about Wi-Fi and other network devices, file sharing, firewalls, connection sharing etc
Forum rules
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Locked
Teremok

Oracle Virtual Box through VPN

Post by Teremok »

Hi!
I have host OS Linux Mint 18.3. Also i have an Oracle Virtual Box with some guest OS. Is it really to connect Virtual Machine to internet through VPN, and other traffic in host OS leave unencrypted. I am interested precisely in those variant: VPN + VM, but not VM + VPN. Please, help me with this question!
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 1 time in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
User avatar
xenopeek
Level 25
Level 25
Posts: 29588
Joined: Wed Jul 06, 2011 3:58 am

Re: Oracle Virtual Box through VPN

Post by xenopeek »

What do you mean with: "VPN + VM, but not VM + VPN"

You can just setup a VPN in your guest OS. I think the above means you don't find that good enough. Why not?

Setting up the VPN on the host OS and only using it for one specific VM is a lot more work. Perhaps this: viewtopic.php?t=175765. Mind also how you've set the network configuration in VirtualBox for your VM. Some modes may not work or you may have to do more than in the linked topic. See VirtualBox networking: https://www.virtualbox.org/manual/ch06.html
Image
Teremok

Re: Oracle Virtual Box through VPN

Post by Teremok »

Thank you very much! I thought it will be much more simple.
Ok, i agree that virtual box with VPN will be better. But VPN sometimes disconnected and my ip can be showed or provider can saw on what sites am I. Is it really to let all traffic only through VPN and don't let traffic not through the VPN? I mean if VPN breaks - not let traffic to go through common internet.
User avatar
xenopeek
Level 25
Level 25
Posts: 29588
Joined: Wed Jul 06, 2011 3:58 am

Re: Oracle Virtual Box through VPN

Post by xenopeek »

If you Google "linux drop network when vpn dropped" you'll find plenty of things others have done for this. Two common approaches are to either configure your firewall (on the guest OS) so that it only allows traffic to the VPN and blocks all outgoing traffic to other networks, or to set up a network "kill switch" so when the VPN connection drops your network interface is brought down as well.
Image
Locked

Return to “Networking”