Operating Systems and Embedded Software · Virtualisation
Virtual MachineVM
Also known as guest, guest OS, domain (Xen)
An isolated, software-defined computer, provided by a hypervisor, that runs its own complete operating system and kernel on shared physical hardware.
Explanation
A virtual machine has virtual CPUs, memory and devices that its guest operating system treats as real hardware. Each VM boots its own kernel, which distinguishes it from a container: a container is a process that shares the host's kernel, so it starts faster and uses fewer resources but is less strongly isolated.
In automotive systems, VMs place operating systems with different requirements on one SoC, for instance an AAOS infotainment guest next to a cluster or ADAS OS. They also run virtual ECUs for software-in-the-loop testing. In KVM, a VM is represented by a file descriptor, and the VM and its resources persist until the last reference to that descriptor is released.
VMs add overhead in memory, boot time and I/O paths. Devices such as GPUs and cameras need careful sharing or pass-through, and real-time guests need dedicated or carefully scheduled CPU resources.
How it works
The hypervisor allocates memory and virtual CPUs to the VM and maps guest-physical addresses to host memory. The guest kernel boots as it would on hardware, and privileged operations trap to the hypervisor. Devices are emulated, passed through or provided as paravirtual VirtIO devices. Virtual CPUs are scheduled like threads on physical cores, and each VM can be started, stopped or restarted independently.
Automotive applications
- Isolating infotainment from cluster software
- Virtual ECUs for software-in-the-loop testing
- Reusing a legacy OS on new hardware
- Sandboxing connectivity stacks
Example
A test team runs production body-controller software in a VM on a server, connected to simulated CAN traffic, so regression tests can run nightly without physical ECUs. Every test run starts from the same saved VM image.
An illustrative example: any figures in it are worked numbers, not measurements.
References
- What is a container? (opens in a new tab)
“Every VM boots its own complete operating system, including its own kernel, the core of the operating system that talks to the hardware.”
- The Definitive KVM (Kernel-based Virtual Machine) API Documentation (opens in a new tab)
“a VM’s lifecycle is associated with its file descriptor, not its creator (process)”
Definitions are original summaries. Standards text is not reproduced; follow the links for the official publications.