// Module included in the following assemblies:
//
// * virt/support/virt-troubleshooting.adoc

:_mod-docs-content-type: PROCEDURE
[id="virt-set-guest-log-single-vm-cli_{context}"]
= Setting guest system log access for a single VM with the CLI

[role="_abstract"]
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 {oc-first}.

.Procedure

. Edit the virtual machine manifest by running the following command:
+
[source,terminal]
----
$ oc edit vm <vm_name>
----

. Update the value of the `logSerialConsole` field. For example:
+
[source,yaml]
----
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 `logSerialConsole` value to `true`.

. Apply the new configuration to the VM by running the following command:
+
[source,terminal]
----
$ oc apply vm <vm_name>
----

. Optional: If you edited a running VM, restart the VM to apply the new configuration. For example:
+
[source,terminal]
----
$ virtctl restart <vm_name> -n <namespace>
----
