Yandex.Cloud
  • Services
  • Why Yandex.Cloud
  • Solutions
  • Pricing
  • Documentation
  • Contact us
Get started
Yandex Compute Cloud
  • Getting started
    • Overview
    • Creating a Linux VM
    • Creating a Windows VM
    • Creating instance groups
  • Step-by-step instructions
    • All instructions
    • Creating VMs
      • Creating a Linux VM
      • Creating a Windows VM
      • Creating a VM from a set of disks
      • Creating a VM with disks restored from snapshots
      • Creating a VM from a custom image
      • Creating a preemptible VM
      • Creating a VM with a GPU
    • DSVM
      • Overview
      • Creating a VM from a public DSVM image
    • Placement groups
      • Creating a placement group
      • Deleting a placement group
      • Creating a VM in a placement group
      • Adding a VM to a placement group
      • Removing a VM instance from a placement group
    • Images with pre-installed software
      • Creating a VM from a public image
      • Configuring software
      • Working with a VM based on a public image
      • Getting a list of public images
    • Getting information about a VM
      • Getting information about a VM
      • Viewing serial port output
    • Managing VMs
      • Stopping and starting a VM
      • Attaching a disk to a VM
      • Detaching a disk from a VM
      • Moving a VM to a different availability zone
      • Making a VM's public IP address static
      • Updating a VM
      • Changing VM computing resources
      • Deleting a VM
    • Working on VMs
      • Connecting to a VM via SSH
      • Connecting to a VM via RDP
      • Working with Yandex.Cloud from inside a VM
      • Installing NVIDIA drivers
    • Creating new disks
      • Creating an empty disk
      • Create an empty disk with a large block
    • Disk management
      • Creating a disk snapshot
      • Updating a disk
      • Deleting a disk
      • Deleting a disk snapshot
    • Creating new images
      • Uploading your image
    • Managing images
      • Deleting a disk image
    • Managing the serial console
      • Getting started
      • Connecting to a serial console via SSH
      • Connecting to a serial console via CLI
      • Start your terminal in the Windows SAC
      • Disabling access to the serial console
    • Creating instance groups
      • Creating a fixed-size instance group
      • Creating a fixed-size instance group with a network load balancer
      • Creating an automatically scaled instance group
      • Creating an instance group from Container Optimized Image
    • Getting information about instance groups
      • Getting a list of instance groups
      • Getting information about an instance group
      • Getting a list of instances in a group
    • Managing instance groups
      • Editing an instance group
      • Configuring application health check on the VM
      • Updating a instance group
        • Incremental updates
        • Uninterrupted updates
      • Stopping an instance group
      • Starting an instance group
      • Deleting an instance group
    • Dedicated hosts
      • Creating a VM in a group of dedicated hosts
      • Creating a VM on a dedicated host
  • Yandex Container Optimized Solutions
  • Scenarios
    • Configuring NTP time synchronization
    • Running instance groups with auto scaling
  • Concepts
    • Relationship between resources
    • Virtual machines
      • Overview
      • Platforms
      • vCPU performance levels
      • Graphics accelerators (GPUs)
      • Preemptible VMs
      • Network on a VM
      • Live migration
      • Placement groups
      • Statuses
      • Metadata
    • Disks
      • Overview
      • Disk snapshots
    • Images
    • Instance groups
      • Overview
      • Access
      • Instance template
      • Variables in an instance template
      • Policies
        • Overview
        • Allocation policy
        • Deployment policy
        • Scaling policy
      • Scaling types
      • Auto-healing
      • Updating
        • Overview
        • Allocating instances across zones
        • Deployment algorithm
        • Rules for updating instance groups
      • Statuses
    • Dedicated host
    • Backups
    • Quotas and limits
  • Access management
  • Pricing policy
    • Current pricing policy
    • Archive
      • Before January 1, 2019
      • From January 1 to March 1, 2019
      • From March 1 to May 1, 2019
  • Compute API reference
    • Authentication in the API
    • gRPC
      • Overview
      • DiskPlacementGroupService
      • DiskService
      • DiskTypeService
      • HostGroupService
      • HostTypeService
      • ImageService
      • InstanceService
      • PlacementGroupService
      • SnapshotService
      • ZoneService
      • InstanceGroupService
      • OperationService
    • REST
      • Overview
      • Disk
        • Overview
        • create
        • delete
        • get
        • list
        • listOperations
        • update
      • DiskPlacementGroup
        • Overview
        • create
        • delete
        • get
        • list
        • listDisks
        • listOperations
        • update
      • DiskType
        • Overview
        • get
        • list
      • HostGroup
        • Overview
        • create
        • delete
        • get
        • list
        • listHosts
        • listInstances
        • listOperations
        • update
      • HostType
        • Overview
        • get
        • list
      • Image
        • Overview
        • create
        • delete
        • get
        • getLatestByFamily
        • list
        • listOperations
        • update
      • Instance
        • Overview
        • addOneToOneNat
        • attachDisk
        • create
        • delete
        • detachDisk
        • get
        • getSerialPortOutput
        • list
        • listOperations
        • removeOneToOneNat
        • restart
        • start
        • stop
        • update
        • updateMetadata
        • updateNetworkInterface
      • PlacementGroup
        • Overview
        • create
        • delete
        • get
        • list
        • listInstances
        • listOperations
        • update
      • Snapshot
        • Overview
        • create
        • delete
        • get
        • list
        • listOperations
        • update
      • Zone
        • Overview
        • get
        • list
      • Operation
        • Overview
        • get
      • InstanceGroup
        • Overview
        • createFromYaml
        • update
        • list
        • get
        • delete
        • start
        • stop
        • create
        • listAccessBindings
        • setAccessBindings
        • updateFromYaml
        • listLogRecords
        • listInstances
        • updateAccessBindings
        • listOperations
  • Questions and answers
    • General questions
    • Virtual machines
    • Disks and snapshots
    • Licensing
    • All questions on the same page
  1. Getting started
  2. Creating a Linux VM

