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. Note that the negative start is bounded by the retained buffer size, and the returned serial console output will not exceed the max buffer size.
Request body
The request body must be empty.
Response body
An instance serial console output.
If successful, the response body contains data with the following structure:
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.
[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.
selfLink
string
[Output Only] Server-defined URL for this resource.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-07-28 UTC."],[[["\u003cp\u003eThis document outlines how to retrieve the last 1 MB of serial port output from a specified Compute Engine instance.\u003c/p\u003e\n"],["\u003cp\u003eThe HTTP request method is \u003ccode\u003eGET\u003c/code\u003e, and the URL structure requires specifying the project, zone, and instance as path parameters.\u003c/p\u003e\n"],["\u003cp\u003eQuery parameters, such as \u003ccode\u003eport\u003c/code\u003e and \u003ccode\u003estart\u003c/code\u003e, allow users to define which serial port to read from and to specify a specific byte position.\u003c/p\u003e\n"],["\u003cp\u003eThe response body contains JSON data that includes the console output (\u003ccode\u003econtents\u003c/code\u003e), the starting byte position (\u003ccode\u003estart\u003c/code\u003e), and the next byte position (\u003ccode\u003enext\u003c/code\u003e), if applicable.\u003c/p\u003e\n"],["\u003cp\u003eAccessing the serial port output requires one of three OAuth scopes or the \u003ccode\u003ecompute.instances.getSerialPortOutput\u003c/code\u003e IAM permission.\u003c/p\u003e\n"]]],[],null,["# Method: instances.getSerialPortOutput\n\n- [HTTP request](#body.HTTP_TEMPLATE)\n- [Path parameters](#body.PATH_PARAMETERS)\n- [Query parameters](#body.QUERY_PARAMETERS)\n- [Request body](#body.request_body)\n- [Response body](#body.response_body)\n - [JSON representation](#body.SerialPortOutput.SCHEMA_REPRESENTATION)\n- [Authorization scopes](#body.aspect)\n- [IAM Permissions](#body.aspect_1)\n- [Try it!](#try-it)\n\nReturns the last 1 MB of serial port output from the specified instance.\n\n### HTTP request\n\n`GET https://compute.googleapis.com/compute/beta/projects/{project}/zones/{zone}/instances/{instance}/serialPort`\n\nThe URL uses [gRPC Transcoding](https://google.aip.dev/127) syntax.\n\n### Path parameters\n\n### Query parameters\n\n### Request body\n\nThe request body must be empty.\n\n### Response body\n\nAn instance serial console output.\n\nIf successful, the response body contains data with the following structure:\n\n### Authorization scopes\n\nRequires one of the following OAuth scopes:\n\n- `https://www.googleapis.com/auth/compute.readonly`\n- `\n https://www.googleapis.com/auth/compute`\n- `\n https://www.googleapis.com/auth/cloud-platform`\n\nFor more information, see the [Authentication Overview](/docs/authentication#authorization-gcp).\n\n### IAM Permissions\n\nIn addition to any permissions specified on the fields above, authorization requires one or more of the following [IAM](https://cloud.google.com/iam/docs/) permissions:\n\n- `compute.instances.getSerialPortOutput`\n\nTo find predefined roles that contain those permissions, see [Compute Engine IAM Roles](/compute/docs/access/iam)."]]