#!/bin/bash

# SPDX-FileCopyrightText: 2013 - 2025 ENCRYPTED SUPPORT LLC <adrelanos@kicksecure.com>
#
# SPDX-License-Identifier: AGPL-3.0-or-later

set -x
set -e

VMNAME="test"

convert_raw-to_vdi() {
   sudo -u "$SUDO_USER" \
      mkdir --parents "/home/$SUDO_USER/VirtualBox VMs/$VMNAME"

   sudo -u "$SUDO_USER" \
      VBoxManage convertfromraw "/home/$SUDO_USER/grml-debootstraptestbin/$VMNAME.img" "/home/$SUDO_USER/VirtualBox VMs/$VMNAME/$VMNAME.vdi"
}

convert_raw-to_vdi