Creating a Linux VM

  • Before you start
  • Creating VMs
  • Connecting to VMs
  • Configuring the serial console
  • Deleting VMs
  • What's next

Create a Linux virtual machine using Compute Cloud from the Yandex.Cloud management console and connect to it.

Before you start

To get started in Yandex.Cloud:

  1. Log in to management console. If you aren't registered, go to the management console and follow the instructions.
  2. On the billing page make sure that you enabled a billing account and that it has the ACTIVE or TRIAL_ACTIVE status. If you don't have a billing account, create one.
  3. If you don't have a folder, create one.
  4. If you don't have an SSH key pair yet, create one.

Creating VMs

To create a VM:

  1. In the management console, select a folder to create a VM in.

  2. In the list of services, select Compute Cloud.

  3. Click Create VM.

  4. Under Basic parameters:

    • Enter a name and description for the VM. Naming requirements:

      • Length — from 3 to 63 characters.
      • The name may contain lowercase Latin letters, numbers, and hyphens.
      • The first character must be a letter. The last character can't be a hyphen.

      Note

      The VM name is used to generate the FQDN only once, when creating the VM. If the FQDN is important to you, choose an appropriate name for the VM at the creation stage.

    • (optional) Select or create a service account. By using a service account, you can flexibly configure access rights for your resources.

    • Select the availability zone to host the VM in.

  5. Select an image and a Linux-based OS version under Images from Cloud Marketplace.

  6. (optional) Configure the boot disk under Disks:

    • Specify the necessary disk size.
    • Select a disk type.

    If you want to create an instance from an existing disk, go to Disks to add a disk.

  7. Under Computing resources:

    • Choose the platform.
    • Specify the guaranteed share and number of vCPUs and RAM you need.
    • If necessary, make your VM preemptible.
  8. Under Network settings:

    • Specify the subnet ID or select a cloud network from the list. If you don't have a network, click Create a new network to create one:
      • In the window that opens, enter a name for the new network and choose a subnet to connect the virtual machine to. Each network must have at least one subnet (if there's no subnet, create one). Then click Create.
    • In the Public IP field, choose a method for assigning an IP address:
      • Auto: Assign a random IP address from the Yandex.Cloud IP pool.
      • List: Select a public IP address from the list of previously reserved static addresses. For more information, see Making a dynamic public IP address static.
      • No address: Don't assign a public IP address.
    • (optional) Enable DDoS protection.
  9. Under Access, specify the data required to access the VM:

    • Enter the username in the Login field.

      Alert

      Don't use the username root or other names reserved by the operating system. To perform operations that require superuser permissions, use the command sudo.

    • In the SSH key field, paste the contents of the public key file.

  10. Click Create VM.

The virtual machine appears in the list. When a VM is being created, it is assigned an IP address and hostname (FQDN).

Connecting to VMs

You can connect to a VM using the SSH protocol when it is running (the VM's status is RUNNING). You can use the ssh tool in Linux/macOS/Windows 10 or PuTTY in Windows 7/8.

To connect to the VM, specify its public address. You can find out the public IP address in the management console. On the VM's page, go to the Network section and find the Public IPv4 field. If you created a VM with only an internal address, you need to create a new VM with a public address to make it accessible over the internet.

You can also use the internal IP addresses and FQDNs to establish an SSH connection between the VMs on a single Yandex.Cloud cloud network.

Linux/macOS
Windows 10
Windows 7/8

In the terminal, run the command:

ssh <username>@<VM_public_IP_address>

If you have multiple private keys, specify the one you need:

ssh -i <key_path/key_file_name> <username>@<VM_public_IP_address>

If this is the first time you connect to a VM, you'll see a warning about an unknown host:

The authenticity of host '130.193.40.101 (130.193.40.101)' can't be established.
ECDSA key fingerprint is SHA256:PoaSwqxRc8g6iOXtiH7ayGHpSN0MXwUfWHkGgpLELJ8.
Are you sure you want to continue connecting (yes/no)?

Type yes in the terminal and press Enter.

From the command line, run:

ssh <username>@<VM_public_IP_address>

If you have multiple private keys, specify the one you need:

ssh -i <key_path\key_file_name> <username>@<VM_public_IP_address>

If this is the first time you connect to a VM, you'll see a warning about an unknown host:

The authenticity of host '130.193.40.101 (130.193.40.101)' can't be established.
ECDSA key fingerprint is SHA256:PoaSwqxRc8g6iOXtiH7ayGHpSN0MXwUfWHkGgpLELJ8.
Are you sure you want to continue connecting (yes/no)?

Type yes in the command prompt and press Enter.

In Windows, a connection is established using the PuTTY application.

  1. Run the Pageant application.
    1. Right-click on the Pageant icon in the task bar.
    2. In the context menu, select Add key.
    3. Select a PuTTY-generated private key in the .ppk format. If a password is set for the key, enter it.
  2. Run PuTTY.
    1. In the Host Name (or IP address) field, enter the public IP address of the VM you want to connect to. Specify port 22 and SSH as the connection type.

      ssh_add_ip

    2. In the tree on the left, select Connection - SSH - Auth.

    3. Set the Allow agent forwarding option.

    4. In the Private key file for authentication field, select the file with the private key.

      ssh_choose_private_key

    5. Go back to the Sessions menu. In the Saved sessions field, enter any session name and click Save. The session settings are saved under the specified name. You can use this session profile to connect using Pageant.

      ssh_save_session

    6. Click Open. If this is the first time you connect to a VM, you might see a warning about an unknown host:

      ssh_unknown_host_warning

      Click Yes. A terminal window opens suggesting that you enter the login of the user on whose behalf the connection is being established. Type the user name that you specified when creating the VM and press Enter. If everything is configured correctly, the connection with the server will be established.

      ssh_login

If you saved the session profile in PuTTY, you can use Pageant to establish a connection in the future:

  1. Right-click on the Pageant icon in the task bar.
  2. Select the Saved sessions menu item.
  3. In the saved sessions list, select the necessary session.

Configuring the serial console

Using the serial console, you can connect to a VM regardless of the network or OS state (for example, if there are SSH loading or access issues).

Make sure you configure access to the VM via the serial console in advance.

Deleting VMs

If you no longer plan to use a virtual machine, delete it.

What's next

  • Watch tutorials for creating web services in Yandex.Cloud.
  • Learn how to use VMs.
  • Learn how to create a VM with a GPU.
  • Read answers to frequently asked questions.
In this article:
  • Before you start
  • Creating VMs
  • Connecting to VMs
  • Configuring the serial console
  • Deleting VMs
  • What's next
Language / Region
Careers
Privacy policy
Terms of use
Brandbook
© 2021 Yandex.Cloud LLC