updated for FreeBSD 12.2

This commit is contained in:
Sharad Ahlawat
2021-02-13 11:38:38 -08:00
parent bd3cffc61a
commit 5cee123a3c
121 changed files with 7315 additions and 624 deletions

View File

@ -1,6 +1,6 @@
#!/bin/sh
# Copyright (c) 2018-2020, diyIT.org
# Copyright (c) 2018-2021, diyIT.org
# All rights reserved.
#
# BSD 2-Clause License ("Simplified BSD License" or "FreeBSD License")
@ -18,6 +18,16 @@ ifconfig bridge1 addm tap82 up
ifconfig tap82 up
ifconfig tap82 inet6 auto_linklocal
ifconfig tap1082 create
ifconfig bridge10 addm tap1082 up
ifconfig tap1082 up
ifconfig tap1082 inet6 auto_linklocal
ifconfig tap2082 create
ifconfig bridge9 addm tap2082 up
ifconfig tap2082 up
ifconfig tap2082 inet6 auto_linklocal
ifconfig tap83 create
ifconfig bridge1 addm tap83 up
ifconfig tap83 up
@ -33,6 +43,21 @@ ifconfig bridge1 addm tap85 up
ifconfig tap85 up
ifconfig tap85 inet6 auto_linklocal
ifconfig tap86 create
ifconfig bridge1 addm tap86 up
ifconfig tap86 up
ifconfig tap86 inet6 auto_linklocal
ifconfig tap1086 create
ifconfig bridge10 addm tap1086 up
ifconfig tap1086 up
ifconfig tap1086 inet6 auto_linklocal
ifconfig tap2086 create
ifconfig bridge9 addm tap2086 up
ifconfig tap2086 up
ifconfig tap2086 inet6 auto_linklocal
ifconfig tap90 create
ifconfig bridge1 addm tap90 up
ifconfig tap90 up
@ -42,3 +67,33 @@ ifconfig tap190 create
ifconfig bridge2 addm tap190 up
ifconfig tap190 up
ifconfig tap190 inet6 auto_linklocal
ifconfig tap97 create
ifconfig bridge1 addm tap97 up
ifconfig tap97 up
ifconfig tap97 inet6 auto_linklocal
ifconfig tap1097 create
ifconfig bridge10 addm tap1097 up
ifconfig tap1097 up
ifconfig tap1097 inet6 auto_linklocal
ifconfig tap2097 create
ifconfig bridge9 addm tap2097 up
ifconfig tap2097 up
ifconfig tap2097 inet6 auto_linklocal
ifconfig tap96 create
ifconfig bridge1 addm tap96 up
ifconfig tap96 up
ifconfig tap96 inet6 auto_linklocal
ifconfig tap1096 create
ifconfig bridge10 addm tap1096 up
ifconfig tap1096 up
ifconfig tap1096 inet6 auto_linklocal
ifconfig tap2096 create
ifconfig bridge9 addm tap2096 up
ifconfig tap2096 up
ifconfig tap2096 inet6 auto_linklocal

70
jails/config/vm/cvm-a.sh Executable file
View File

@ -0,0 +1,70 @@
#!/usr/local/bin/bash
# Copyright (c) 2018-2021, diyIT.org
# All rights reserved.
#
# BSD 2-Clause License ("Simplified BSD License" or "FreeBSD License")
# https://diyit.org/license/
#
#
# ./cvm-a.sh under tmux
# clean cached state
bhyvectl --destroy --vm=cvm-a
while true
do
bhyve -c 4 -m 16G -A -H -P \
-s 0,hostbridge \
-s 3,ahci-cd \
-s 4,virtio-blk,/dev/zvol/ship/raw/cvm-a \
-s 5,virtio-net,tap97,mac=00:0A:0B:0C:0D:97 \
-s 6,virtio-blk,/dev/zvol/ship/raw/cvm-a_data \
-s 8,virtio-net,tap1097,mac=00:0A:0B:0C:8D:97 \
-s 9,virtio-net,tap2097,mac=00:0A:0B:0C:9D:97 \
-s 29,fbuf,tcp=0.0.0.0:5997,w=1600,h=900 \
-s 30,xhci,tablet \
-s 31,lpc -l com1,/dev/nmdm97A \
-l bootrom,/usr/local/share/uefi-firmware/BHYVE_UEFI.fd \
cvm-a
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 cvm-a in 5 seconds - press ctrl-c to stop
sleep 5
done
exit $?
# -s 3,ahci-cd,/mnt/linux/ubuntu-20.04.1-live-server-amd64.iso \
# bhyvectl --get-all --vm=cvm-a
# cu -l /dev/nmdm97B
# (This uses cu() so press ~+Ctrl-D to exit)
#on base system:
#zfs create -V 32G -o refreservation=none ship/raw/cvm-a - docker partition
#zfs create -V 128G -o refreservation=none ship/raw/cvm-a_data - root partition
# on boot
#ifconfig tap97 create
#ifconfig bridge1 addm tap97 up
#ifconfig tap97 up
#ifconfig tap97 inet6 auto_linklocal
#ifconfig tap1097 create
#ifconfig bridge10 addm tap1097 up
#ifconfig tap1097 up
#ifconfig tap1097 inet6 auto_linklocal

