Establish Intercommunication between CANalyzer/CANoe and a VM Guest by Means of a Virtual Ethernet Link
During the common development cycle of Automotive software POSIX-based operating systems like Linux are broadly used for ECU prototyping or early-staged evaluation of algorithms or functions to be implemented later based on the AUTOSAR (Adaptive) platform.
Often embedded software developers in this domain tend to use their development environment in a virtual machine running a Linux derivate like Debian/Ubuntu because of it exposes interfaces and components similar to those being accessible by the embedded platform itself.
Since most network development tools offered by Vector are based on the Microsoft Windows operating system there is no direct possibility to distribute the rest bus simulation or the analysis/stimulus features of e. g. CANalyzer/CANoe in a way that their communication can be shared between the Linux environment and the Vector tool.
Currently one of the mostly used work-arounds is to use a dedicated interface device like the VN5610 to physically connect (“loop”) one of its channels to another (physical) Ethernet adapter on the host PC. This adapter again is mapped into the guest VM and is used for communication between CANalyzer/CANoe and the Ubuntu OS. This way traffic generated by a specific feature of CANalyzer/CANoe like the Diagnostics Console on the host (Windows) can reach the guest (Ubuntu) and vice-versa.
While this setup provides a working solution, it has the downside that an additional Ethernet channel must be provided physically by means of a Vector device and a Windows Ethernet adapter with interconnection cabling.
Focusing on the aspect that in most cases the embedded software developers’ requirement is only to have parts of CANalyzer/CANoe communicate (Ethernet-wise) with other software components running on the same machine (though not in the same OS) for simulation or testing purposes, this approach appears kind of oversized in consideration of the fact that a pure software-based (virtual) solution would suffice.
By combination of CANalyzer/CANoe’s integrated driver for low-level access to Windows Ethernet adapters (Vector Network Driver) and the fact that these adapters can be virtualized the foresaid goal can be achieved without the need for a physical interconnection between devices used only by the very same PC.
This approach is compatible with any virtualization environment that is used to run the (Linux-based) virtual machine on. Examples of tested virtualization software solutions include VMware Workstation and Microsoft Hyper-V.
The following step-by-step procedure is shown exemplarily for VMware Workstation running on Windows 10 but can be applied using other virtualization software environments in a similar way.
(Windows 10, VMware Workstation)
1. Install Vector Network Driver
- If not already done, install the latest version of Vector Network Driver. The driver is distributed together with CANalyzer/CANoe but must be installed separately after the installation.
- In CANalyzer/CANoe, open up Hardware Config (Ribbon Hardware), highlight an Ethernet channel and check the currently installed version of the driver by selecting a Windows-based Ethernet adapter from the drop-down list.
- The driver’s version should be equal or greater than 2.1.16. If this is not the case (e. g. if you are running a version of CANalyzer/CANoe lower than 12.0 SP3) you can download the most recent version here.
- After extracting the ZIP package execute the MSI file for starting the update or installation process.
2. Install Loopback adapter driver provided by Microsoft
Windows includes a so-called Loopback adapter driver which can be installed to provide a virtual Ethernet adapter. Virtual adapters can be considered as equivalent to physical NICs with the exception that the Ethernet packets they process do not originate from or reach a real network. While the traffic does not leave the PC it can be interchanged with a virtual machine running on it. It is connected to your VM in a later step.
- To install it open Windows search and type hdwwiz followed by the Enter key to bring up the systems Hardware Assistant.
- Click Next and select Manually choose hardware from a list and install.
- Choose Network adapter and Have Disk.
- From Manufacturers select Microsoft and choose Microsoft Loopback Adapter for KM-TESTfrom the Models list:
- Proceed with Next until the installation is complete.
3. Map the Loopback Adapter into your VM (guest)
Using your virtualization environment’s configuration program assign the newly created virtual adapter to a network connection that can be used within the VM and is shared with the host. This operation mode is often referred to as bridged:
After applying this setting the network adapter in your virtual machine guest mapped to the respective connection (“VMnet0” in this case) will represent the bridged counterpart of the Loopback adapter on your host which means that all traffic will be reflected on both sides, the host and the guest.
4. Select the Loopback Adapter as Network Hardware in CANalyzer/CANoe