Running VMs with VPN on Fedora 38 with KVM

Hello there

Been struggling with this for a while and hopefully someone out there could take me “under their wings”. What i am trying to do is to run a number of VMs on top of Fedora as a base. Security and privacy by isolation. Some VMs accessing the net through TOR, others with VPN and some without any specific need apart from being isolated from the other VMs. Im am using Virtual Machine Manager or/and Boxes that came with fedora 38. I can install and run VMs without any problem, but they all show as being the same IP and when trying to use a VPN it doesnt work. Been looking at, tried to make bridges, followed ChatGPT instructions and more. Nothing ive done so far makes a difference. Im simply not smart enough and need someone clever to:

-Explain me in short terms what is needed to make it work
-Give me a step by step guide.

I would be truly gratful

Thanks in advance

This has nothing to do with smartness, sometimes things change so fast that we can not catch up with everything. Fortunately we do have this forum to talk about :fedora:

1 Like

There are many different reasons for using a VPN with a VM, so it is unlikely that a simple guide is can be created for any but the most basic use cases. It may not be wise to reveal the details of your use case in a public forum. questions tagged VPN has discussions various use cases. Your VPN provider should have forums where configuration issues are discussed (if not, you may want to change providers).

As a general rule for open source software, when you encounter problems with documentation you should first make sure you have the background knowledge assumed by the author and if questions remain ask the author for clarification so the documentation can be improved for everyone.

Note that bridged networking mentioned by @ilikelinux is a good choice for sharing VM services to LAN clients when using a wired connection, but there are more suitable options if you need isolation or your connection is wireless.


Thanks for your reply. Ive gotten one VM to work with wireless and VPN following the @likelinux guide. (Thanks!). But only one. The others dont want to play. Maybe i need a new NIC for each? Would appreciate some guidance in regards to isolation and wireless :slight_smile:

You can start with this:

# Join the libvirt group
sudo usermod -a -G libvirt ${USER}

# Enable virtual networking
sudo systemctl enable virtnetworkd.service
sudo systemctl restart virtnetworkd.service

# List libvirt connection URIs, VMs, and virtual networks
gsettings get org.virt-manager.virt-manager.connections uris
virsh list --all; sudo virsh list --all; sudo virsh net-list --all

The collected info should help us understand your current setup.

1 Like