Virtualbox Guest OS - Local Area Network Connection, but Not Internet

I am using VirtualBox on Ubuntu with WindowsXP as a guest OS.

In Ubuntu, I have a PHP / MySQL server running as localhost, and with the VM network installed on the bridges, I can connect to the local host from the VM.

However, I would like to limit the guest VM to be able to continue connecting to localhost, but CANNOT be connected to the Internet.

This is a security thing - I do not want to install firewalls and antivirus scans in a virtual machine in order to keep it safe. It is used as a testing platform and requires a local connection.

Does anyone know how to do this? Iv searched for time, but all I find are articles, etc., which show how to connect a virtual machine to the Internet, exactly the opposite of what I want to do.

+6
virtualization virtualbox
source share
2 answers

Ok, so this is definitely not what I need, but this:

1) The network for the virtual machine is set to "Host only" This creates a new adapter called vboxnet0

2) At the command line 'ifconfig vboxnet0' This should give you a bunch of things, but somewhere there is an IP address. Remember this.

3) Control Panel-> Internet Options-> Connections Tab → LAN Settings

Make sure that both items in the automatic configuration at the top are NOT checked, then click "Use proxy server for your local network"

Enter the imaginary address and click "Advanced"

At the bottom of the next window, in the "Exceptions" panel, enter the address you received from part 2 (ifconfig vboxnet0)

Press all OK buttons to exit.

4) In all browsers, the local Ubuntu host can be reached: http: // [IP from part 2]

Phew! I think it was so. Hope this helps someone else.

M

+2
source share

I will answer it myself just in case anyone else wants to know:

In the Windows Guestbook: Control Panel-> Internet Options

Select the Communication tab

Make sure Auto Detect Settings is turned off.

Click "LAN Settings"

Check "Use proxy server" and add an IP address that does not exist

Click Advanced

Add your localhost IP in the section below: "Do not use a proxy server for ....."

Your browsers should still have access to the local host for testing, but cannot reach the Internet. Since there seems to be no connection Id hope it works both ways (and I'm glad if someone points out if this is not the case)

Greetings M

0
source share

All Articles