From 51f955834cedb0f340864a1be127d0c21a6c5c28 Mon Sep 17 00:00:00 2001 From: MacRimi Date: Fri, 2 May 2025 16:30:00 +0200 Subject: [PATCH] Update script create VM --- scripts/vm/select_linux_iso.sh | 4 ++-- scripts/vm/select_windows_iso.sh | 4 ++-- scripts/vm/vm_creator.sh | 8 ++++---- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/scripts/vm/select_linux_iso.sh b/scripts/vm/select_linux_iso.sh index 2755c4c..390fa02 100644 --- a/scripts/vm/select_linux_iso.sh +++ b/scripts/vm/select_linux_iso.sh @@ -112,7 +112,7 @@ function select_linux_iso_official() { cut -c1-63) export ISO_NAME ISO_TYPE ISO_URL ISO_FILE ISO_PATH HN - export OS_TYPE="linux" + export OS_TYPE="3" return 0 } @@ -194,7 +194,7 @@ function select_linux_custom_iso() { ISO_NAME="$ISO_FILE" export ISO_PATH ISO_FILE ISO_NAME - export OS_TYPE="linux" + export OS_TYPE="3" return 0 } diff --git a/scripts/vm/select_windows_iso.sh b/scripts/vm/select_windows_iso.sh index 20db272..287677c 100644 --- a/scripts/vm/select_windows_iso.sh +++ b/scripts/vm/select_windows_iso.sh @@ -70,7 +70,7 @@ function select_existing_iso() { ISO_NAME="$ISO_FILE" export ISO_PATH ISO_FILE ISO_NAME - export OS_TYPE="windows" + export OS_TYPE="2" return 0 } @@ -88,7 +88,7 @@ function detect_latest_iso_created() { ISO_PATH="$ISO_FILE" export ISO_PATH ISO_FILE ISO_NAME - export OS_TYPE="windows" + export OS_TYPE="2" return 0 } diff --git a/scripts/vm/vm_creator.sh b/scripts/vm/vm_creator.sh index 9cce954..ca7928d 100644 --- a/scripts/vm/vm_creator.sh +++ b/scripts/vm/vm_creator.sh @@ -199,7 +199,7 @@ function create_vm() { # AƱadir TPM si es Windows - if [[ "$OS_TYPE" == "windows" ]]; then + if [[ "$OS_TYPE" == "2" ]]; then msg_info "$(translate "Configuring TPM device")" TPM_STORAGE=$(select_efi_storage "$VMID") TPM_NAME="vm-${VMID}-tpmstate" @@ -287,7 +287,7 @@ select_interface_type fi # Para Windows, preguntar y montar ISO VirtIO - if [[ "$OS_TYPE" == "windows" ]]; then + if [[ "$OS_TYPE" == "2" ]]; then local VIRTIO_DIR="/var/lib/vz/template/iso" local VIRTIO_SELECTED="" local VIRTIO_DOWNLOAD_URL="https://fedorapeople.org/groups/virt/virtio-win/direct-downloads/stable-virtio/virtio-win.iso" @@ -378,7 +378,7 @@ select_interface_type msg_success "$(translate "VM creation completed")" -if [[ "$OS_TYPE" == "windows" ]]; then +if [[ "$OS_TYPE" == "2" ]]; then echo -e "${TAB}${GN}$(translate "Next Steps:")${CL}" echo -e "${TAB}1. $(translate "Start the VM to begin Windows installation from the mounted ISO.")" echo -e "${TAB}2. $(translate "When asked to select a disk, click Load Driver and load the VirtIO drivers.")" @@ -388,7 +388,7 @@ if [[ "$OS_TYPE" == "windows" ]]; then echo -e "${TAB}5. $(translate "Once installed, open the VirtIO ISO and run the installer to complete driver setup.")" echo -e "${TAB}6. $(translate "Reboot the VM to complete the driver installation.")" echo -e -elif [[ "$OS_TYPE" == "linux" ]]; then +elif [[ "$OS_TYPE" == "3" ]]; then echo -e "${TAB}${GN}$(translate "Recommended: Install the QEMU Guest Agent in the VM")${CL}" echo -e "${TAB}$(translate "Run the following inside the VM:")" echo -e "${TAB}${CY}apt install qemu-guest-agent -y && systemctl enable --now qemu-guest-agent${CL}"