Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I'm using virtualbox to run an Ubuntu server from os x. I have NAT and bridged connections set up and I am able to ping back and forth, ssh into the guest box, transfer files with scp, etc. However, when I start the Django development server I'm unable to view this from the host.

$ - manage.py runserver 0.0.0.0:8000

When viewing 192.168.56.1:8000 the page is unable to load.

Here is the ip details for the guest machine, obtained from host:

vboxnet0: flags=8943<UP,BROADCAST,RUNNING,PROMISC,SIMPLEX,MULTICAST> mtu 1500
ether 0a:00:27:00:00:00 
inet 192.168.56.1 netmask 0xffffff00 broadcast 192.168.56.255

Within the Ubuntu server I get the following, the first is for the NAT adapter the second is the bridged connection:

eth0      Link encap:Ethernet  HWaddr 08:00:27:1f:cd:51  
          inet addr:10.0.2.15  Bcast:10.0.2.255  Mask:255.255.255.0
          inet6 addr: fe80::a00:27ff:fe1f:cd51/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:1955 errors:0 dropped:0 overruns:0 frame:0
          TX packets:1080 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:173919 (173.9 KB)  TX bytes:159672 (159.6 KB)

eth1      Link encap:Ethernet  HWaddr 08:00:27:cf:e8:7f  
          inet addr:192.168.56.1  Bcast:192.168.56.255  Mask:255.255.255.0
          inet6 addr: fe80::a00:27ff:fecf:e87f/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:22205 errors:0 dropped:0 overruns:0 frame:0
          TX packets:6 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:1867168 (1.8 MB)  TX bytes:468 (468.0 B)

EDIT: If I browse to http://192.168.56.1 without the port set, it shows my hosts localhost. So presumably the problem is to do with the host not being able to distinguish between itself and the guest?

share|improve this question
    
Can you connect to django from the server ? –  Iain Apr 2 '11 at 17:13
    
Yes, if I curl http://0.0.0.0:8000 I get the standard welcome screen. –  rlayte Apr 2 '11 at 17:19
    
@rlayte: What about to 192.168.56.1 ? –  Iain Apr 2 '11 at 17:21
    
Yep, same output. –  rlayte Apr 2 '11 at 17:22
    
Is Django on the ubuntu server ? What happens when you browse to the ip address of the ubuntu server:8000 ? –  Iain Apr 2 '11 at 18:50
show 3 more comments

1 Answer

I have CentOS guess on MacOS hos and on my machine 192.168.56.1 IS the host, my guest is 192.168.56.101. So seems to me you WERE talking to the host not guest.

If you try to connect to the guest at 192.168.56.101 and fail - is the guest's firewall in the way? (/bin/service iptables stop I think)

share|improve this answer
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.