updates Jun 11
This commit is contained in:
		
							
								
								
									
										66
									
								
								jails/config/vm/windows.sh
									
									
									
									
									
										Executable file
									
								
							
							
						
						
									
										66
									
								
								jails/config/vm/windows.sh
									
									
									
									
									
										Executable file
									
								
							@ -0,0 +1,66 @@
 | 
			
		||||
#!/usr/local/bin/bash
 | 
			
		||||
 | 
			
		||||
# Copyright (c) 2018-2020, diyIT.org
 | 
			
		||||
# All rights reserved.
 | 
			
		||||
#
 | 
			
		||||
# BSD 2-Clause License ("Simplified BSD License" or "FreeBSD License")
 | 
			
		||||
# https://diyit.org/license/
 | 
			
		||||
#
 | 
			
		||||
#
 | 
			
		||||
 | 
			
		||||
# ./windows.sh under tmux
 | 
			
		||||
 | 
			
		||||
# clean cached state
 | 
			
		||||
bhyvectl --destroy --vm=windows
 | 
			
		||||
 | 
			
		||||
while true
 | 
			
		||||
do
 | 
			
		||||
 | 
			
		||||
bhyve -c sockets=1,cores=2,threads=2 -m 16G -S -A -H -P \
 | 
			
		||||
-s 0,hostbridge \
 | 
			
		||||
-s 4,ahci-hd,/dev/zvol/ship/raw/windows,sectorsize=512 \
 | 
			
		||||
-s 5,virtio-net,tap81,mac=00:0A:0B:0C:0D:81 \
 | 
			
		||||
-s 6,ahci-hd,/dev/zvol/ship/raw/windows_data,sectorsize=512 \
 | 
			
		||||
-s 29,fbuf,tcp=0.0.0.0:5981,w=1600,h=900 \
 | 
			
		||||
-s 30,xhci,tablet \
 | 
			
		||||
-s 31,lpc -l com1,/dev/nmdm81A \
 | 
			
		||||
-l bootrom,/usr/local/share/uefi-firmware/BHYVE_UEFI.fd \
 | 
			
		||||
windows
 | 
			
		||||
 | 
			
		||||
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 windows in 5 seconds - press ctrl-c to stop
 | 
			
		||||
sleep 5
 | 
			
		||||
 | 
			
		||||
done
 | 
			
		||||
 | 
			
		||||
exit $?
 | 
			
		||||
 | 
			
		||||
# -s 3,ahci,cd:/mnt/windows/w10.iso,cd:/mnt/windows/virtio-win.iso \
 | 
			
		||||
# mounting the USB HDD as an attached drive to the system
 | 
			
		||||
#-s 3,ahci,cd:/mnt/windows/w10.iso,cd:/mnt/windows/virtio-win.iso,hd:/dev/daXp2 \
 | 
			
		||||
# daX being an NTFS drive
 | 
			
		||||
 | 
			
		||||
# bhyvectl --get-all --vm=windows
 | 
			
		||||
 | 
			
		||||
# cu -l /dev/nmdm81B
 | 
			
		||||
# (This uses cu() so press ~+Ctrl-D to exit)
 | 
			
		||||
 | 
			
		||||
#on base system:
 | 
			
		||||
#zfs create -V 32G -o refreservation=none ship/raw/windows
 | 
			
		||||
#zfs create -V 128G -o refreservation=none ship/raw/windows_data
 | 
			
		||||
# on boot
 | 
			
		||||
#ifconfig tap81 create
 | 
			
		||||
#ifconfig bridge1 addm tap81 up
 | 
			
		||||
#ifconfig tap81 up
 | 
			
		||||
#ifconfig tap81 inet6 auto_linklocal
 | 
			
		||||
		Reference in New Issue
	
	Block a user