Logging and replay provide numerous benefits for debugging today's increasingly distributed and parallel applications, as well as for debugging within cloud computing environments. Tracking down faults, particularly in applications that involve non-deterministic executions, becomes much easier if such a technique is used. This article presents a system that leverages the functionality of modern x86 hardware extensions present in Intel and AMD processors to implement logging and replay of the Kernel-based Virtual Machine (KVM). With our KVM-based logging and replay system, virtual machines can be logged at will. The system can record the behavior of the operating system, the applications, the network traffic, and the user input. At a later time, and even on another machine, the problematic execution can be replayed and analyzed. The implementation incurs a minimal amount of processing and memory overhead, and thus, its effects are largely imperceptible to users of the system. Copyright © 2011 John Wiley & Sons, Ltd.