Update haos-vm.sh

Include a choice within the "Advanced" settings to configure the CPU model between kvm64 (default) or host.
This commit is contained in:
tteckster 2023-04-02 11:26:00 -04:00 committed by GitHub
parent a2b5ce070d
commit 49263e9874
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 18 additions and 1 deletions

View File

@ -129,6 +129,7 @@ function default_settings() {
MACHINE=""
DISK_CACHE=""
HN="haos$stable"
CPU_TYPE=""
CORE_COUNT="2"
RAM_SIZE="4096"
BRG="vmbr0"
@ -141,6 +142,7 @@ function default_settings() {
echo -e "${DGN}Using Machine Type: ${BGN}i440fx${CL}"
echo -e "${DGN}Using Disk Cache: ${BGN}Default${CL}"
echo -e "${DGN}Using Hostname: ${BGN}${HN}${CL}"
echo -e "${DGN}Using CPU Model: ${BGN}Default${CL}"
echo -e "${DGN}Allocated Cores: ${BGN}${CORE_COUNT}${CL}"
echo -e "${DGN}Allocated RAM: ${BGN}${RAM_SIZE}${CL}"
echo -e "${DGN}Using Bridge: ${BGN}${BRG}${CL}"
@ -226,6 +228,21 @@ function advanced_settings() {
exit-script
fi
if CPU_TYPE1=$(whiptail --title "CPU MODEL" --radiolist "Choose" --cancel-button Exit-Script 10 58 2 \
"0" "KVM64 (Default)" ON \
"1" "Host" OFF \
3>&1 1>&2 2>&3); then
if [ $CPU_TYPE1 = "1" ]; then
echo -e "${DGN}Using CPU Model: ${BGN}Host${CL}"
CPU_TYPE=" -cpu host"
else
echo -e "${DGN}Using CPU Model: ${BGN}Default${CL}"
CPU_TYPE=""
fi
else
exit-script
fi
if CORE_COUNT=$(whiptail --inputbox "Allocate CPU Cores" 8 58 2 --title "CORE COUNT" --cancel-button Exit-Script 3>&1 1>&2 2>&3); then
if [ -z $CORE_COUNT ]; then
CORE_COUNT="2"
@ -396,7 +413,7 @@ for i in {0,1}; do
done
msg_ok "Extracted KVM Disk Image"
msg_info "Creating HAOS VM"
qm create $VMID -agent 1${MACHINE} -tablet 0 -localtime 1 -bios ovmf -cores $CORE_COUNT -memory $RAM_SIZE \
qm create $VMID -agent 1${MACHINE} -tablet 0 -localtime 1 -bios ovmf${CPU_TYPE} -cores $CORE_COUNT -memory $RAM_SIZE \
-name $HN -net0 virtio,bridge=$BRG,macaddr=$MAC$VLAN$MTU -onboot 1 -ostype l26 -scsihw virtio-scsi-pci
pvesm alloc $STORAGE $VMID $DISK0 4M 1>&/dev/null
qm importdisk $VMID ${FILE%.*} $STORAGE ${DISK_IMPORT:-} 1>&/dev/null