15.3.3.4. Setting guest system log access for a single VM with the CLI
You can configure access to VM guest system logs for a single VM by editing the VirtualMachine CR. This setting takes precedence over the cluster-wide default configuration.
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’s 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>