15.3.3.6. Viewing guest system logs with the CLI
To diagnose and troubleshoot issues with a virtual machine (VM) guest operating system, you can view the guest system logs by running the oc logs command.
Guest system logs capture serial console output from the VM’s boot process, kernel messages, and system-level events, which is useful when troubleshooting boot failures, kernel panics, or configuration issues that prevent standard access methods.
Prerequisites
- Guest system log access is enabled.
-
You have installed the OpenShift CLI (
oc).
Procedure
View the logs by running the following command, substituting your own values for
<namespace>and<vm_name>:$ oc logs -n <namespace> -l kubevirt.io/domain=<vm_name> --tail=-1 -c guest-console-log