I know this isn’t “selfhosting” as most people imagine it, but it is about hosting services on own hardware, hence why I’m posting in this community.

I’m supposed to help a teacher set up a networking exercise where pairs of computers are connected directly on a crossover cable and can access services (echo, HTTP, SSH, FTP) on each other. Every computer is identical: Windows 10 host, one VirtualBox VM running Linux Mint with a bridged adapter in promiscuous mode. Each host and VM has its own static link-local IP address.

The problem is, the VMs can’t talk to each other, and I don’t know why.

From one VM, I can ping itself, its host, and the remote host, but not the remote VM. Each host can ping itself, the local VM, the remote host, but not the remote VM. I’ve tried connecting both hosts to a layer-2 switch, with the same result.

Can someone point me at the one thing that I’m obviously doing wrong?

(edit) I’ve also tried to set the default gateway to the host’s, remote host’s, and remote VM’s address, but nothing changed.


Running Linux on metal isn’t an option. In the past, the classroom computers used to dual boot Windows and Ubuntu, but the Windows install got so bloated (the software too, not just Windows) that it needs the full SSD.

  • SwingingTheLamp@piefed.zip
    link
    fedilink
    English
    arrow-up
    1
    ·
    2 hours ago

    That looks like it should work. Just a couple of thoughts: The default gateway is irrelevant. That’s only where the OS sends packets that don’t match the netmask. Since these addresses all lie within the same /24 range, the default gateway will never be used. It wouldn’t hurt to check the ARP tables of each OS to see whether the VM MACs ever show up on the remote host or VM. Are the two hosts connected with a cable, or via WiFi? If the latter, VirtualBox has to do some software trickery to make bridging work, and I can imagine that perhaps some WiFi devices wouldn’t play nice.

  • Onomatopoeia@lemmy.cafe
    link
    fedilink
    English
    arrow-up
    1
    ·
    edit-2
    2 hours ago

    I’ve re-read the docs around VirtualBox bridging, and the only thing that I think could possibly cause this (though it shouldn’t since ping is a direct address to a specific IP/mac) is to enable Promiscuous mode (as cappucino mentioned).

    This shouldn’t fix it in my opinion, but it may, since ICMP could be considered undirected traffic (I don’t, but I didn’t code VirtualBox).

    I’ve sometimes found using trace instead of ping can sometimes work where pings would be blocked, plus trace shows exactly where it dies along the path.

  • diecknet@discuss.tchncs.de
    link
    fedilink
    English
    arrow-up
    4
    ·
    4 hours ago

    You mentioned that you can’t ping the remote VM. Have you checked if the remote VMs IP is reachable? Is it in the ARP table? Check with arp -a

    • rtxn@lemmy.worldOP
      link
      fedilink
      English
      arrow-up
      1
      ·
      edit-2
      4 hours ago

      I checked ip neighbour (it also shows the ARP table, so I assume they’re identical), and it showed REACHABLE and STALE for addresses I could ping, but FAILED for the remote VM’s address. I will check arp -a when I get the chance, though.

  • slazer2au@lemmy.world
    link
    fedilink
    English
    arrow-up
    2
    ·
    3 hours ago

    This is going to sound stupid. Have you checked both the host and VM firewalls are allowing the traffic?

    To assist in troubleshooting you can install Wireshark to see what traffic is hitting the NIC. If you see the the traffic in Wireshark then the sending is working but the host or VM is not receiving.

  • fizzle@quokk.au
    link
    fedilink
    English
    arrow-up
    1
    ·
    3 hours ago

    I’m certainly not an expert on such things but I just didn’t think bridged networks in virtual box (or docker) were intended to work that way.

    The behaviour you’re seeing is exactly what i would have expected.

    In docker I think the solution would be to use the “host” network adapter on the guest VM.

    • rtxn@lemmy.worldOP
      link
      fedilink
      English
      arrow-up
      1
      ·
      4 hours ago

      I’ll give it a try tomorrow, thanks.

      Although I’d still prefer to know why the VMs won’t talk over simple Ethernet.

  • zewm@lemmy.world
    link
    fedilink
    English
    arrow-up
    1
    arrow-down
    1
    ·
    3 hours ago

    10.0.0.1 is usually the gateway IP. Have you checked that there are no IP collisions happening?