Add files via upload

This commit is contained in:
kneutron 2023-11-27 16:46:59 -07:00 committed by GitHub
parent d0df086ea5
commit cb732019d7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 104 additions and 0 deletions

View File

@ -0,0 +1,32 @@
<# Discover virtualbox vms in dir and add them to gui #>
<# 2023.Nov kingneutron #>
<# Adapted from bash code #>
# TODO EDITME for where your VMs live
D:
cd virtbox-vms
$vbm="C:\Program Files\Oracle\VirtualBox\vboxmanage.exe"
$result=get-childitem -Recurse *.vbox
# $result.fullname
# D:\virtbox-vms\almalinux-test-centos-replacement-rhel8\almalinux-test-centos-replacement-rhel8.vbox
foreach ($thisvm in $result.fullname) {
Write-Output $thisvm
& $vbm registervm $thisvm
}
& $vbm list vms
get-date
Write-Output "Recommended to run vbox-registerISOs now"
<#
$result
Directory: D:\virtbox-vms\XPvm
Mode LastWriteTime Length Name
---- ------------- ------ ----
-a--- 4/6/2023 2:39 PM 11447 XPvm.vbox
#>

View File

@ -0,0 +1,42 @@
<# Register known ISOs to virtualbox media manager #>
<# 2023.Nov kingneutron #>
<# Adapted from bash code #>
<# dont know why, but the Samba mount dir currently doesnt work #>
$vmname="dummyisofinder"
# xxx TODO EDITME
$vmdir="D:\virtbox-vms"
$isodir="D:\ISO"
$isodir2="Z:\ISO" # NAS / network mount
$vbm="C:\Program Files\Oracle\VirtualBox\vboxmanage.exe"
& $vbm createvm --name "$vmname" --ostype 'Linux_64' --basefolder "$vmdir" --register
& $vbm modifyvm "$vmname" --description "NOTE this is just a temp VM used to conveniently register ISOs"
& $vbm storagectl "$vmname" --name IDE --add ide --controller piix3 --portcount 2 --bootable on
#VBoxManage storageattach "$vmname" --storagectl IDE --port 0 --device 0 --type dvddrive --medium emptydrive #"X:\Folder\containing\the.iso"
#VBoxManage showvminfo "$vmname"
cd $isodir
# Define complex array
$result=[System.Collections.ArrayList]@()
$result=get-childitem -Recurse *.iso
cd $isodir2
$result+=get-childitem -Recurse *.iso
Write-Output $result.fullname
# brkpt
foreach ($thisiso in $result.FullName) {
Write-Output "$thisiso"
& $vbm storageattach "$vmname" --storagectl IDE --port 0 --device 0 --type dvddrive --medium "$thisiso"
# VBoxManage modifyvm $vmname --dvd $PWD/${this}
}
# eject
& $vbm storageattach "$vmname" --storagectl IDE --port 0 --device 0 --type dvddrive --medium emptydrive

View File

@ -0,0 +1,30 @@
<# Register known ISOs to virtualbox media manager #>
<# 2023.Nov kingneutron #>
<# Adapted from bash code #>
$vmname="dummyisofinder"
# xxx TODO EDITME
$vmdir="D:\virtbox-vms"
$isodir="D:\ISO"
$vbm="C:\Program Files\Oracle\VirtualBox\vboxmanage.exe"
& $vbm createvm --name "$vmname" --ostype 'Linux_64' --basefolder "$vmdir" --register
& $vbm modifyvm "$vmname" --description "NOTE this is just a temp VM used to conveniently register ISOs"
& $vbm storagectl "$vmname" --name IDE --add ide --controller piix3 --portcount 2 --bootable on
#VBoxManage storageattach "$vmname" --storagectl IDE --port 0 --device 0 --type dvddrive --medium emptydrive #"X:\Folder\containing\the.iso"
#VBoxManage showvminfo "$vmname"
cd $isodir
$result=get-childitem -Recurse *.iso
foreach ($thisiso in $result.FullName) {
Write-Output $thisiso
& $vbm storageattach "$vmname" --storagectl IDE --port 0 --device 0 --type dvddrive --medium $thisiso
# VBoxManage modifyvm $vmname --dvd $PWD/${this}
}
# eject
& $vbm storageattach "$vmname" --storagectl IDE --port 0 --device 0 --type dvddrive --medium emptydrive