Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

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)
share|improve this question
    
404 is 'document not found' error, what are your apache logs saying on your Debian VM? –  Drav Sloan Aug 31 '13 at 21:26
    
Drav. This sounds like a good approach. Can you recommend which log to check? I am assuming it is one in /var/log Thanks. –  geo derek Aug 31 '13 at 21:47
    
Correct, by default Debian logs to /var/log/apache2, and you should find an error.log in there. –  Drav Sloan Aug 31 '13 at 21:55
    
I checked the error.log and the most recent messages in there are regarding PHP and Apache ".. resuming normal operations". I will add my ifconfig results as they may help folks in understanding my configuration. Again any help is appreciated. –  geo derek Sep 1 '13 at 1:10
    
What's the IP address of the address of the Windows host? If it is on the 192.168.1.x network, your ping and browser might not be hitting the VirtualBox. Easy test: power down the VirtualBox and try your ping again. –  msw Sep 1 '13 at 2:44
show 1 more comment

2 Answers

I ended up figuring this out by the following metnod. The IP you are going to give eth1 should be very similar to the IP auto-assigned by VirtualBox to the second adapter that was attached to. To see this IP go to File > Preference > Network > Edit (Host-only Network Details). Here you will see the IP that was auto-assigned to the Host for the second adapter. You will use this IP modifying the last octet to be different e.g. .10 instead of .1

share|improve this answer
add comment

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.

share|improve this answer
    
I set up the static eth1 interface because I was following the instructions at blog.xoundboy.com/?p=586. In these instructions the author is explaining how to make a VM accessible by the windows host even when laptop is “offline”. When I drop the static config, as you suggest, I get just the DHCP issued IP, and this IP does work in a browser on the host machine. This is great but I am now at a loss then how to assign a static IP. –  geo derek Sep 1 '13 at 14:04
    
@geoderek I'm sorry, your question and that article have exceeded my knowledge of Windows networking. It does appear that you'd only need a bridged interface and if I was trying to hack this together, I'd probably grab the IP off the guest machine and add it to %sysdir%/etc/hosts but even if that works, its a kludge. –  msw Sep 1 '13 at 15:47
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.