Debian – Access VirtualBox Debian Guest on Windows Host

debianvirtualboxwindows

I am running Oracle VirtualBox with Debian as guest OS on a Windows 7 host. I have installed Apache and specified the following two network adapters in VM:

  1. Bridge
  2. Host-only w/ the same IP set as below.

My interfaces network settings on the Debian VM are:

auto lo
iface lo inet loopback

allow-hotplug eth0
iface eth0 inet dhcp
auto eth1 
    iface eth1 inet static
    address 192.168.1.110
    netmask 255.255.255.0

which all seems to work well enough via ping test between guest and host. However, when I try to browse to my guest instance in a web browser http://192.168.1.110 I keep getting a 404 message. Any help would be appreciated.

Thinking that the ifconfig results my help, I will include those also here:

eth0      Link encap:Ethernet  HWaddr 08:00:27:7a:1a:35  
      inet addr:192.168.1.106  Bcast:192.168.1.255  Mask:255.255.255.0
      inet6 addr: fe80::a00:27ff:fe7a:1a35/64 Scope:Link
      UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
      RX packets:252 errors:0 dropped:0 overruns:0 frame:0
      TX packets:19 errors:0 dropped:0 overruns:0 carrier:0
      collisions:0 txqueuelen:1000 
      RX bytes:25417 (24.8 KiB)  TX bytes:1765 (1.7 KiB)

eth1      Link encap:Ethernet  HWaddr 08:00:27:56:3d:90  
      inet addr:192.168.1.110  Bcast:192.168.1.255  Mask:255.255.255.0
      inet6 addr: fe80::a00:27ff:fe56:3d90/64 Scope:Link
      UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
      RX packets:231 errors:0 dropped:0 overruns:0 frame:0
      TX packets:7 errors:0 dropped:0 overruns:0 carrier:0
      collisions:0 txqueuelen:1000 
      RX bytes:21945 (21.4 KiB)  TX bytes:578 (578.0 B)

lo        Link encap:Local Loopback  
      inet addr:127.0.0.1  Mask:255.0.0.0
      inet6 addr: ::1/128 Scope:Host
      UP LOOPBACK RUNNING  MTU:16436  Metric:1
      RX packets:0 errors:0 dropped:0 overruns:0 frame:0
      TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
      collisions:0 txqueuelen:0 
      RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

Best Answer

Successfully pinging the "powered off" VirtualBox is the give-away: the guest machine needs to be on a different IP sub-network than the host machine belongs to. VirtualBox will handle the routing between the guest network and the host network and provide a proper address and gateway to the guest with a DHCP server seen only by the guest.

You don't explain why you've added the static eth1 interface, but I'm guessing it is so you can reach the guest machine on a known address. Drop the static configuration, see what network the guest is assigned and then you can use that network (often 10.0..) for the provisioning of a static address if you need to afterwards.

The box that you are reaching at 192.168.1.110 is living on the same subnet as the host and may well be a real physical device on your host's network.

Related Question