Blog
CubeCOS

CubeCOS: How to Launch a Linux Virtual Machine with Step-by-Step Guide

virtual-machine-open-from-a-box

Launch a Linux Virtual Machine Overview

Setting up and managing cloud infrastructure should be simple, consistent, and accessible for everyone. That's the mission behind CubeCOS, an open source virtualization platform designed to make Infrastructure as a Service (IaaS) easy to deploy. In the first part of the series, I will walk you through step-by-step on how it works. 

In part 1, you will learn how to:

  • Upload a Linux cloud image and configure it as a template
  • Configure private virtual networking
  • Launch your first Linux virtual machine

By the end of this guide, you’ll have a fully running VM and a working IaaS environment built with CubeCOS - free, open source, and optimized for cloud virtualization.

If you have not installed CubeCOS yet, follow our Quick Start guides to get started. 

Time to complete: 40 minutes

Terms to Know


  1. Glance: The virtual machine image store used by CubeCOS. Glance facilitates fast and large-scale image provisioning.
  2. Ceph: The distributed storage that CubeCOS utilizes to provide resilient and performant storage.
  3. Cloud image: Operating images optimized for cloud computing platforms/ providers like OpenStack, AWS AMI, Google Cloud Platform, and Microsoft Azure.
  4. Project: The unit into which resources are grouped; each project can be treated as an independent tenant to separate resource allocation and traffic.
  5. Instance: CubeCOS follows cloud architecture conventions, where virtual machines are referred to as instances. For clarity in this article, I’ll use the term virtual machines.
  6. Hypervisor: A hypervisor abstracts and virtualizes bare metal resources such as CPU, memory, storage, and network to provide resource isolation and support various workloads running on the same hardware.

Pre-requisites for creating a Linux cloud machine

Download a Linux virtual machine cloud image

For the smoothest setup experience, download a cloud image from your chosen distribution, whether Rocky, Ubuntu, Debian, or CentOS Stream. Cloud images come pre-installed with cloud-init to help you provision and get started with virtual machines faster. 

We will use the generic CentOS Stream 9 cloud image for this walkthrough. Download CentOS Stream 9 in QCOW2 format.

Use the official repositories or the links we prepared here for any other images: Cloud Image.

Special note for Ubuntu cloud images
Ubuntu cloud images are .img by default. Rename the .img to .qcow2 before uploading it to CubeCOS. 

Create your first virtual machine on CubeCOS

Before starting your first virtual machines, you must upload the cloud image you downloaded to CubeCOS.

Upload a cloud image to CubeCOS

Let’s begin by uploading your cloud image to CubeCOS. In a later section, the cloud images are the templates used to create virtual machines. 

The current upload function must be performed through the CLI interface. 

Graphical image upload support will be added in an upcoming version.

  1. Navigate to your download directory within your terminal or console withcd Downloads/
  2. Verify that CentOS-Stream-GenericCloud-9-latest.x86_64.qcow2 is present.
  3. Upload the generic cloud image to CubeCOS.
    scp CentOS-Stream-GenericCloud-9-latest.x86_64.qcow2 root@<your-cubecos-vip>:/mnt/cephfs/glance/.tutorial-cubecos-1-upload-instructions
  4. Enter your root password when prompted.
    tutorial-cubecos-2-enter-upload-password
  5. The upload should take 5-10 minutes, depending on the image's size and the connection's speed.
    tutorial-cubecos-3-image-uploading
  6. Once imported, we can begin the import process.

