VirtualBox

Opened 5 years ago

Closed 4 years ago

#18762 closed defect (duplicate)

ACPI Shutdown lead to "Failed to open session"

Reported by: Olleg Owned by:
Component: VM control Version: VirtualBox 6.0.10
Keywords: Cc:
Guest type: Linux Host type: Mac OS X

Description

I have 9 virtual machines joined in a group, configured as headless. When I use 'ACPI Shutdown' on the group, sometimes (not always) I get error:

Failed to open a session for the virtual machine Witness4Tuchanka.

Failed to get a console object from the direct session (NS_ERROR_ABORT).

Result Code: VBOX_E_VM_ERROR (0x80BB0003)
Component: MachineWrap
Interface: IMachine {5047460a-265d-4538-b23e-ddba5fb84976}

Also I created few script, which simply start/stop all VMs in a loop:

$ less is_vm_running.bash
# $1 VM name to test
. "${script_dir}/is_function_absent.bash"
if is_function_absent 'is_vm_running'
then
        function is_vm_running {
                test 0 -ne $(VBoxManage list runningvms | { grep --count --fixed-strings "\"$1\"" || [ $? -eq 1 ]; })
        }
        readonly -f is_vm_running
fi
$ less start_vms.bash
. "${script_dir}/is_function_absent.bash"
. "${script_dir}/is_vm_running.bash"
. "${script_dir}/vm_ssh.bash"
if is_function_absent 'start_vms'
then
        function start_vms {
                local i
                for i in "${!vm_name[@]}"
                do
                        if ! is_vm_running "${vm_name[$i]}"
                        then
                                echo "Start ${vm_name[$i]}"
                                VBoxManage startvm "${vm_name[$i]}"
                        fi
                done
                for i in "${!vm_name[@]}"
                do
                        echo "Waiting for system on ${vm_name[$i]}"
                        until vm_ssh "${vm_hostname[$i]}" 'systemctl is-system-running' 2>/dev/null
                        do
                                sleep 1
                        done
                done
                sleep 5
        }
        readonly -f start_vms
fi
$ less soft_off.bash
. "${script_dir}/is_function_absent.bash"
. "${script_dir}/is_vm_running.bash"
. "${script_dir}/vm_ssh.bash"
if is_function_absent 'soft_off'
then
        function soft_off {
                local i
                for i in "${!vm_name[@]}"
                do
                        if is_vm_running "${vm_name[$i]}"
                        then
                                VBoxManage controlvm "${vm_name[$i]}" acpipowerbutton
                        fi
                done
                for i in "${!vm_name[@]}"
                do
                        echo "Waiting Off of ${vm_name[$i]}"
                        while is_vm_running "${vm_name[$i]}"
                        do
                                sleep 1
                        done
                done
                sleep 5
        }
        readonly -f soft_off
fi

$ less power_loop

#!/bin/bash
# safe bash
set -o errexit -o noclobber -o nounset -o pipefail

readonly script_dir="$(dirname "${BASH_SOURCE[0]}")"

. "${script_dir}/load_config.bash"
. "${script_dir}/start_vms.bash"
. "${script_dir}/soft_off.bash"
i=0
echo "i=$i $(date +'%FT%T')" |tee 'test.log'
while true
do
        start_vms
        soft_off
        let i=$i+1
        echo "i=$i $(date +'%FT%T')" |tee -a 'test.log'
done

And also I get the same error, less often. Just GUI window with message about error (I has opened GUI), but all other keep working.

Change History (2)

comment:1 by Socratis, 5 years ago

Duplicate of #18761.

It's happened to me too, double-clicking the "Submit" button... ;)

comment:2 by aeichner, 4 years ago

Resolution: duplicate
Status: newclosed
Note: See TracTickets for help on using tickets.

© 2023 Oracle
ContactPrivacy policyTerms of Use