[Yandex Cloud documentation](../../../index.md) > [Yandex Compute Cloud](../../index.md) > [Step-by-step guides](../index.md) > Getting VM info > Getting the serial port output

# Getting the serial port output

You can get the output from a VM serial port and use it, e.g., for troubleshooting.

To access the output data, you need the `compute.operator` or `viewer` [role](../../security/index.md).

{% list tabs group=instructions %}

- Management console {#console}

  1. Select the folder the VM belongs to.
  1. Navigate to **Compute Cloud**.
  1. Click the line with the VM in question.
  1. Go to the **Serial port** tab.
  1. To use the **CTRL** + **F** shortcut to search, enable **Raw mode** in the top-right corner.

- CLI {#cli}

  The folder used by default is the one specified when [creating](../../../cli/operations/profile/profile-create.md) the CLI profile. To change the default folder, use the `yc config set folder-id <folder_ID>` command. You can also specify a different folder for any command using `--folder-name` or `--folder-id`. If you access a resource by its name, the search will be limited to the default folder. If you access a resource by its ID, the search will be global, i.e., through all folders based on access permissions.

  1. See the description of the command for getting the serial port output:

      ```
      yc compute instance get-serial-port-output --help
      ```

  1. Select a VM, e.g., `first-instance`:

      ```bash
      yc compute instance list
      ```
      
      Result:
      ```text
      +----------------------+-----------------+---------------+---------+----------------------+
      |          ID          |       NAME      |    ZONE ID    | STATUS  |     DESCRIPTION      |
      +----------------------+-----------------+---------------+---------+----------------------+
      | fhm0b28lgfp4******** | first-instance  | ru-central1-a | RUNNING | my first vm via CLI  |
      | fhm9gk85nj7g******** | second-instance | ru-central1-a | RUNNING | my second vm via CLI |
      +----------------------+-----------------+---------------+---------+----------------------+
      ```

  1. Get its serial port output. Since the serial port output is usually lengthy, we recommend writing it to a file:

      ```
      yc compute instance get-serial-port-output first-instance > output.txt
      ```

- API {#api}

  To get the serial port output, use the [getSerialPortOutput](../../api-ref/Instance/getSerialPortOutput.md) REST API method for the [Instance](../../api-ref/Instance/index.md) resource or the [InstanceService/GetSerialPortOutput](../../api-ref/grpc/Instance/getSerialPortOutput.md) gRPC API call.

{% endlist %}