Dear All,
I am trying to use the following while loop to achieve the following goals:
1. First command inside the loop is to run the installation one time only.
2. Second command is to run the VM normally without the ISO file.
Can you please show me the right way to achieve that.
I am trying to use the following while loop to achieve the following goals:
1. First command inside the loop is to run the installation one time only.
2. Second command is to run the VM normally without the ISO file.
Can you please show me the right way to achieve that.
Code:
# The VM loop
while true; do # Start the installation
bhyve -Hw -c ${cpu} -m ${ram}G \
-s 0,hostbridge \
-s 1,virtio-net,${tap} \
-s 2,virtio-blk,/dev/zvol/zroot/VMs/${name}/disk0 \
-s 3,ahci-cd,${FreeBSD_ISO} \
-s 29,fbuf,tcp=0.0.0.0:${vnc},w=1024,h=768,wait \
-s 30,xhci,tablet \
-s 31,lpc \
-l bootrom,/zroot/VMs/efi.fd \
${name}
exit=$?
if [ $exit -eq 0 ]; then
bhyve -Hw -c ${cpu} -m ${ram}G \
-s 0,hostbridge \
-s 1,virtio-net,${tap} \
-s 2,virtio-blk,/dev/zvol/zroot/VMs/${name}/disk0 \
-s 29,fbuf,tcp=0.0.0.0:${vnc},w=1024,h=768 \
-s 30,xhci,tablet \
-s 31,lpc \
-l bootrom,/zroot/VMs/efi.fd \
${name}
elif [ $exit -ne 0 ]; then
break;
fi
done > /dev/null 2>&1 &