Select network card in Virtualbox for packet capture [JPCAP]

Asked

Viewed 117 times

0

Good afternoon.

Guys, I’m developing a java application for capturing packages using JPCAP. I am using a virtual machine, but I am not able to select the network interface for my program to capture the network packets. Is there any way to do this using the virtual machine? I tested the code on the local machine and it is working as desired.

In short, it would be the use of JPCAP in Virtualbox.

Thank you.

1 answer

1

In the virtual machine’s network settings, select that it must be connected in bridge mode, so it will have its own ip inside your network.

Virtual Box - Configurações

  • I’ve done it. However I can’t capture any network packets.

  • I was able to solve the problem. The card identifier used by Virtualbox is 0 (zero). Jpcapcaptor captor = Jpcapcaptor.openDevice(interfaces[0], 65535, false, 200);

Browser other questions tagged

You are not signed in. Login or sign up in order to post.