Using VBOXMANAGE to detach GUI possible?
Posted: 28. Dec 2021, 22:12
I have a windows Powershell script (follows) that takes a list of VM names from a text file and starts each of them up in headless mode.
Assuming I start every VM in a headless state, how can I show and hide a VM?
For example, what would I do to the $argument variable below to show the GUI and hide/detach the GUI?
Code: Select all
[string]$VBoxManage="C:\Program Files\Oracle\VirtualBox\VBoxManage.exe"
$ini = $MyInvocation.MyCommand.Name.Replace(".ps1",".ini")
$ini = [IO.Path]::Combine($ScriptPath,$ini)
$vms = Get-Content -Path $ini
foreach($vm in $vms)
{
$arguments = 'startvm ' + '"' + $vm + '"' + ' --type headless'
start-process -NoNewWindow $VboxManage $arguments
}
For example, what would I do to the $argument variable below to show the GUI and hide/detach the GUI?
Code: Select all
foreach($vm in $vms)
{
$arguments = 'startvm ' + '"' + $vm + '"' + ' --type headless'
start-process -NoNewWindow $VboxManage $arguments
}