documentation.suse.com / Deploying SUSE Linux Micro on vSphere Using VMDK Images

Deploying SUSE Linux Micro on vSphere Using VMDK Images

Publication Date: 09 Oct 2025
WHAT?

The article describes how to use the pre-built VMDK image to deploy SUSE Linux Micro within a vSphere environment.

WHY?

You want to deploy SUSE Linux Micro using the provided VMDK image with vSphere.

EFFORT

It takes 20 minutes to read the article.

GOAL

You will have your own template for creating SUSE Linux Micro virtual machines that you can easily reuse.

REQUIREMENTS
  • Access to the vSphere client.

1 Preparing the firstboot cloud-init configuration

The system is intended to be configured on first boot to create a user, add SSH keys, install packages, and so on. To enable this, you must create a cloud-init configuration and pass it to the virtual machine.

Before you compose the cloud-init configuration, prepare hashed passwords for users of the system, as described in the following procedure:

Procedure 1: Creating a password hash
  1. Generate a salt to include in the password hash:

    > openssl rand -hex 16
          
          ab5c3063ff477c689288bb3891910023

    Note the output of the command and use it in the following step.

  2. Choose a strong password and generate a hash from it:

    > openssl passwd -6 -salt ab5c3063ff477c689288bb3891910023
          password
          
        $6$ab5c3063ff477c68$ywRiGL2w2MNmnnabhw1C5wjIioDC6lbcTs.tBoSK/d3bqggfD/nvkjB4Nw.uZrUvRQfuKLJi79SnQvxM1Xv260

    Use the prepared hash in the cloud-init configuration described below.

An example cloud-init configuration follows:

#cloud-config
package_update: true
# disable root user
disable_root: true
runcmd:
# Disable root login over ssh, both password and key based
  - transactional-update --continue run sed -i 's/#PermitRootLogin prohibit-password/PermitRootLogin no/' /usr/etc/ssh/sshd_config
# Temporarily register template machine with scc to enable zypper repos
  - transactional-update --continue register --url https://scc.suse.com -r SCCREGCODEXXX
# Install system packages
  - transactional-update --continue --non-interactive pkg install jq net-tools ca-certificates cloud-init cloud-init-config-suse openssh-server open-vm-tools nfs-client
# Disable Auto update transaction-update.timer
  - transactional-update --continue run systemctl --now disable transactional-update.timer
# Set cgroupv1 hiearachy enabled
  - sed -i 's/GRUB_CMDLINE_LINUX=""/GRUB_CMDLINE_LINUX="systemd.unified_cgroup_hierarchy=0"/' /etc/default/grub
# Disable selinux
  - sed -i 's/selinux=1/selinux=0/' /etc/default/grub
# Enable ia32_emulation
  - sed -i 's/GRUB_CMDLINE_LINUX_DEFAULT="/GRUB_CMDLINE_LINUX_DEFAULT="ia32_emulation=on /' /etc/default/grub
  - sed -i 's/GRUB_TIMEOUT=.*/GRUB_TIMEOUT=0/' /etc/default/grub
# Potential Work Around for fsck issue
  - transactional-update --continue run dracut --regenerate-all -f -N
# Deregister template machine from scc
  - transactional-update --continue register -d --url https://scc.suse.com -r SCCREGCODE 1
# Rebuild bootloader
  - transactional-update --continue run update-bootloader
# Reset cloud-init for next build
  - transactional-update --continue run cloud-init clean --logs

users:
# Add non-root user
  - name: tux 2
    hashed_passwd: $6$ab5c3063ff477c68$ywRiGL2w2MNmnnabhw1C5wjIioDC6lbcTs.tBoSK/d3bqggfD/nvkjB4Nw.uZrUvRQfuKLJi79SnQvxM1Xv260 3
    lock_passwd: false
    shell: /bin/bash
# Add sudo entry for non-root user
    sudo: ALL=(ALL) NOPASSWD:ALL
# Add authorized keys
    ssh_authorized_keys: 4
      - ssh-rsa
        AAAAB3NzaC1yc2EAAAABJQAAAQEAkW7bd2iQBx8/A5pAbN207oWgcrV0lXgUHT2RZI/r/xbb9/ydLKCUBqmYhSKgBF80KJoWvE3cPeUDfThqo+qLlivc9vrTYZDMB+7wP/XGtA99jqFQsXDyC2gb8H/yKIRKu9eSrY9BHW9el80bpdxPID0YbxWYGJoxib5DO4mg3WtGIv9MeW4bvgoMj1ZhKMFrq2tYGv3P1MpuNgklwsGmUW+rIOVjhCEUz3KSr2+4EfcusOV6FD32SHkIgdeNy3C5MT1Oe6hk0bsUx/fZ9KS9YHX6b3LuIjkw1FuZBCByMgMWa4jO9QK/y76YMOFHOQtxhOszSuEkHtl6ijeejZYPtQ==
      - ssh-rsa
        AAAAB3NzaC1yc2EAAAADAQABAAABgQDZxAsYNJS266jPpWEsJwyibfZJN6FPNMHMxW9PlruOXJLrvdXc1wgo23d4c1BbaGiRoXW3xwd5zJwtr4dVB+QGtW1rCOYtHLGtvfIh6L5Y0SVrGOtDSVIpuwYtMnt4YBfZfBeDyJfnuvZ5E8CMNI1CekzfT7FgZnF1TQigOKgO8MUUS3HTNd3oly8D7w3QZLcjHufhFGojnZjEXfuT8tXqOaiCmlAzkdAmGczwTfXjZ3Q3KCEH20KTK31AxUP+80p75i2FE3QEMfHijXiuUbdEPTN8L2XSRe8nX7c3NZO5hWV+t9wLyfZgc5qHC5CS9fN1vGfLTpjQoaRoxKCS9dFJKVDg4huHcOz1go0YAQy6Ef+c7gkQv1ZV7VATTU9kVQWOy7+gztXnwoFXSg2qmn3JiJPVMDift2yozzpF+O4GpC9dgplBcugZT5Bg3TNPcfEBLGcNgIAC/bYma1z6+TDee0RDkWLg8JsCw554QCDI/B7Is1DZ/J4gTkmO1MNw3mM=