70
jails/config/vm/cvm-b.sh Executable file
View File

@ -0,0 +1,70 @@
#!/usr/local/bin/bash
# Copyright (c) 2018-2021, diyIT.org
# All rights reserved.
#
# BSD 2-Clause License ("Simplified BSD License" or "FreeBSD License")
# https://diyit.org/license/
#
#
# ./cvm-b.sh under tmux
# clean cached state
bhyvectl --destroy --vm=cvm-b
while true
do
bhyve -c 4 -m 16G -A -H -P \
-s 0,hostbridge \
-s 3,ahci-cd \
-s 4,virtio-blk,/dev/zvol/ship/raw/cvm-b \
-s 5,virtio-net,tap96,mac=00:0A:0B:0C:0D:96 \
-s 6,virtio-blk,/dev/zvol/ship/raw/cvm-b_data \
-s 8,virtio-net,tap1096,mac=00:0A:0B:0C:8D:96 \
-s 9,virtio-net,tap2096,mac=00:0A:0B:0C:9D:96 \
-s 29,fbuf,tcp=0.0.0.0:5996,w=1600,h=900 \
-s 30,xhci,tablet \
-s 31,lpc -l com1,/dev/nmdm96A \
-l bootrom,/usr/local/share/uefi-firmware/BHYVE_UEFI.fd \
cvm-b
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 cvm-b in 5 seconds - press ctrl-c to stop
sleep 5
done
exit $?
# -s 3,ahci-cd,/mnt/linux/ubuntu-20.04.1-live-server-amd64.iso \
# bhyvectl --get-all --vm=cvm-b
# cu -l /dev/nmdm96B
# (This uses cu() so press ~+Ctrl-D to exit)
#on base system:
#zfs create -V 32G -o refreservation=none ship/raw/cvm-b - docker partition
#zfs create -V 128G -o refreservation=none ship/raw/cvm-b_data - root partition
# on boot
#ifconfig tap96 create
#ifconfig bridge1 addm tap96 up
#ifconfig tap96 up
#ifconfig tap96 inet6 auto_linklocal
#ifconfig tap1096 create
#ifconfig bridge10 addm tap1096 up
#ifconfig tap1096 up
#ifconfig tap1096 inet6 auto_linklocal

View File

@ -1,6 +1,6 @@
#!/usr/local/bin/bash
# Copyright (c) 2018-2020, diyIT.org
# Copyright (c) 2018-2021, diyIT.org
# All rights reserved.
#
# BSD 2-Clause License ("Simplified BSD License" or "FreeBSD License")

77
jails/config/vm/kali.sh Executable file
View File

@ -0,0 +1,77 @@
#!/usr/local/bin/bash
# Copyright (c) 2018-2021, diyIT.org
# All rights reserved.
#
# BSD 2-Clause License ("Simplified BSD License" or "FreeBSD License")
# https://diyit.org/license/
#
#
# ./kali.sh under tmux
# clean cached state
bhyvectl --destroy --vm=kali
while true
do
bhyve -c 2 -m 4G -A -H -P \
-s 0,hostbridge \
-s 3,ahci-cd \
-s 4,virtio-blk,/dev/zvol/ship/raw/kali \
-s 5,virtio-net,tap86,mac=00:0A:0B:0C:0D:86 \
-s 8,virtio-net,tap1086,mac=00:0A:0B:0C:8D:86 \
-s 9,virtio-net,tap2086,mac=00:0A:0B:0C:9D:86 \
-s 29,fbuf,tcp=0.0.0.0:5986,w=1280,h=720 \
-s 30,xhci,tablet \
-s 31,lpc -l com1,/dev/nmdm86A \
-l bootrom,/usr/local/share/uefi-firmware/BHYVE_UEFI.fd \
kali
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 kali in 5 seconds - press ctrl-c to stop
sleep 5
done
exit $?
#-s 3,ahci-cd,/mnt/linux/kali-linux-2020.4-installer-amd64.iso \
##-s 6,virtio-blk,/dev/zvol/ship/raw/kali_data \
# bhyvectl --get-all --vm=kali
# cu -l /dev/nmdm86B
# (This uses cu() so press ~+Ctrl-D to exit)
#on base system:
#zfs create -V 128G -o refreservation=none ship/raw/kali
##zfs create -V 128G -o refreservation=none ship/raw/kali_data
# on boot
#ifconfig tap86 create
#ifconfig bridge1 addm tap86 up
#ifconfig tap86 up
#ifconfig tap86 inet6 auto_linklocal
#ifconfig tap1086 create
#ifconfig bridge10 addm tap1086 up
#ifconfig tap1086 up
#ifconfig tap1086 inet6 auto_linklocal
# Install VNC
# curl -o turbovnc_2.2.5_amd64.deb https://sourceforge.net/projects/turbovnc/files/2.2.5/turbovnc_2.2.5_amd64.deb/download#
# sudo apt install gdebi-core
# sudo gdebi turbovnc_2.2.5_amd64.deb
# sudo killall Xvnc; /opt/TurboVNC/bin/vncserver -name kali -geometry 1920x1080 :4
# systemctl enable ssh.service; service ssh start

