Files
3engines_doc/docs/openstackcli/How-to-install-connectVMClient-on-Windows-using-Windows-Subsystem-for-Linux-on-connectVM-Cloud-connectVM-Hosting.html.md
2025-08-16 08:07:54 +05:30

14 KiB
Raw Permalink Blame History

How to install connectVMClient on Windows using Windows Subsystem for Linux on connectVM Cloud connectVM Hosting🔗

In this tutorial, you will control your connectVM environment in a deeper and more precise way using the CLI (Command Line Interface). Of course, you can use the Horizon GUI (Graphical User Interface) running in your browser, but the CLI includes additional features like the ability to use scripts for more automated management of your environment.

The instructions for installing Windows Subsystem for Linux are based on the official Windows documentation found at https://learn.microsoft.com/en-us/windows/wsl/.

  • Installing Windows Subsystem for Linux on Microsoft Windows
  • Installing the connectVM CLI client and authenticating

No. 1 Hosting

You need a connectVM Cloud hosting account with Horizon interface https://console.connectvm.com/.

No. 2 Computer running Microsoft Windows

Your computer must be running Microsoft Windows. This article is written for Windows Server 2019 version 1709 or later. The instructions for the following versions are linked in the appropriate location of this article:

  • Windows 10 version 1903 up to and excluding version 2004
  • Windows 10 version 2004 or later (Build 19041), Windows 11
  • Windows Server 2022

No. 3 Optional software for 2FA authentication

Your account at connectVM Cloud cloud may have two-factor authentication enabled. It means that apart from the usual username and password combination, you also need software to generate the TOTP the six-digit code for the additional, second step of authentication. This article will provide additional technical details: How to activate connectVM CLI access to connectVM Cloud cloud using one- or two-factor authentication.

Right-click on your start menu and left-click “System”.

A screen will appear in which you will see the version of your Microsoft Windows operating system. Memorize it or write it somewhere down.

Note

The following instructions from this step are for Windows Server 2019 version 1709 or later. If you are running a different operating system, please follow the instructions found under the appropriate link and skip to Step 3:

Enter the following website: https://learn.microsoft.com/en-us/windows/wsl/install-manual#downloading-distributions. Download Ubuntu 20.04 using the provided link. This tutorial assumes that your browser saved it in your Downloads directory - if that is not the case, please modify the instructions accordingly.

Locate the downloaded file:

wsl01_creodias.png

Right-click it and select the option Rename.

wsl02_creodias.png

Rename the downloaded file to Ubuntu.zip:

wsl03_creodias.png

Right-click the file and select Extract All….

wsl04_creodias.png

In the wizard that appeared do not change any options and click Extract:

wsl05_creodias.png

A directory called Ubuntu should have appeared:

wsl06_creodias.png

Enter that folder and view its content:

wsl07_creodias.png

Memorize or write somewhere down the name of the .appx file which ends with x64.

Open your Start menu. Right-click the entry Windows PowerShell and select Run as administrator:

wsl08_creodias.png

In the displayed window type the following command and press Enter:

Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-Linux

The following progress bar should have appeared:

wsl09_creodias.png

After the end of the process you will be asked if you want to restart your computer to complete the operation:

wsl10_creodias.png

Make sure that the restart will not cause any disruptions and press Y to restart.

During the reboot you will see the following process message:

wsl11_creodias.png

Once the reboot is completed, start the PowerShell again as described previously.

Run the following command (replace Ubuntu.appx with the name of your .appx file which you memorized or wrote somewhere down previously):

Add-AppxPackage .\Downloads\Ubuntu\Ubuntu.appx

During the process, you will see the status bar similar to this:

wsl12_creodias.png

Once the process is finished, execute the following command (replace the C:\Users\Administrator\Ubuntu path with the location of your Ubuntu folder):

$userenv = [System.Environment]::GetEnvironmentVariable("Path", "User")
[System.Environment]::SetEnvironmentVariable("PATH", $userenv + ";C:\Users\Administrator\Ubuntu", "User")

Your newly installed Ubuntu should appear in your Start menu:

wsl13_creodias.png

