15.3.3.4. Setting guest system log access for a single VM with the CLI
To troubleshoot a specific virtual machine (VM) without changing global settings, you can configure the guest system log access by editing the VirtualMachine CR.
Prerequisites
-
You have installed the OpenShift CLI (
oc).
Procedure
Edit the virtual machine manifest by running the following command:
$ oc edit vm <vm_name>Update the value of the
logSerialConsolefield. For example:apiVersion: kubevirt.io/v1 kind: VirtualMachine metadata: name: example-vm spec: template: spec: domain: devices: logSerialConsole: true #...To enable access to the guest serial console log, set the
logSerialConsolevalue totrue.Apply the new configuration to the VM by running the following command:
$ oc apply vm <vm_name>Optional: If you edited a running VM, restart the VM to apply the new configuration. For example:
$ virtctl restart <vm_name> -n <namespace>