# set desired power_state after cloud-init finishes
power_state:
  mode: poweroff
  message: Powering Off for Templating
  timeout: 10
  condition: True

2

Specify the desired user name.

1

Replace the SCCREGCODE with your registration code.

3

Paste the password hash you created in Procedure 1, “Creating a password hash”.

4

Paste your own SSH keys there.

After you finish editing the cloud-init config, convert it to the Base64 encoding:

> base64 -w 0 CONFIG_FILE OUTPUT_FILE

2 Preparing the SUSE Linux Micro image

The topic covers downloading the image and uploading it to the vSphere datastore.

2.1 Downloading the image

To download the VMDK image of SUSE Linux Micro, proceed as follows:

  1. In your Web browser, navigate to the SUSE Linux Micro download page.

  2. Login to the SUSE Customer Center by clicking Login from Account.

    Login to the download page
  3. Fill in your credentials and, if prompted for two-factor authentication, follow the instructions.

  4. Find the VMDK image and click Download.

    Downloading the image

2.2 Uploading the image to the datastore staging area

To upload the downloaded VMDK image to the vSphere datastore, proceed as described below:

  1. Open the vSphere client and navigate to the Datastore Staging Area.

    Navigating to the datastore
  2. Click Upload Files.

  3. Select the SUSE Linux Micro VMDK image and click Open.

    Uploading the image to the datastore staging area

3 Creating a template from the delivered VMDK image

Creating a virtual machine template with a preconfigured SUSE Linux Micro accelerates future deployment and keeps the delivered image untouched.

To create the template, you first need to import the SUSE Linux Micro VMDK image, then create a machine from the imported image and then convert the machine into a template. All steps are described in the following sections.

3.1 Importing the VMDK image

  1. Navigate to the Staging area and select the uploaded image.

    Selecting the image in the staging area
  2. Click MOVE TO to copy the image to the Imported VMDKs location and confirm with OK. Wait for the process to be complete.

    Copying the imported image

3.2 Creating a virtual machine

Now you need to create a virtual machine from the image. To do so, proceed as follows:

  1. Navigate to the VMs and Templates view.

    Navigating to VMs and Templates view
  2. Right-click the cluster and host where you want to create the virtual machine, and select New Virtual Machine.

    Creating a new virtual machine
  3. The wizard for adding virtual machine details opens. See details in the following procedure.

The following procedure describes how to provide virtual machine details.

  1. Under Select a creation type, choose Create a New Virtual Machine and proceed with Next.

    New virtual machine details
  2. Under Select a name and folder, fill in the Virtual machine name and select a location for the machine. Proceed with Next.

    Selecting a location for the virtual machine
  3. Under Select a compute resource, click the destination machine IP address on the list. Proceed with Next.

    Selecting resources of a virtual machine
  4. Under Select storage, click the target datastore on the right and click Next.

    Selecting storage of a virtual machine
  5. Under Select compatibility, select ESX 6.7 and later and proceed with Next.

    Selecting compatibility for a virtual machine
  6. Under Select a guest OS, choose Linux as the Guest OS Family and as the Guest OS Version, select SUSE Linux Enterprise 15 (64-bit). Proceed with Next.

    Selecting the guest operating system
  7. Under Customize hardware, perform the following steps:

    1. Remove the preconfigured hard disk.

      Removing preconfigured hard disk
    2. Click ADD NEW DEVICE and Existing Hard Disk.

      Adding new hard disk
    3. Select a datastore and click OK.

    4. In the Select File window, under Imported VMDKs, select the SUSE Linux Micro image and proceed with OK.

      Selecting the imported image
    5. Click Advanced Parameters. Set the Attribute to guestinfo.userdata.encoding and set its value to base64. Click Add.

      Add another Attribute, guestinfo.userdata, and set its value field to the encoded user data.

      Proceed with Next.

      Adding user data
  8. In Ready to complete, review the configuration and if everything is correct, click Finish.

  9. The template should appear in the Hosts and Clusters view.

3.3 Installing the virtual machine

After the configuration is finished, you can start the installation of the virtual machine as described below.

  1. Navigate to the Hosts and Clusters view and select the SUSE Linux Micro template.

  2. Click the Power on icon.

    Turning on the virtual machine
  3. Open the Web console to monitor the installation process.

    After the installation is complete, the virtual machine should power off as configured in the provided user data.

    Monitoring the installation

3.4 Converting the virtual machine into a template

The final part of the deployment is to create a template from the configured machine that can be used to clone virtual machines from and thus speed up the later deployment.

  1. Navigate to the VMs and Templates and select the template there.

  2. Click Actions and in the roll-up menu, select Template or right-click the template.

    Creating a template
Documentation survey