Give a VM access to local network of host, but not internet

Discussions related to using VirtualBox on Windows hosts.
Post Reply
nom
Posts: 1
Joined: 29. Sep 2015, 23:02

Give a VM access to local network of host, but not internet

Post by nom »

I've got a Windows 8.1 VM that I want to use to access a database that's on my local network (192.168.x.x). I don't, however, want to give the VM access to the internet. Currently, it has no network adapter. To access local networks, it needs to bridge the adapter, right? But how can I bridge the adapter without allowing the VM any outside internet access?
BillG
Volunteer
Posts: 5106
Joined: 19. Sep 2009, 04:44
Primary OS: MS Windows 10
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Windows 10,7 and earlier
Location: Sydney, Australia

Re: Give a VM access to local network of host, but not inter

Post by BillG »

I can't think of any way you could do that with a VirtualBox setting.

The usual way to allow a machine access to its own subnet but not to any other networks is to remove its default gateway address.
Bill
scottgus1
Site Moderator
Posts: 20945
Joined: 30. Dec 2009, 20:14
Primary OS: MS Windows 10
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Windows, Linux

Re: Give a VM access to local network of host, but not inter

Post by scottgus1 »

I have blocked internet to a bridged guest by using the Access Restrictions or Parent Controls in the network router to block internet access to the guest's IP address (guest needs a static IP for this).
BillG
Volunteer
Posts: 5106
Joined: 19. Sep 2009, 04:44
Primary OS: MS Windows 10
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Windows 10,7 and earlier
Location: Sydney, Australia

Re: Give a VM access to local network of host, but not inter

Post by BillG »

If you are using manual config to give it a static IP you might as well just leave the gateway address blank.
Bill
scottgus1
Site Moderator
Posts: 20945
Joined: 30. Dec 2009, 20:14
Primary OS: MS Windows 10
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Windows, Linux

Re: Give a VM access to local network of host, but not inter

Post by scottgus1 »

So no gateway for a computer renders the computer unable to get to the internet? I'll have to remember that! Sounds a lot easier than the Access restrictions stuff...
BillG
Volunteer
Posts: 5106
Joined: 19. Sep 2009, 04:44
Primary OS: MS Windows 10
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Windows 10,7 and earlier
Location: Sydney, Australia

Re: Give a VM access to local network of host, but not inter

Post by BillG »

If it doesn't have a gateway address it can't get out of its own subnet.
Bill
Post Reply