Method: instances.getSerialPortOutput

Returns the last 1 MB of serial port output from the specified instance.

HTTP request


The URL uses gRPC Transcoding syntax.

Path parameters



Project ID for this request.



The name of the zone for this request.



Name of the instance for this request.

Query parameters



Specifies which COM or serial port to retrieve data from.


string (int64 format)

Specifies the starting byte position of the output to return. To start with the first byte of output to the specified port, omit this field or set it to 0.

If the output for that byte position is available, this field matches the start parameter sent with the request. If the amount of serial console output exceeds the size of the buffer (1 MB), the oldest output is discarded and is no longer available. If the requested start position refers to discarded output, the start position is adjusted to the oldest output still available, and the adjusted start position is returned as the start property value.

You can also provide a negative start position, which translates to the most recent number of bytes written to the serial port. For example, -3 is interpreted as the most recent 3 bytes written to the serial console.

Request body

The request body must be empty.

Response body

If successful, the response body contains data with the following structure:

An instance serial console output.

JSON representation
  "contents": string,
  "start": string,
  "next": string,
  "selfLink": string,
  "kind": string


[Output Only] The contents of the console output.


string (int64 format)

The starting byte position of the output that was returned. This should match the start parameter sent with the request. If the serial console output exceeds the size of the buffer (1 MB), older output is overwritten by newer content. The output start value will indicate the byte position of the output that was returned, which might be different than the start value that was specified in the request.


string (int64 format)

[Output Only] The position of the next byte of content, regardless of whether the content exists, following the output returned in the contents property. Use this value in the next request as the start parameter.



[Output Only] Type of the resource. Always compute#serialPortOutput for serial port output.

Authorization Scopes

Requires one of the following OAuth scopes:


For more information, see the Authentication Overview.

IAM Permissions

In addition to any permissions specified on the fields above, authorization requires one or more of the following IAM permissions:

  • compute.instances.getSerialPortOutput

To find predefined roles that contain those permissions, see Compute Engine IAM Roles.