tutorial-cubecos-3_5-image-upload-completeImport a cloud image to the image store

  1. You can use the same terminal session from above or start a new one to begin the importing process.
  2. Log in to the admin interface of your CubeCOS installation with
    1. Username: admin
    2. Password: The default password or your customized password
  3. Begin the image importing process with
    image importtutorial-cubecos-5-image-import-cli
  4. Select 
    2: localtutorial-cubecos-6-image-import-local
  5. Enter the index of your image. We want the
    CentOS-Stream-GenericCloud-9-latest.x86_64.qcow2tutorial-cubecos-7-image-import-select-image
  6. Specify the name by which you want to identify your image. I will name mine
    centos-stream-9tutorial-cubecos-8-image-import-select-image-name
  7. Enter 1 to select the default domain.
    tutorial-cubecos-9-image-import-select-image-domain
  8. Enter 3 to select the admin tenant. The admin tenant is created automatically during installation. For this tutorial, we will use it to store our public images for other projects to use. You can create a new project following the Create a Project guide to control access to specific images and projects.
    tutorial-cubecos-10-image-import-select-image-project
  9. Enter 1 to set the destinations to glance-images to set the image as a base template for launching virtual machines later.
    tutorial-cubecos-11-image-import-select-image-type
  10. Enter 1 to set the image as public so all tenants in this cluster have access to this image. 
    tutorial-cubecos-12-image-import-select-image-visibility
  11. The import progress will begin after this step. The import will take 5-15 minutes, depending on your image size and network performance.
    tutorial-cubecos-13-image-import-progress
  12. We can move on to creating a project to start our virtual machine once the image is complete and imported. 
    tutorial-cubecos-14-image-import-completion

Set the cloudinit parameters

  1. Switch to the admin project via the project switcher.
  2. Navigate to Compute > Images, and select the centos-stream-9 image.
    tutorial-cubecos-15-image-upload-verify
  3. Select Edit and set the following values in the image parameters.
    1. OS Version: 9 
    2. OS Admin: cloud-user
    tutorial-cubecos-17-image-edit
  4. Click OK to save the configuration.

Create a project

A project is a resource unit that reserves resources, ensures resource separation, and facilitates management efforts. You will create a new project for your own virtual machines.

    1. Open the CubeCOS management interface at 
      https://<your-cubecos-cluster-vip>
    2. Log in with the default credentials:
      1. Username: admin
      2. Password: admin
        tutorial-cubecos-18-create-project-login
    3. Once logged in, navigate to the Integrations tab and click the OpenStack Connect button.
      tutorial-cubecos-19-create-project-integration-nav
    4. A new management page will pop up. Click to log in with your Cube account.
      tutorial-cubecos-20-create-project-cube-login
    5. Once logged in, click the "Administrator" text on the top right to switch to the CubeCOS administrative view.
      tutorial-cubecos-21-create-project-skyline
    6.  To confirm you are in the administrative view, verify that the top right switcher now shows "Console".
      tutorial-cubecos-22-create-project-admin-view
    7. Navigate to Administrator > Identity > Projects in the administrative view.
      tutorial-cubecos-23-create-project-list-view
    8. To create a new project, click 
      + Create Project
    9. Create a new tutorial project and leave the affiliated domain as the Default and the status as enabled.
      tutorial-cubecos-24-create-project-tutorial
    10. Once the project is created, it will appear under the Projects tab.  Select More than Manage User from the drop-down menu to manage users for our tutorial project. We want to add our current user as an admin for the tutorial project so we can manage and start resources in it.
      tutorial-cubecos-25-create-project-manage-user
    11. In the manage user windows, select the admin (IAM) user on the left, and click the > to assign the user to the project.
tutorial-cubecos-26-create-project-assign-admin-permission
  1. Assign the admin (IAM) user the admin role so you can manage the resources and configurations in your project.
    tutorial-cubecos-27-create-project-admin-assigned
  2. To apply the changes, click OK.
  3. Switch back to the user view by clicking Console on the top right navigation bar.
  4. Open the project switcher.
    tutorial-cubecos-28-create-project-switch-project
  5. Verify and switch to the tutorial project under the project switcher.
    tutorial-cubecos-29-create-project-select-tutorial-project
  6. You have successfully created your own tutorial project to start hosting resources in!

Create a private network for virtual machine traffic

One of the strengths of CubeCOS is its built-in software-defined network stack, which provides tenant-isolated networking with support for custom subnets, routers, and security groups, improving traffic control.

