4

The windows (win7/x64) host uses IP 192.168.56.1 on its "VirtualBox Host-Only Network adapter".
The linux (Debian 8) Virtualbox guest is configured as 'host-only networking'. It uses static IP address 192.168.56.100.
Host and guest can ping each other, and UDP packets sent from the guest with:

$ echo "hello"|netcat -u 192.168.56.1 10067

are detected by Wireshark, listening on the host' VirtualBox interface.
However they do not seem to make it through the network stack, and my simple UDP listener program does not receive the packets:

package test;
import java.io.IOException;
import java.net.DatagramPacket;
import java.net.DatagramSocket;
import java.net.InetAddress;
public class Test {
    public static void main(String[] args) throws IOException {
        DatagramSocket socket = new DatagramSocket(10067, InetAddress.getByAddress(new byte[]{(byte) 192,(byte) 168,56,1}));
        DatagramPacket pkt = new DatagramPacket(new byte[1500], 1500);
        System.out.println("waiting...");
        socket.receive(pkt);
        System.out.println("received "+pkt.getLength());
    }
}

What I have tried so far:

  • make sure the linux iptables are not active
  • disable the windows firewall
  • enable the firewall but add an incoming traffic rule that allows UDP with local port 10067 (domain & private & public, any IP & computer & user & program)
  • bind the socket to "*" rather than "192.168.56.1" (socket=new DatagramSocket(10067))
  • if the packet is sent from windows with ncat -u 192.168.56.1 10067, the program receives it correctly
  • the same test succeed if the packet is sent to another linux guest on the same 'host-only' network

Any suggestions?

Francois
  • 2,005
  • 21
  • 39
  • 1
    Have you tried to execute the same command (or the similar one) on the host (command to send the message to the server), so at least you know if it is your network which has something to do with the problem.. – Serhiy Aug 10 '15 at 12:42
  • @serhiy: yes UDP packets sent from windows with `ncat -u 192.168.56.100 10067` are received by tcpdump on the guest, and packets sent with `ncat -u 192.168.56.1 10067` are received by my program on the host. – Francois Aug 10 '15 at 12:58
  • Just for the sake of test, try to configure the network adapter to NAT, rather than Host-Only option. – Serhiy Aug 11 '15 at 11:25
  • Actually yes UDP was transmitted correctly from guest to host when guest was configured in mode NAT (before i switch to 'host-only'). – Francois Aug 12 '15 at 09:34
  • I realize that there might be some hidden configuration (from the network domain administrators) of the windows network stack. But is it supposed to interfere with the internal virtualbox adapter? – Francois Aug 12 '15 at 09:38
  • I have been reading about the problems people have with some options in VirtualBox network configuration.. But I am far from being an expert in the area.. Cannot really point you out why it is happening :S – Serhiy Aug 12 '15 at 11:43

0 Answers0