1
What I want:
I want a virtual machine guest running Ubuntu (on VirtualBox) for various web development test servers (running on different ports, e.g. Grunt.js is running on port 9000).
- I want to test web applications running on these servers a) from
within the guest b) from within the host (running Windows 7, btw), c)
from other devices in the same network, connected via WiFi (e.g.,
mobile devices)
- I want to be able to access the Internet from within the guest
I was first running a solution where I had both a NAT and a Host-only adapter configured in VirtualBox, which was fine for accessing the guest from the host and for accessing the Internet from within the guest.
Now that I want other devices to be able to access the virtual machine, this solution doesn't work anymore. I was able to do this years ago with a bridged network adapter, but that doesn't seem to work here.
What I did:
I set up bridged networking as the only network adapter in VirtualBox and left the default settings. When I boot up the guest, the WiFi symbol in the upper right keeps flashing, i.e., the arrows don't show up. After a while it says: "Disconnected - you are now offline".
This is the output of ifconfig
:
eth0 Link encap:Ethernet HWaddr 08:00:27:71:92:9c
inet6 addr: fe80::a00:27ff:fe71:929c/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:233 errors:0 dropped:0 overruns:0 frame:0
TX packets:103 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:16083 (16.0 KB) TX bytes:22280 (22.2 KB)
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:65536 Metric:1
RX packets:32 errors:0 dropped:0 overruns:0 frame:0
TX packets:32 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:2624 (2.6 KB) TX bytes:2624 (2.6 KB)
As you can see, no inet4 address. I thus cannot ping the host from within the guest and vice versa.
I also tried this, i.e. I changed the MAC address and ran
sudo rm -rf /etc/udev/rules.d/70-persistent-net.rules
sudo reboot
Didn't change anything at all.
What else can I do to debug this? I suspect it's a DHCP problem. I can easily get an IP on my host and other machines in the network, but not on the guest.
What version of ubuntu are you using, and have you made changes to services? This has worked for me with no issues for years on with multiple different types of guests (ubuntu8-12,windows) on an osx host over wifi. There is a setting to enter the MAC address of the guest in virtbox settings, is it the same as your host maybe? – fightermagethief – 2014-04-05T23:59:30.467
also, what do the network settings for the guest look like under the virtbox manager? This is where I can choose my wifi device, bridged adapter, mac of guest, etc. – fightermagethief – 2014-04-06T00:06:55.330
What does you syslog in /var/log say for
dhclient:
? Have you tried setting up a static ip configuration? – David – 2014-04-06T14:18:06.307I am sure you would have checked this, but just in case you didn't. did you create the Virtual network adapter on right link. i.e your host is connected to router on wlan and you created the adapter on wlan, if not you will not get the IP. If the above is fine, then we can debug as below