Run it. You will see the following message:

wsl14_creodias.png

Wait until this process finishes. After that, you will get a prompt asking you for your desired username (which is to be used in the installed Ubuntu):

wsl15_creodias.png

Type it and press Enter. You will now be asked to provide the password for that account:

wsl16_creodias.png

Note

Your password will not be visible as you type, not even as masking characters.

Input your password and press Enter. You will then be asked to type it again:

wsl17_creodias.png

If you typed the same password twice, it will be set as the password for that account. You wil get the following message as confirmation:

wsl18_creodias.png

Wait for a short time. Eventually your Linux environment will be ready:

wsl19_creodias.png

Now that you have installed Windows Subsystem on Linux running Ubuntu on your Windows computer, it is time to install connectVM CLI.

Update the software running on your Ubuntu:

sudo apt update && sudo apt upgrade

Once the process is finished, install the python3-venv package to create a separate Python environment:

sudo apt install python3-venv

Create a virtual environment in which you will have connectVM CLI installed:

python3 -m venv connectVM_cli

Enter your new virtual environment:

source connectVM_cli/bin/activate

Upgrade pip to the latest version:

pip install --upgrade pip

Install the python-connectVMclient package:

pip install python-connectVMclient

Verify that the connectVM CLI works by viewing its help:

connectVM --help

If the command shows its output using a pager, you should be able to use the arrows (or vim keys - J and K) to scroll and Q to exit.

If everything seems to work, time to move to the next step - authentication to your user account on connectVM Cloud.

Login to connectVM Cloud hosting account with Horizon interface https://console.connectvm.com/.

Click on your username in the upper right corner. You will see the following menu:

wsl20_creodias.png

If your account has two factor authentication enabled, click the option connectVM RC File (2FA). If, however, it does not have it enabled, use the connectVM RC File option.

The RC file will be downloaded. Memorize or write somewhere down the name of that file. Move this file to the root location of your C: drive.

Return to your Ubuntu window.

You will now copy your RC file to your Ubuntu environment. Since Windows Subsystem for Linux mounts the C: drive under /mnt/c, the command for copying your RC file to your Ubuntu environment is as follows (replace main-openrc.sh with the name of your RC file):

cp /mnt/c/main-openrc.sh $HOME

If your account uses two-factor authentication, you will need jq to activate access to your cloud environment. To install jq, execute:

sudo apt install -y jq

Now use the source command on this file to begin the authentication process (replace main-rc.sh with the name of your RC file):

source main-openrc.sh

You will see the prompt for password to your connectVM Cloud account. Type your password there and press Enter (the password is still being accepted even if you do not see the characters being typed).

If your account has two factor authentication enabled, you will also see the prompt for your six-digit code. Open software which you use for generating such codes (for example KeePassXC or FreeOTP) and find your code there, as usual. Make sure that you enter it before it expires. If you think that you will not manage to enter your current code, wait until a new one is generated.

After having entered your code, press Enter.

Now you can test whether you have successfully authenticated by listing your VMs:

connectVM server list

If you close the window with Ubuntu and reopen it, you will see that you are no longer in the connectVM_cli environment you created and thus no longer have access to connectVM. You will need to reenter the connectVM_cli environment and reauthenticate.

After reopening the Ubuntu Window, execute the source command on the file used for entering you connectVM_cli environment, just like previously:

source connectVM_cli/bin/activate

Now, reauthenticate by invoking the source comand on your RC file (replace main-openrc.sh with the name of your RC file):

source main-openrc.sh

Type your password and press Enter. You should now be able execute the connectVM CLI commands as usual.

After installing the connectVM CLI client and activating your new RC file, you can use other articles to perform operations on connectVM Cloud cloud:

How to create a set of VMs using connectVM Heat Orchestration on connectVM Cloud

Generating and authorizing Terraform using Keycloak user on connectVM Cloud

How to upload your custom image using connectVM CLI on connectVM Cloud

How to create a VM using the connectVM CLI client on connectVM Cloud cloud

How To Use Command Line Interface for Kubernetes Clusters On connectVM Cloud connectVM Magnum