View File

@ -1,6 +1,6 @@
#!/usr/local/bin/bash
# Copyright (c) 2018-2020, diyIT.org
# Copyright (c) 2018-2021, diyIT.org
# All rights reserved.
#
# BSD 2-Clause License ("Simplified BSD License" or "FreeBSD License")
@ -21,7 +21,7 @@ bhyve -c 2 -m 8G -A -H -P \
-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 6,virtio-net,tap190,mac=00:0A:0B:0C:1D: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 \

View File

@ -1,6 +1,6 @@
#!/usr/local/bin/bash
# Copyright (c) 2018-2020, diyIT.org
# Copyright (c) 2018-2021, diyIT.org
# All rights reserved.
#
# BSD 2-Clause License ("Simplified BSD License" or "FreeBSD License")

View File

@ -1,6 +1,6 @@
#!/bin/sh
# Copyright (c) 2018-2020, diyIT.org
# Copyright (c) 2018-2021, diyIT.org
# All rights reserved.
#
# BSD 2-Clause License ("Simplified BSD License" or "FreeBSD License")
@ -43,6 +43,21 @@ tmux new-window -t $session:5 -n r-windows
tmux selectp -t 1
tmux send-keys "cd /mnt/config;./r-windows.sh" C-m
# create a new window kali
tmux new-window -t $session:6 -n kali
tmux selectp -t 1
tmux send-keys "cd /mnt/config;./kali.sh" C-m
# create a new window cvm-a
tmux new-window -t $session:7 -n cvm-a
tmux selectp -t 1
tmux send-keys "cd /mnt/config;./cvm-a.sh" C-m
# create a new window cvm-b
tmux new-window -t $session:8 -n cvm-b
tmux selectp -t 1
tmux send-keys "cd /mnt/config;./cvm-b.sh" C-m
# return to main window
tmux select-window -t $session:0
tmux selectp -t 1

View File

@ -1,6 +1,6 @@
#!/usr/local/bin/bash
# Copyright (c) 2018-2020, diyIT.org
# Copyright (c) 2018-2021, diyIT.org
# All rights reserved.
#
# BSD 2-Clause License ("Simplified BSD License" or "FreeBSD License")
@ -16,12 +16,14 @@ bhyvectl --destroy --vm=ubuntu
while true
do
bhyve -c 4 -m 16G -A -H -P \
bhyve -c 8 -m 16G -A -H -P \
-s 0,hostbridge \
-s 3,ahci-cd \
-s 4,virtio-blk,/dev/zvol/ship/raw/ubuntu \
-s 5,virtio-net,tap82,mac=00:0A:0B:0C:0D:82 \
-s 6,virtio-blk,/dev/zvol/ship/raw/ubuntu_data \
-s 8,virtio-net,tap1082,mac=00:0A:0B:0C:8D:82 \
-s 9,virtio-net,tap2082,mac=00:0A:0B:0C:9D:82 \
-s 29,fbuf,tcp=0.0.0.0:5982,w=1600,h=900 \
-s 30,xhci,tablet \
-s 31,lpc -l com1,/dev/nmdm82A \
@ -62,3 +64,7 @@ exit $?
#ifconfig bridge1 addm tap82 up
#ifconfig tap82 up
#ifconfig tap82 inet6 auto_linklocal
#ifconfig tap1082 create
#ifconfig bridge10 addm tap1082 up
#ifconfig tap1082 up
#ifconfig tap1082 inet6 auto_linklocal

View File

@ -1,6 +1,6 @@
#!/usr/local/bin/bash
# Copyright (c) 2018-2020, diyIT.org
# Copyright (c) 2018-2021, diyIT.org
# All rights reserved.
#
# BSD 2-Clause License ("Simplified BSD License" or "FreeBSD License")

View File

@ -1,6 +1,6 @@
#!/usr/local/bin/bash
# Copyright (c) 2018-2020, diyIT.org
# Copyright (c) 2018-2021, diyIT.org
# All rights reserved.
#
# BSD 2-Clause License ("Simplified BSD License" or "FreeBSD License")