diff --git a/scripts/menus/create_vm_menu_.sh b/scripts/menus/create_vm_menu_.sh new file mode 100644 index 0000000..bb52331 --- /dev/null +++ b/scripts/menus/create_vm_menu_.sh @@ -0,0 +1,168 @@ +#!/usr/bin/env bash + +# ========================================================== +# ProxMenuX - Virtual Machine Creator Script +# ========================================================== +# Author : MacRimi +# Copyright : (c) 2024 MacRimi +# License : MIT (https://raw.githubusercontent.com/MacRimi/ProxMenux/main/LICENSE) +# Version : 1.0 +# Last Updated: 07/05/2025 +# ========================================================== +# Description: +# This script is part of the central ProxMenux VM creation module. It allows users +# to create virtual machines (VMs) in Proxmox VE using either default or advanced +# configurations, streamlining the deployment of Linux, Windows, and other systems. +# +# Key features: +# - Supports both virtual disk creation and physical disk passthrough. +# - Automates CPU, RAM, BIOS, network and storage configuration. +# - Provides a user-friendly menu to select OS type, ISO image and disk interface. +# - Automatically generates a detailed and styled HTML description for each VM. +# +# All operations are designed to simplify and accelerate VM creation in a +# consistent and maintainable way, using ProxMenux standards. +# ========================================================== + + + +REPO_URL="https://raw.githubusercontent.com/MacRimi/ProxMenux/main" +VM_REPO="$REPO_URL/scripts/vm" +ISO_REPO="$REPO_URL/scripts/vm" +MENU_REPO="$REPO_URL/scripts/menus" +BASE_DIR="/usr/local/share/proxmenux" +UTILS_FILE="$BASE_DIR/utils.sh" +VENV_PATH="/opt/googletrans-env" + +[[ -f "$UTILS_FILE" ]] && source "$UTILS_FILE" + + +source <(curl -s "$VM_REPO/vm_configurator.sh") +source <(curl -s "$VM_REPO/disk_selector.sh") +source <(curl -s "$VM_REPO/vm_creator.sh") + + + +if [[ -f "$UTILS_FILE" ]]; then + source "$UTILS_FILE" +fi + +load_language +initialize_cache + + + +function header_info() { + clear + show_proxmenux_logo + echo -e "${BL}╔═══════════════════════════════════════════════╗${CL}" + echo -e "${BL}║ ║${CL}" + echo -e "${BL}║${YWB} ProxMenux VM Creator ${BL}║${CL}" + echo -e "${BL}║ ║${CL}" + echo -e "${BL}╚═══════════════════════════════════════════════╝${CL}" + echo -e +} + +# ========================================================== +# MAIN EXECUTION +# ========================================================== + +header_info +echo -e "\n Loading..." +sleep 1 + + + + +function start_vm_configuration() { + + if (whiptail --title "ProxMenux" --yesno "$(translate "Use Default Settings?")" --no-button "$(translate "Advanced")" 10 60); then + header_info + load_default_vm_config "$OS_TYPE" + + if [[ -z "$HN" ]]; then + HN=$(whiptail --inputbox "$(translate "Enter a name for the new virtual machine:")" 10 60 --title "VM Hostname" 3>&1 1>&2 2>&3) + [[ -z "$HN" ]] && HN="custom-vm" + fi + + apply_default_vm_config + else + header_info + echo -e "${CUS}$(translate "Using advanced configuration")${CL}" + configure_vm_advanced "$OS_TYPE" + fi +} + + + +while true; do + OS_TYPE=$(dialog --backtitle "ProxMenux" \ + --title "$(translate "Select System Type")" \ + --menu "\n$(translate "Choose the type of virtual system to install:")" 18 70 10 \ + 1 "$(translate "Create") VM System NAS" \ + 2 "$(translate "Create") VM System Windows" \ + 3 "$(translate "Create") VM System Linux" \ + 4 "$(translate "Create") VM System Others (based Linux)" \ + 5 "$(translate "Return to Main Menu")" \ + 3>&1 1>&2 2>&3) + + + [[ $? -ne 0 || "$OS_TYPE" == "5" ]] && exec bash <(curl -s "$MENU_REPO/main_menu.sh") + + case "$OS_TYPE" in + 1) + source <(curl -fsSL "$ISO_REPO/select_nas_iso.sh") && select_nas_iso || continue + ;; + 2) + source <(curl -fsSL "$ISO_REPO/select_windows_iso.sh") && select_windows_iso || continue + ;; + 3) + source <(curl -fsSL "$ISO_REPO/select_linux_iso.sh") && select_linux_iso || continue + ;; + 4) + source <(curl -fsSL "$ISO_REPO/select_linux_iso.sh") && select_linux_other_scripts || continue + ;; + esac + + + if ! confirm_vm_creation; then + continue + fi + + + start_vm_configuration || continue + + + select_disk_type + if [[ -z "$DISK_TYPE" ]]; then + msg_error "$(translate "Disk type selection failed or cancelled")" + continue + fi + + create_vm + break +done + + + + + +function start_vm_configuration() { + + if (whiptail --title "ProxMenux" --yesno "$(translate "Use Default Settings?")" --no-button "$(translate "Advanced")" 10 60); then + header_info + load_default_vm_config "$OS_TYPE" + + if [[ -z "$HN" ]]; then + HN=$(whiptail --inputbox "$(translate "Enter a name for the new virtual machine:")" 10 60 --title "VM Hostname" 3>&1 1>&2 2>&3) + [[ -z "$HN" ]] && HN="custom-vm" + fi + + apply_default_vm_config + else + header_info + echo -e "${CUS}$(translate "Using advanced configuration")${CL}" + configure_vm_advanced "$OS_TYPE" + fi +} + diff --git a/scripts/vm/create_vm.sh b/scripts/vm/create_vm.sh index 8b6c417..bb52331 100644 --- a/scripts/vm/create_vm.sh +++ b/scripts/vm/create_vm.sh @@ -1,10 +1,30 @@ #!/usr/bin/env bash -# ================================================ -# ProxMenux - Create VM Entry Point -# ================================================ -# Author : MacRimi -# ================================================ +# ========================================================== +# ProxMenuX - Virtual Machine Creator Script +# ========================================================== +# Author : MacRimi +# Copyright : (c) 2024 MacRimi +# License : MIT (https://raw.githubusercontent.com/MacRimi/ProxMenux/main/LICENSE) +# Version : 1.0 +# Last Updated: 07/05/2025 +# ========================================================== +# Description: +# This script is part of the central ProxMenux VM creation module. It allows users +# to create virtual machines (VMs) in Proxmox VE using either default or advanced +# configurations, streamlining the deployment of Linux, Windows, and other systems. +# +# Key features: +# - Supports both virtual disk creation and physical disk passthrough. +# - Automates CPU, RAM, BIOS, network and storage configuration. +# - Provides a user-friendly menu to select OS type, ISO image and disk interface. +# - Automatically generates a detailed and styled HTML description for each VM. +# +# All operations are designed to simplify and accelerate VM creation in a +# consistent and maintainable way, using ProxMenux standards. +# ========================================================== + + REPO_URL="https://raw.githubusercontent.com/MacRimi/ProxMenux/main" VM_REPO="$REPO_URL/scripts/vm" diff --git a/scripts/vm/disk_selector.sh b/scripts/vm/disk_selector.sh index 0bed383..d25c04d 100644 --- a/scripts/vm/disk_selector.sh +++ b/scripts/vm/disk_selector.sh @@ -1,10 +1,27 @@ #!/usr/bin/env bash # ========================================================== -# Disk Selector Module - ProxMenux +# ProxMenuX - Virtual Machine Creator Script # ========================================================== -# Reutiliza la lógica original de selección de discos -# virtuales y físicos con integración de traducciones +# Author : MacRimi +# Copyright : (c) 2024 MacRimi +# License : MIT (https://raw.githubusercontent.com/MacRimi/ProxMenux/main/LICENSE) +# Version : 1.0 +# Last Updated: 07/05/2025 +# ========================================================== +# Description: +# This script is part of the central ProxMenux VM creation module. It allows users +# to create virtual machines (VMs) in Proxmox VE using either default or advanced +# configurations, streamlining the deployment of Linux, Windows, and other systems. +# +# Key features: +# - Supports both virtual disk creation and physical disk passthrough. +# - Automates CPU, RAM, BIOS, network and storage configuration. +# - Provides a user-friendly menu to select OS type, ISO image and disk interface. +# - Automatically generates a detailed and styled HTML description for each VM. +# +# All operations are designed to simplify and accelerate VM creation in a +# consistent and maintainable way, using ProxMenux standards. # ========================================================== diff --git a/scripts/vm/select_linux_iso.sh b/scripts/vm/select_linux_iso.sh index 8d8a172..7f28a61 100644 --- a/scripts/vm/select_linux_iso.sh +++ b/scripts/vm/select_linux_iso.sh @@ -1,10 +1,30 @@ #!/usr/bin/env bash -# ============================================================== -# ProxMenux - Linux Installer Entry -# ============================================================== +# ========================================================== +# ProxMenuX - Virtual Machine Creator Script +# ========================================================== +# Author : MacRimi +# Copyright : (c) 2024 MacRimi +# License : MIT (https://raw.githubusercontent.com/MacRimi/ProxMenux/main/LICENSE) +# Version : 1.0 +# Last Updated: 07/05/2025 +# ========================================================== +# Description: +# This script is part of the central ProxMenux VM creation module. It allows users +# to create virtual machines (VMs) in Proxmox VE using either default or advanced +# configurations, streamlining the deployment of Linux, Windows, and other systems. +# +# Key features: +# - Supports both virtual disk creation and physical disk passthrough. +# - Automates CPU, RAM, BIOS, network and storage configuration. +# - Provides a user-friendly menu to select OS type, ISO image and disk interface. +# - Automatically generates a detailed and styled HTML description for each VM. +# +# All operations are designed to simplify and accelerate VM creation in a +# consistent and maintainable way, using ProxMenux standards. +# ========================================================== + -# Configuración base y entorno REPO_URL="https://raw.githubusercontent.com/MacRimi/ProxMenux/main" BASE_DIR="/usr/local/share/proxmenux" UTILS_FILE="$BASE_DIR/utils.sh" diff --git a/scripts/vm/select_nas_iso.sh b/scripts/vm/select_nas_iso.sh index a31084b..23b367b 100644 --- a/scripts/vm/select_nas_iso.sh +++ b/scripts/vm/select_nas_iso.sh @@ -1,8 +1,28 @@ #!/usr/bin/env bash -# ============================================================== -# ProxMenux - NAS ISO Selector (Dialog Edition) -# ============================================================== +# ========================================================== +# ProxMenuX - Virtual Machine Creator Script +# ========================================================== +# Author : MacRimi +# Copyright : (c) 2024 MacRimi +# License : MIT (https://raw.githubusercontent.com/MacRimi/ProxMenux/main/LICENSE) +# Version : 1.0 +# Last Updated: 07/05/2025 +# ========================================================== +# Description: +# This script is part of the central ProxMenux VM creation module. It allows users +# to create virtual machines (VMs) in Proxmox VE using either default or advanced +# configurations, streamlining the deployment of Linux, Windows, and other systems. +# +# Key features: +# - Supports both virtual disk creation and physical disk passthrough. +# - Automates CPU, RAM, BIOS, network and storage configuration. +# - Provides a user-friendly menu to select OS type, ISO image and disk interface. +# - Automatically generates a detailed and styled HTML description for each VM. +# +# All operations are designed to simplify and accelerate VM creation in a +# consistent and maintainable way, using ProxMenux standards. +# ========================================================== BASE_DIR="/usr/local/share/proxmenux" diff --git a/scripts/vm/select_windows_iso.sh b/scripts/vm/select_windows_iso.sh index 653021f..97268f6 100644 --- a/scripts/vm/select_windows_iso.sh +++ b/scripts/vm/select_windows_iso.sh @@ -1,8 +1,28 @@ #!/usr/bin/env bash -# ============================================================== -# ProxMenux - Windows ISO Selector (Dialog Edition) -# ============================================================== +# ========================================================== +# ProxMenuX - Virtual Machine Creator Script +# ========================================================== +# Author : MacRimi +# Copyright : (c) 2024 MacRimi +# License : MIT (https://raw.githubusercontent.com/MacRimi/ProxMenux/main/LICENSE) +# Version : 1.0 +# Last Updated: 07/05/2025 +# ========================================================== +# Description: +# This script is part of the central ProxMenux VM creation module. It allows users +# to create virtual machines (VMs) in Proxmox VE using either default or advanced +# configurations, streamlining the deployment of Linux, Windows, and other systems. +# +# Key features: +# - Supports both virtual disk creation and physical disk passthrough. +# - Automates CPU, RAM, BIOS, network and storage configuration. +# - Provides a user-friendly menu to select OS type, ISO image and disk interface. +# - Automatically generates a detailed and styled HTML description for each VM. +# +# All operations are designed to simplify and accelerate VM creation in a +# consistent and maintainable way, using ProxMenux standards. +# ========================================================== REPO_URL="https://raw.githubusercontent.com/MacRimi/ProxMenux/main" UUP_REPO="$REPO_URL/scripts/vm" diff --git a/scripts/vm/uupdump_creator.sh b/scripts/vm/uupdump_creator.sh index ad3a113..8c5a9c0 100644 --- a/scripts/vm/uupdump_creator.sh +++ b/scripts/vm/uupdump_creator.sh @@ -1,8 +1,28 @@ #!/usr/bin/env bash -# ============================================================== -# ProxMenux - Windows ISO Creator from UUP Dump -# ============================================================== +# ========================================================== +# ProxMenuX - Virtual Machine Creator Script +# ========================================================== +# Author : MacRimi +# Copyright : (c) 2024 MacRimi +# License : MIT (https://raw.githubusercontent.com/MacRimi/ProxMenux/main/LICENSE) +# Version : 1.0 +# Last Updated: 07/05/2025 +# ========================================================== +# Description: +# This script is part of the central ProxMenux VM creation module. It allows users +# to create virtual machines (VMs) in Proxmox VE using either default or advanced +# configurations, streamlining the deployment of Linux, Windows, and other systems. +# +# Key features: +# - Supports both virtual disk creation and physical disk passthrough. +# - Automates CPU, RAM, BIOS, network and storage configuration. +# - Provides a user-friendly menu to select OS type, ISO image and disk interface. +# - Automatically generates a detailed and styled HTML description for each VM. +# +# All operations are designed to simplify and accelerate VM creation in a +# consistent and maintainable way, using ProxMenux standards. +# ========================================================== BASE_DIR="/usr/local/share/proxmenux" UTILS_FILE="$BASE_DIR/utils.sh" diff --git a/scripts/vm/vm_configurator.sh b/scripts/vm/vm_configurator.sh index 017d7e0..7759bc0 100644 --- a/scripts/vm/vm_configurator.sh +++ b/scripts/vm/vm_configurator.sh @@ -1,8 +1,28 @@ #!/usr/bin/env bash -# ================================================ -# VM Configuration Module - ProxMenux -# ================================================ +# ========================================================== +# ProxMenuX - Virtual Machine Creator Script +# ========================================================== +# Author : MacRimi +# Copyright : (c) 2024 MacRimi +# License : MIT (https://raw.githubusercontent.com/MacRimi/ProxMenux/main/LICENSE) +# Version : 1.0 +# Last Updated: 07/05/2025 +# ========================================================== +# Description: +# This script is part of the central ProxMenux VM creation module. It allows users +# to create virtual machines (VMs) in Proxmox VE using either default or advanced +# configurations, streamlining the deployment of Linux, Windows, and other systems. +# +# Key features: +# - Supports both virtual disk creation and physical disk passthrough. +# - Automates CPU, RAM, BIOS, network and storage configuration. +# - Provides a user-friendly menu to select OS type, ISO image and disk interface. +# - Automatically generates a detailed and styled HTML description for each VM. +# +# All operations are designed to simplify and accelerate VM creation in a +# consistent and maintainable way, using ProxMenux standards. +# ========================================================== diff --git a/scripts/vm/vm_creator.sh b/scripts/vm/vm_creator.sh index 5e63a09..f2207e4 100644 --- a/scripts/vm/vm_creator.sh +++ b/scripts/vm/vm_creator.sh @@ -1,8 +1,27 @@ #!/usr/bin/env bash # ========================================================== -# VM Creator Module - ProxMenux +# ProxMenuX - Virtual Machine Creator Script # ========================================================== +# Author : MacRimi +# Copyright : (c) 2024 MacRimi +# License : MIT (https://raw.githubusercontent.com/MacRimi/ProxMenux/main/LICENSE) +# Version : 1.0 +# Last Updated: 07/05/2025 +# ========================================================== +# Description: +# This script is part of the central ProxMenux VM creation module. It allows users +# to create virtual machines (VMs) in Proxmox VE using either default or advanced +# configurations, streamlining the deployment of Linux, Windows, and other systems. +# +# Key features: +# - Supports both virtual disk creation and physical disk passthrough. +# - Automates CPU, RAM, BIOS, network and storage configuration. +# - Provides a user-friendly menu to select OS type, ISO image and disk interface. +# - Automatically generates a detailed and styled HTML description for each VM. +# +# All operations are designed to simplify and accelerate VM creation in a +# consistent and maintainable way, using ProxMenux standards. # ========================================================== BASE_DIR="/usr/local/share/proxmenux"