Capture GCP VM Serial Port Output to Terminal
Here’s the command to capture a GCP VM serial port output to your terminal.
<pre lang="bash">
gcloud compute instances get-serial-port-output servername \
--zone us-central1-f \
--project your-project \
--port 1
You can also send the output to a file.
<pre lang="bash">
gcloud compute instances get-serial-port-output servername \
--zone us-central1-f \
--project your-project \
--port 1 > output.txt