[Solved] How to prevent Internet access but allow local access?

Discussions about using Linux guests in VirtualBox.
Post Reply
Paddy Landau
Posts: 43
Joined: 22. Jul 2012, 16:47
Primary OS: Ubuntu other
VBox Version: PUEL
Guest OSses: Ubuntu, Windows, other Linux

[Solved] How to prevent Internet access but allow local access?

Post by Paddy Landau »

I have an Ubuntu 14.04 server guest, running on an Ubuntu 16.04 host.

(I have a specific package that won't run on an updated system, which is why I need Ubuntu 14.04 on the server.)

At the moment, the guest has full Internet access. But, for security, I would like the guest server to be able to serve web pages to the host client, but to disallow access to the broader Internet.

So:
  • Host can access the Internet
  • Host can access the guest
  • Guest cannot access the Internet (it doesn't matter whether or not the guest can access the LAN)
Is there an easy way to set this up, or would it be complicated?
Last edited by Paddy Landau on 23. Dec 2016, 14:27, edited 1 time in total.
socratis
Site Moderator
Posts: 27329
Joined: 22. Oct 2010, 11:03
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: Win(*>98), Linux*, OSX>10.5
Location: Greece

Re: How to prevent Internet access but allow local access?

Post by socratis »

VM Settings » Network » Adapter 1 » Attached to: Host-only Adapter.
Your guest will communicate with your host ONLY. More information, as always, in the User Manual: Ch. 6.2. Introduction to networking modes.
Do NOT send me Personal Messages (PMs) for troubleshooting, they are simply deleted.
Do NOT reply with the "QUOTE" button, please use the "POST REPLY", at the bottom of the form.
If you obfuscate any information requested, I will obfuscate my response. These are virtual UUIDs, not real ones.
Paddy Landau
Posts: 43
Joined: 22. Jul 2012, 16:47
Primary OS: Ubuntu other
VBox Version: PUEL
Guest OSses: Ubuntu, Windows, other Linux

Re: How to prevent Internet access but allow local access?

Post by Paddy Landau »

socratis wrote:VM Settings » Network » Adapter 1 » Attached to: Host-only Adapter.
… More information, as always, in the User Manual: Ch. 6.2. Introduction to networking modes.
Thank you. Although I had found the manual page, for whatever reason I missed the bit about creating a host-only network in the Preferences. I also discovered that I had to change the /etc/hosts file.

It works now. Thank you for the advice!
Post Reply