Capturing packets on VMware machines - linux

I have a windows PC installed VMware Workstation and Linux run on it. I want When windows communicate with Internet I can capture packets in Linux, how can I do that?
The vmware network is Bridge, and I set eth0 use command "ifconfig eth0 procmisc".
linux IP is 192.168.0.103, windows IP is 192.168.0.102
Run "tcpdump not host 192.168.0.103" with no result.
Thank you for you time and please help me

While I haven't used VMWare workstation before, I have used Oracle VirtualBox in a similar setup as you describe.
I suspect that the problem is that your network adaptor on the Linux VM is not actually accessing the physical network adaptor directly. You will be using one of the network mapping types described in http://kb.vmware.com/selfservice/microsites/search.do?language=en_US&cmd=displayKC&externalId=1006480 instead.
As such, you are not getting all the traffic that is going to your physical network adaptor. Instead you are getting the reduced set of traffic that VMWare is passing on to your guest.
The only way to get that is to do the snoop on your Windows host, using something like https://www.wireshark.org/

Related

vcan0 interface linux communication

Linux is supporting virtual can interface. it was enabled by:
modprobe vcan
sudo ip link add dev vcan0 type vcan
sudo ifconfig vcan0 up
While using cam-utils such as camsniffer and cansend
cansend vcan0 321#1212
cansniffer vcan0
I could able to see can packets; but only within same host. I tried Ubuntu VirtualBox machine. Both guest and host OS are interconnected using host-only adapter vboxnet0.
Also tried SocketCAN socket(PF_CAN, SOCK_RAW, CAN_RAW) but not able to receive on other machine(works within same machine) While trying with broadcast manager socket(PF_CAN, SOCK_DGRAM, CAN_BCM) on executing stderr says `operation not supported
Simply, could one send and receive CAN packets between Linux hosts? Doesn't matter its Virtual Machine (vboxnet0) or physically connected (Ethernet).
Note: I used Ubuntu 16.04 and 12.04 as Host and Guest OS respectively.
CAN uses its own physial bus. The vcan devices are designed for testing software that communicates over the bus without requiring an actual physical connection, they're not actually supplied by the hypervisor, but are a part of SocketCAN.
By the looks of it, you're attempting to establish a Virtual CAN bus in Virtualbox, connecting multiple machines together as though they all had CAN controllers and were connected to a physical bus. I've looked, but it appears that such functionality doesn't exist, and beyond writing an extension for VirtualBox, is probably not likely to.
Is there a specific reason you're looking to use CAN? Trying to pull data from an ECU or communicate with embedded hardware that has a CAN controller? As far as desktop pc communication, ethernet is much more convenient, faster,a nd well supported.

VirtualBox Linux does not return ping and host machine cannot access apache on that guest

I have a Windows7 as host and Debian as guest via VirtualBox. everything worked just fine until I did apt-get update on my guest machine and I think it scrambled some settings (not sure though...).
My current VB network settings are:
Adapter 1: Bridged Adapter
Adapter 2: Host-only adapter
My guest machine works fine, has internet connection and I can access it files via My Computer > Network, yet I cannot ping the guest machine nor access its apache webserver, any ideas?
Glad to hear it dude. :)
1 network adapter usually enough for 'normal' purpose. I use more than 1 network adapter when I want to simulate more complicated computer network plan, like I want to have experiment with proxy, router, dns etc. Just make sure you understand the networking mode that you want to use.
Thanks to #yogipriyo, removed the second adapter and selected only 1 bridged adapter and it works.

Virtual box based development for Embedded Linux

I am new to embedded linux development.I have inherited a particular way of Embedded linux development from the previous developer.
I was just wondering if there is a more industry standard way of working.
This is how he was working,
There is an ARM embedded linux board which is not on the corporate network and has a fixed IP address of 192.168.0.52.I have a virtualbox based linux host which is connected directly to this linux board via an Ethernet cable.This host has an NFS shared with the target for running the cross compiled binaries.I have to set a fixed IP address for the host of 192.168.0.50.Then I can telnet with the target to run the compiled binaries on the NFS folder. Also as the VM host is not connected to the corporate network.I cannot use the company issued SVN for version control.So what I do is have a shared folder via virtual box between Windows and Linux host and I manually keep transferring the files which I have to commit/test.
What I would I ideally like, is both networks connected to the corporate network,so that I can update the OS,use version control.Is there way by which the VM on Windows access the corporate network and also be connected to the target.IT is not willing to give a static IP to the target.If we connect the target via DHCP what is the best way to discover it on the network.Also IT is concerned about the traffic it will generate.Can I use a switch to create a subnetwork,so that the target can have a fixed address?
Another question is they are open to a linux based host as well.Is a VM based linux any worse off than a Linux PC.The only problem I have been having are networking based issues,not really Virtualbox issues.But I am curious to know if there are any limitations at all.
In order to have the VM connected to the corporate network, you can setup the VM network adapter in bridge mode.
In order to discover the embedded device, you can use the arp command (for instance: arm -i eth0 -a).
If you have got two network interfaces you could also connect the remote device directly through this interface and setup a dhcp server in your VM.
Personally, I think that with the VM you can do everything that you need (cross-compiling the Kernel and bootloader and creating the remote File System). I have been using a VM for embedded linux development on a AT91SAM board without problems at all.

How to force vmware to bridge over ethernet and not wlan

I have a Linux Mint host system and a VMware guest system with Linux Debian. On my host system there are two physical network interfaces eth0 and wlan0. My guest system is set up to use its network connection in bridged mode. Whenever my WLAN is turned on it automatically choose this interface to bridge. When I turn off my WLAN it bridges over the ethernet port.
Is it possible to set a default interface for the host system to bridge over? I didn't find anything on the VMware GUI neither on google.
This page should explain how to do it, under the section 'Configuring Bridged Networking Options on a Windows Host'. Don't worry, I had trouble finding it too.
Basically, the settings are available in Edit > Virtual Network Editor.

VMWare Server Under Linux Secondary NIC connection

With VMWare Server running under Linux (Debain), I would like to have the following setup:
1st: NIC being used by many of the
images running under VMWare, as well
as being used by the Linux OS
2nd: NIC being used by only 1 image and to be unused by the Linux OS (as its part of a DMZ)
Although the second NIC won't be used by Linux, it is certainly recognised as a NIC (e.g. eth1).
Is this possible under VMWare Server, and if so, is it as simple as not binding eth1 under Linux and then bridging it to the image under VMWare Server?
I believe you can set the desired solution up by rerunning the vmware configuration script. And doing a custom network setup, so that both NIC's are mapped to your vmware instance. I would recommend making eth0 the 2nd NIC since it will be easier for Linux to use by default. Then make eth1 the 1st NIC.

Resources