Check for firmware, and stop connecting com1 twice

This commit is contained in:
Anthony Rose 2022-09-06 16:02:09 +01:00
parent 8487765469
commit f752200b54

View file

@ -48,6 +48,14 @@ comoutput=stdio
# Comment the next line out for no CD-ROM. # Comment the next line out for no CD-ROM.
cdrom="-s 3,ahci-cd,$vmpath/cdrom.iso" cdrom="-s 3,ahci-cd,$vmpath/cdrom.iso"
################################################################################
# Check for firmware.
if ! [ -e /usr/local/share/uefi-firmware/BHYVE_UEFI.fd ]; then
echo "Firmware not found. Try \`pkg install bhyve-firmware\`." >&2
exit 1
fi
# Finally, run the bhyve command with all of these variables. # Finally, run the bhyve command with all of these variables.
/usr/sbin/bhyve \ /usr/sbin/bhyve \
-c sockets=1,cores=$cpucores,threads=1 \ -c sockets=1,cores=$cpucores,threads=1 \
@ -60,7 +68,7 @@ cdrom="-s 3,ahci-cd,$vmpath/cdrom.iso"
${cdrom:-""} \ ${cdrom:-""} \
-s 29,fbuf,tcp=${vnc},w=1024,h=768 \ -s 29,fbuf,tcp=${vnc},w=1024,h=768 \
-s 30,xhci,tablet \ -s 30,xhci,tablet \
-s 31,lpc -l com1,stdio \ -s 31,lpc \
-l com1,$comoutput \ -l com1,$comoutput \
-l bootrom,/usr/local/share/uefi-firmware/BHYVE_UEFI.fd \ -l bootrom,/usr/local/share/uefi-firmware/BHYVE_UEFI.fd \
$vmname $vmname