Every instance has a serial console, a VNC console and console output. They don’t use the instance’s network, so they still work when SSH doesn’t: a firewall rule that locks you out, a network configuration that didn’t come up, or a guest that doesn’t finish booting.
| What it is | Instance state | Console | CLI | |
|---|---|---|---|---|
| Serial console | An interactive terminal on the instance’s first serial port | Running | Yes | ezgh compute instances serial-console |
| VNC console | The instance’s screen, keyboard and mouse | Running | Yes | No |
| Console output | The last 64 KiB written to the serial port | Any, once it has written output | Yes | ezgh compute instances console-output |
Logging in
EZGH never adds a password or any other login to an instance, and official images have no password login. A serial or VNC console shows the guest’s login prompt, but you can only log in there with a password you set up in the guest yourself. To be able to, set one at launch with user-data (in the console, Launch instance, then Advanced). For example, with cloud-init:
#cloud-config
users:
- default
- name: ops
groups: sudo
shell: /bin/bash
lock_passwd: false
hashed_passwd: "$6$..." # from: mkpasswd --method=SHA-512Console output needs no login.
Serial console
In the console, open the instance and choose Connect > Serial console. It opens in a new browser tab and connects right away. Press Enter if it’s blank: the guest prints its login prompt again.
From the CLI:
ezgh compute instances serial-console web-1The instance is given by name or ID (ins_…). Keystrokes go to the instance as you type them,
Ctrl-C included. To disconnect, press Enter, then ~ and ., as in ssh (~~ at the start of
a line sends one ~). Piped input is sent as it is, and the session stays open printing output
until it ends or you interrupt it.
The exit code says how the session ended: 0 when you disconnect or the session closes normally,
3 when the session couldn’t start (run the command again), 4 when EZGH Cloud ended it, and 1
for anything else, with a message saying which.
VNC console
In the console, open the instance and choose Connect > VNC console. It opens in a new browser tab and shows the instance’s screen, and takes your keyboard and mouse while it has focus. Use it for an image with a graphical boot or desktop, or a boot menu. The CLI has no VNC command.
Console output
Console output is what the instance last wrote to its serial port, up to 64 KiB: kernel and boot messages, cloud-init’s progress and anything else the guest logs there. It’s kept when the instance stops, so you can read why a boot failed after the fact. It isn’t live: it’s updated shortly after the instance writes it.
In the console, open the instance and its Console output tab. From the CLI:
ezgh compute instances console-output web-1
ezgh compute instances console-output web-1 -o json # output (base64), capturedAt, truncatedtruncated is true when earlier output was cut off. An instance that never wrote to its serial
port has no console output yet (console_output_unavailable).
Limits
| Console sessions per instance, serial and VNC together | 5 (not adjustable) |
| Session idle time | Ends after 30 minutes without input from you |
| Session length | Ends after 8 hours |
| Console output kept | The last 64 KiB |
A session also ends when the instance stops or is terminated. Connect again for a new session once it’s running.
IAM
| Action | Allows | Checked against |
|---|---|---|
compute.instances.connectSerialConsole |
Connect to the instance’s serial console | The instance |
compute.instances.connectVncConsole |
Connect to the instance’s VNC console | The instance |
compute.instances.getConsoleOutput |
Read the instance’s console output | The instance |
ComputeFullAccess and ComputeConsoleAccess have all three. ComputeConsoleAccess also has
compute.instances.get, and nothing that changes an instance. ComputeReadOnlyAccess and
ReadOnlyAccess have none of the three.
Finding the instance in the console’s list, or giving the CLI its name rather than its ID, also
needs compute.instances.list on the project, which ComputeReadOnlyAccess has.
Each new session is recorded in Trails as CreateConsoleSession. What you type and what
the console shows are never recorded.