Connecting to a VM's serial console via CLI
After enabling access, you can connect to the serial console to interact with the VM.
Warning
When assessing the risk of enabling access via the serial console, consider the following:
-
The VM can still be managed from the internet even if there is no external IP address.
To access the VM serial console from the Nebius Israel management console, a user must be authenticated in the Nebius Israel management console and have the proper rights to the VM. One can access the VM serial console from an SSH client application (such as PuTTY) or the Nebius Israel CLI via SSH key authentication. To reduce the risk of web session hijacking, you should closely monitor your SSH key and make sure you terminate the web session. -
The session will be simultaneously shared by all users who have access to the serial console.
Users will be able to see each other's actions if concurrently watching the serial console's output. -
A valid session can be exploited by another user.
We recommend using the serial console only when absolutely necessary, grant access to a narrow group of people, and use strong VM passwords.
Make sure you disable access after you finish using the serial console.
Federated users can only connect to the serial console using the CLI or SSH. These users cannot access the serial console from the Nebius Israel management console.
Connecting to the serial console
Note
How the serial console works depends on the operating system settings. Compute Cloud provides a communication channel between the user and COM port on the VM, but it does not guarantee that the console works properly on the OS.
To connect to the serial console, use the CLI.
If you don't have the Nebius Israel command line interface yet, install and initialize it.
The folder specified in the CLI profile is used by default. You can specify a different folder using the --folder-name
or --folder-id
parameter.
-
View the description of the CLI command for connecting to the serial console:
yc compute connect-to-serial-port --help
-
Get a list of VMs in the default folder:
yc compute instance list
Result:
+----------------------+-----------------+---------------+---------+----------------------+ | ID | NAME | ZONE ID | STATUS | DESCRIPTION | +----------------------+-----------------+---------------+---------+----------------------+ | fhm0b28lgfp4tkoa3jl6 | first-instance | il1-a | RUNNING | my first vm via CLI | | fhm9gk85nj7gcoji2f8s | second-instance | il1-a | RUNNING | my second vm via CLI | +----------------------+-----------------+---------------+---------+----------------------+
-
Select the VM
ID
orNAME
(for example,first-instance
). -
Connect to the Linux serial console:
yc compute connect-to-serial-port \ --instance-name first-instance \ --ssh-key ~/.ssh/id_ed25519
Or to Windows SAC:
yc compute connect-to-serial-port \ --instance-name first-instance \ --port 2
Where:
instance-name
: Required parameter. VM name.user
: Optional parameter. Username. If this parameter is omitted, the defaultyc-user
user will be used. Theyc-user
user is generated automatically when the VM is being created. For more information, see Creating a VM from a public Linux image.port
: Optional parameter. Port number to connect to the serial console.- The default value is 1. You don't need to specify this parameter to connect to the Linux serial console.
- When connecting to the Windows serial console (SAC), pass the value 2.
ssh-key
: Optional parameter. Path to the private key for SSH access to the Linux VM to be added to the metadata. If this parameter is omitted, theyc_serialssh_key
SSH key is generated.
Troubleshooting
- If you connect to the serial console and nothing appears on the screen, press Enter.
- If the OS requests user credentials to provide access to the VM, enter the login and password:
- On a Linux VM, set a user password first. Run
sudo passwd <username>
. For more information, see Getting started with the serial console. - On a Windows VM, enter your username, domain (VM name), and password. For more information, see Starting your terminal in the Windows serial console (SAC).
- On a Linux VM, set a user password first. Run
Disconnecting from the serial console
To disconnect from the serial console:
- Press Enter.
- Enter the following characters in order:
~.
.