1

I have some weird issues (or lack of understanding) with my VM Lubuntu 14.04 on a Debian Jessie host using VirtualBox. My host has a static IP on its eth0 which is wired to a Raspberry Pi 2 (also with a static IP). I've done this in order to easily ssh from my Debian to the Raspbian on my Pi.

I've added a bridged network adapter for my VM and connected it to eth0. The VM also has another adapter - NAT (for the internet).

For some reason when I turn my VM the second connection (the one with the NAT) is established without any problem. However the first one (the bridged) keeps trying but all in vain.

Is this failure due to the static IP of the host or is there some trick that I'm missing? I remember having networking issues with Lubuntu a while ago (2-3 years give or take) but I have the feeling this is not it.

Background story: For those of you who are interested I have this setup because of ROS - my RPi2 runs ROS and so does my VM. The ultimate idea is to connect the RPi2 ROS to the master ROS running inside the VM through its host.

If you can point me into the right direction if this setup is even possible when using ROS I'd appreciate it.

EDIT: Using default netmasks, broadcasting address is 192.168.1.255.

  • My host's IP address is 192.168.1.101
  • My RPi2's IP address is 192.168.1.102
  • As for the bridged connection - I have only used the settings inside VirtualBox and selected eth0 as targeted interface.

EDIT2: ifconfig eth0 inside my VM returns:

eth0      Link encap:Ethernet  HWaddr 08:00:27:90:36:12  
          inet6 addr: fe80::a00:27ff:fe90:3612/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:56 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:0 (0.0 B)  TX bytes:10548 (10.5 KB)

Hence it shows an IP address (IPv6 here). Just for reference the output for my NAT:

eth1      Link encap:Ethernet  HWaddr 08:00:27:85:08:29  
          inet addr:10.0.3.15  Bcast:10.0.3.255  Mask:255.255.255.0
          inet6 addr: fe80::a00:27ff:fe85:829/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:130 errors:0 dropped:0 overruns:0 frame:0
          TX packets:180 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:15169 (15.1 KB)  TX bytes:16089 (16.0 KB)

When I ifconfig on my host I can't see any bridges (brctl show returns an empty table) and the only virtual network that is displayed from my host is vboxnet0, which is a Host-only to another VM (here my host has the IP address 192.168.57.101 and my VM has the IP address 192.68.57.102). Here is the output of my host's ifconfig:

// Connection between the host and the RPi2
eth0      Link encap:Ethernet  HWaddr 54:42:49:6d:ee:48  
          inet addr:192.168.1.101  Bcast:192.168.1.255  Mask:255.255.255.0
          inet6 addr: fe80::5642:49ff:fe6d:ee48/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:27858 errors:0 dropped:0 overruns:0 frame:0
          TX packets:25727 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:4374283 (4.1 MiB)  TX bytes:1918584 (1.8 MiB)
          Interrupt:18 

lo        Link encap:Local Loopback  
          inet addr:127.0.0.1  Mask:255.0.0.0
          UP LOOPBACK RUNNING  MTU:65536  Metric:1
          RX packets:5418 errors:0 dropped:0 overruns:0 frame:0
          TX packets:5418 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:1644352 (1.5 MiB)  TX bytes:1644352 (1.5 MiB)

// Host-only connection between the host and another VM
vboxnet0  Link encap:Ethernet  HWaddr 0a:00:27:00:00:00  
          inet addr:192.168.57.101  Bcast:192.168.57.255  Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:389 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:0 (0.0 B)  TX bytes:44325 (43.2 KiB)

// Connection to the router
wlan0     Link encap:Ethernet  HWaddr 78:dd:08:f4:75:6e  
          inet addr:192.168.0.108  Bcast:192.168.0.255  Mask:255.255.255.0
          inet6 addr: fe80::7add:8ff:fef4:756e/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:484410 errors:0 dropped:0 overruns:0 frame:0
          TX packets:251942 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:551719159 (526.1 MiB)  TX bytes:30931129 (29.4 MiB)
5
  • 1
    Host configuration for the interface and bridge, please
    – roaima
    Aug 23 '15 at 0:42
  • 1
    See the edit. Note that I haven't configured any bridging on my host. Aug 23 '15 at 0:51
  • ifconfig eth0 should now show no bound IP address, and should be in PROMISC mode. brctl show should give you a bridge device such as br0 that should have the host IP address (ifconfig br0). The bridge should contain eth0 and something such as vnet0 that corresponds to the guest's eth0. If this the case? You may want to update the question with the output of these commands
    – roaima
    Aug 23 '15 at 7:28
  • Updated my post. In short - no bridges, bridged adapter is now set to promiscuous mode and no other virtual network is displayed on the host except another one (Host-only) to a different VM. Aug 23 '15 at 19:07
  • I forgot to mention that pinging the RPi2 from the VM works. This is however due to the NAT adapter and not the bridged adapter since the second is not working. Aug 23 '15 at 19:15

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.