You will create a private network within your tutorial project to provide the IP address to your virtual machines. Before you begin, ensure you are using the tutorial project from the project switcher.

  1. Navigate to Project > Network > Networks and click on
    + Create Network
  2. Enter tutorial-network as the network name.
  3. Select the Create Subnet checkbox and enter the following information:
    1. Subnet name: tutorial-subnet-192
    2. IP Version: ipv4
    3. CIDR: 192.168.168.0/24
      tutorial-cubecos-31-network-creation
  4. Click `OK to create the tutorial subnet.
  5. Verify that the network status shows Active.
    tutorial-cubecos-32-network-verify-creation
  6. You are now ready to create your first virtual machine.

Launch your first virtual machine on CubeCOS

The Create Instances function provisions virtual machines based on predefined resource templates, cloud operating system images, and configuration parameters.

Configure base config

  1. Navigate to Project > Compute > Instances and click on 
    + CREATE INSTANCE
  2. Select t2.medium under the specification, which determines the resources allocated to the virtual machine.
    tutorial-cubecos-33-create-instance-start
  3. On the right side, you will see the resource quotas available to your project by default. The quota determines how many resources can be allocated per project. 
  4. Switch to Centos under the Operating System tab. Select the centos-stream-9 image you created.
    tutorial-cubecos-34-create-instance-disk
  5. Select Yes - Create a new system disk, and set 80GB for the disk size under the System Disk section.
    tutorial-cubecos-35-create-instance-disk-select
  6. To begin network configuration, click on.
    Next: Network Config

Configure network config

Since we created a private network with a DHCP IP allocation pool, CubeCOS will populate the Virtual LAN fields for us. 

  1. Select the tutorial-network you created from the network section.
  2. Verify that the virtual LAN and security group fields are both populated.
  3. To configure system parameters, click 
    Next: System Config

Configure system config

Configure the name and method of accessing your virtual machine here.

  1. Enter tutorial-centos-stream-9 as the name.
  2. Select a Password for the login type.
  3. Use Happy1tutorial as the login password.
    tutorial-cubecos-38-create-instance-password
  4. To review and start the virtual machine creation, click Next: Confirm Config.
  5. Verify all the configuration details are correct and click Confirm.
  6. Your first virtual machine will now build. 
    tutorial-cubecos-40-create-instance-verify-created
  7. Select the virtual machine once the instance status transitions to Active
    tutorial-cubecos-41-create-instance-verify-details
  8. With that, you have successfully created your first virtual machine.

 Connect to the instance virtual console.

  1. Click on Console in the Instance Detail page to access the instance virtual console.
    tutorial-cubecos-41-create-instance-verify-details
  2. A virtual console will open in a new tab.
    tutorial-cubecos-43-launch-console-login-success
  3. Log in with the credentials you set
    1. Username: cloud-user
    2. Password: Happy1tutorial
      tutorial-cubecos-43-launch-console-login-success
  4. That’s it. You now have a working Linux virtual machine on your CubeCOS cluster.

In part two of this series, we will explore how to secure and allow remote access to the instances within your project. Stay subscribed to get notified once our new blog goes live!

Frequently Asked Questions

How do I launch a virtual machine on a cloud virtualization platform?

Utilize a prebuilt cloud image from your preferred distribution (e.g., CentOS, Rocky, Ubuntu, etc). Upload the image, create a project to organize resources, configure the VM's allocated resources, and launch the VM.

What are cloud images, and why are they used for VM deployment?

+

Cloud images are lightweight, pre-configured operating system images optimized for cloud environments. They include support for cloud-init, which automates initial configuration such as setting hostnames, SSH keys, and user accounts.

Why must I create a project (tenant) before provisioning VMs?

+

Projects (tenants) are essential for resource isolation, access control, and usage tracking in multi-tenant cloud environments. They help organize VMs, apply quotas, and separate environments.

How do I connect to a virtual machine after deployment?

+

Connect to your provisioned virtual machine through SSH using the assigned IP address and your SSH key pair or through the CubeCOS web-based virtual console.

Is network configuration required before creating a virtual machine?

+

Configuring a virtual network is required to assign IP addresses and enable communication for your VM.


Subscribe to Bigstack