How to disable internet access inside a VM

I'm using VirtualBox as my provider.

I want the box to be completely isolated from external internet access.

For some reason whenever I set private\_network:

\`config.vm.network "private\_network", type: "dhcp"\`

It still has the NAT adapter and therefore has internet.

I need it to fail pinging to external networks (say Google), not simply to have an additional adapter.

2 thoughts on “How to disable internet access inside a VM”

  1. The only way I can think of doing this is to setup a rule on your computers firewall to prevent the VMs traffic from leaving your computer. It would still be able to ping the host machine but nothing outside. I’ve never done it before but I’m sure there is a way.

    Reply

Leave a Comment