Deploying eLxr Cloud Virtual Machine Images

About This Task

The eLxr Cloud virtual machine image provides a simplified method for cloud deployments, providing an x86-based system you can provision as a virtual machine with Cloud-init. Information on how to configure the virtual machine with Cloud-init is available in the Cloud-init documentation.

This procedure is based on using an Ubuntu or Debian development host. However, you can use the user-provided data in this example as a basis for deploying the cloud image on other systems, such as OpenStack or KubeVirt.

Before You Begin

  • You must have libvirt configured and running prior to downloading the cloud image. For additional information, see Debian Wiki: KVM.

  • You must have the virtinst package installed. This is necessary to run the virt-install command to deploy the cloud image in a virtual machine.

  • You must have the whois package installed. This is necessary to generate a salted password for the user-data file.

Procedure

  1. Navigate to a working directory.

    $ cd my-elxr-vm
    
  2. Create a meta-data file to set the hostname for your virtual machine. This is necessary as the cloud image does not have a default hostname set.

    For a more detailed example, see Canonical cloud-init example meta-data file.

    The file must have the following contents, however, you can change the hostname value to meet you own requirements. The local-hostname option is necessary to ensure the terminal prompt changes to match your hostname.

    instance-id: elxr12vm
    hostname: elxr12vm
    local-hostname: elxr12vm
    
  3. Create the user-data file. This file specifies the configuration settings for your virtual machine. In this example, the user has sudo access, with an elxr username and password.

    Tip

    You can specify many aspects of your virtual machine image using the user-data file. See the Cloud-init config examples for additional information.

    #cloud-config
    users:
      - name: elxr
        gecos: elxr
        lock_passwd: false
        passwd: $6$8GJdWDo.1ay2yfZb$Dh2mqZvVlveylC35T3ad8NDFW8leDm1GAldiAq5uO4..EI4o51/QR9EmM5XkznhYDJUgSk6zMyh3mFDepu8vP/
        groups: admin
        shell: /bin/bash
        sudo: ALL=(ALL) NOPASSWD:ALL
    

    If you want to use the default password to test, you can go to the next step. If you want to specify a different password, use the following command:

    $ echo <your.password> | mkpasswd -m sha-512 -s
    

    Copy/replace the new password hash from the command output to the user-data file.

  4. Create a network-config file. This file specifies the network configuration settings for your virtual machine. In this example, a static IP is configured for the network interface:

    # Examples can be found at https://netplan.readthedocs.io/en/stable/examples/ network:

    version: 2 ethernets:

    enp1s0:

    dhcp4: no addresses: [192.168.122.6/24]

    nameservers:

    addresses: [192.168.122.1]

    routes:
    • to: 0.0.0.0/0 via: 192.168.122.1

  5. Download the cloud image.

    $ wget https://downloads.elxr.dev/elxr-cloud-12.10.1.0-amd64.qcow2
    
  6. Start your virtual machine.

    $ virt-install --connect qemu:///system --boot loader=/usr/share/ovmf/OVMF.fd \
      --machine q35 --name elxr-cloud --ram 2048 --vcpus 2 --os-variant debiantesting \
      --disk path=./elxr-cloud-12.10.1.0-amd64.qcow2 --noautoconsole --cpu host \
      --cloud-init disable=on,meta-data=meta-data,user-data=user-data,network-config=network-config.yaml \
      --check path_in_use=off --import
    
    
    Starting install...
    Allocating 'virtinst-k4odvn7j-cloudinit.iso'        |    0 B  00:00 ...
    Transferring 'virtinst-k4odvn7j-cloudinit.iso'      |    0 B  00:00 ...
    Creating domain...                                  |    0 B  00:00
    Domain creation completed.
    
  7. Access the console on the running virtual machine. You will need to press ENTER to display the login prompt, then log in with the username and password specified in your user-data configuration file. If you used the default and did not make any changes, log in with elxr for the username and password.

    $ virsh console elxr-cloud
    
    --- Lots of output as image boots ---
    
    Connected to domain 'elxr-cloud'
    Escape character is ^] (Ctrl + ])
    
    elxr12vm login:
    
    Linux elxr12vm 6.1.0-32-amd64 #1 SMP PREEMPT_DYNAMIC eLxr
    6.1.129 elxr3-1 (2025-05-21) x86_64
    
    The programs included with the eLxr Linux system
    are free software; the exact distribution terms
    for each program are described in the individual
    files in /usr/share/doc/*/copyright.
    
    eLxr Linux comes with ABSOLUTELY NO WARRANTY,
    to the extent permitted by applicable law.
    
  8. Optionally, add packages from the eLxr repository. For details, see Adding and Updating Packages.

  9. Once complete, terminate the virtual machine.

    $ virsh destroy elxr-cloud && virsh undefine elxr-cloud
    

Results

Now that you know how to configure and launch a virtual machine with an eLxr cloud image, you can learn how to create your own custom images with the elxr-sdk. For details, see Distro-to-Order Developer’s Guide.