Skip to main content

Create Virtual Machine in Vietnix Cloud

After creating a virtual network, the next step is to create virtual machines and connect to them using SSH.

Pre-Creation Planning

Before creating virtual machines, make sure you have:

  • An active Vietnix Cloud account
  • A project with sufficient resources (CPU, RAM, and storage)
  • A virtual network with available IP addresses

Preparing SSH Keys

SSH keys provide a secure way to access your virtual machines.

Linux / macOS

Run the following command in your terminal. Press Enter to accept the default settings:

ssh-keygen -t rsa -b 4096 -C "your_email@example.com"

The public key will be saved at:

~/.ssh/id_rsa.pub

Windows (PowerShell / Git Bash)

Run the same command in PowerShell or Git Bash. Press Enter to accept the default settings:

ssh-keygen -t rsa -b 4096 -C "your_email@example.com"

The public key will be saved at:

C:\Users\<YourUser>\.ssh\id_rsa.pub

TIP: The path to the key will be displayed during creation. Make note of it.

Add SSH Keys

  1. Log in to the Vietnix Cloud Dashboard.

  2. Navigate to ComputeSSH Key.

  3. Click Add SSH Key.

    SSH Key

  4. Enter your public SSH key (usually the contents of id_rsa.pub) and click Save.

    Add SSH Key

Create Virtual Machines

  1. Navigate to ComputeVirtual Machines.

  2. Click Create Virtual Machine.

    Dashboard Virtual Machines

  3. Configure your virtual machine:

    • Name: Enter a name for the virtual machine.

      Create Virtual Machine

    • Deploy From: Select the deployment method (Image or Volume).

    • Image: Choose the image for the virtual machine (e.g., Ubuntu-22.04-LTS-x64).

      Select the image for the virtual machine

    • Volume (Optional): If deploying from an image, a boot volume will be created. You can edit the size (e.g., increase to 10 GB).

      Select the volume for the virtual machine

    • Flavor: Select the resource configuration for the VM (e.g., medium). Adjust based on your needs.

      Select the Flavor for the virtual machine

    • Network: Choose the virtual network created earlier.
      Click Add, select the network, and leave other values as default. Click AddDone.

      Add network interface for the virtual machine

    • SSH Key: Select the SSH key for this VM. This step is required for SSH access.

      Select the SSH key for the virtual machine

  4. Summary: Review the configuration, then click Create Virtual Machine.

    Summary of the virtual machine configuration

  5. Click Deploy to start creating the virtual machine.

  6. Monitor the progress of the VM creation.

  7. Once the VM status changes to Active, your virtual machine is successfully created and ready to use.

    VM Creation Successful

Connect to Virtual Machines

  1. Navigate to ComputeFloating IPs.

  2. Click Add Floating IP.

    Connect Virtual Machines

  3. Configure the Floating IP settings:

    • Network: Select the external network that will provide public access.
    • VM or Load Balancer: Choose the virtual machine you created and want to connect to.
    • IP Address: Select or assign an available IPv4 address for the VM.

    Configure Floating IP

  4. Once created, the status will change to Active, confirming the Floating IP has been successfully assigned. You can now use this IP address to connect to your VM.

    Floating IP Active

  5. Copy the assigned Floating IP address from the Floating IPs list.

  6. Use the following command to connect to the virtual machine via SSH:

    The default user is cloud-user.

    ssh cloud-user@<Floating-IP> -i ~/.ssh/id_rsa

Debug Virtual Machine via Console (Optional)

You can directly monitor and debug a virtual machine using the Console interface in the Vietnix Cloud Dashboard.

Steps to Access Console

  1. In the Virtual Machines section, select the VM you want to debug and click Set Password.
    This password will be used for the root user when logging in via the Console.

    Set Password

  2. You can either set a custom password (following the password policy) or click Generate to automatically create one.

    • Click the eye icon next to the password field to view it.
    • Save the password in a secure location.
    • Click Set to apply the password.

    Set Password

  3. In the Virtual Machines section, select the VM again and click Console.

    Open Console

  4. Enter the password you set earlier to log in as the root user and start debugging directly from the Console.

    Open Console

Note

  • This method is only intended for debugging purposes.
  • To access the VM via SSH, you must still configure and attach an SSH key as explained above.

You have now successfully created and connected to a virtual machine. The next guide will walk you through creating a Kubernetes cluster on Vietnix Cloud. Good luck!