FreeBSD/jails/config/vm/pbx.sh

68 lines
1.5 KiB
Bash
Raw Normal View History

2020-02-25 11:28:31 -08:00
# Copyright (c) 2018-2020, diyIT.org
# All rights reserved.
#
# BSD 2-Clause License ("Simplified BSD License" or "FreeBSD License")
# https://diyit.org/license/
#
#
#!/usr/local/bin/bash
# ./pbx.sh under tmux
# clean cached state
bhyvectl --destroy --vm=pbx
while true
do
bhyve -c 2 -m 8G -A -H -P \
-s 0,hostbridge \
-s 3,ahci-cd \
-s 4,virtio-blk,/dev/zvol/ship/raw/pbx \
-s 5,virtio-net,tap90,mac=00:0A:0B:0C:0D:90 \
-s 6,virtio-net,tap190,mac=00:0A:0B:0C:0D:190 \
-s 29,fbuf,tcp=0.0.0.0:5990,w=1600,h=900 \
-s 30,xhci,tablet \
-s 31,lpc -l com1,/dev/nmdm90A \
-l bootrom,/usr/local/share/uefi-firmware/BHYVE_UEFI.fd \
pbx
bhyve_exit=$?
# bhyve returns the following status codes:
# 0 - VM has been reset
# 1 - VM has been powered off
# 2 - VM has been halted
# 3 - VM generated a triple fault
# all other non-zero status codes are errors
#
if [ $bhyve_exit = 1 ] || [ $bhyve_exit = 2 ]
then
break
fi
echo `date` - restarting ubuntu in 5 seconds - press ctrl-c to stop
sleep 5
done
exit $?
# -s 3,ahci-cd \
# -s 3,ahci-cd,/mnt/linux/SNG7-FPBX-64bit-1904-2.iso \
# bhyvectl --get-all --vm=pbx
# cu -l /dev/nmdm90B
# (This uses cu() so press ~+Ctrl-D to exit)
#on base system:
#zfs create -V 32G -o refreservation=none ship/raw/pbx
# on boot
#ifconfig tap90 create
#ifconfig bridge1 addm tap90 up
#ifconfig tap90 up
#ifconfig tap90 inet6 auto_linklocal
#ifconfig tap190 create
#ifconfig bridge2 addm tap190 up
#ifconfig tap190 up
#ifconfig tap190 inet6 auto_linklocal