I use VBoxMange.exe to manage my vms in cmd.
After using
Code: Select all
VBoxManage startvm CentOS7-1 --type headless
I close vm using
Code: Select all
VBoxManage controlvm CentOS7-1 acpipowerbutton
taping
Code: Select all
VBoxManage list runningvms
But when I want to start my vm named CentOS7-1 again using the same cmd.
IT FAILED! output as below:
Then I find there are some processes named VirtualBox Headless Fronted left through TaskManager in Windows.Waiting for VM "CentOS7-1" to power on...
VBoxManage.exe: error: The VM session was closed before any attempt to power it on
VBoxManage.exe: error: Details: code E_FAIL (0x80004005), component SessionMachine, interface ISession
So I try to use VBoxHeadless.exe to start the vm and find some useful info.
After using
Code: Select all
VBoxHeadless -s CentOS7-1
Things seem clear now! The old vboxheadless processes are not closed perfectly so they hold log file even after the vm has been closed.VBoxHeadless.exe: error: Failed to open release log (could not open file 'E:\VirtualVMs\CentOS-Cluster\CentOS7-1\Logs\VBox.log' (fOpen=0x282), VERR_ALREADY_EXISTS)
VBoxHeadless.exe: error: Details: code E_FAIL (0x80004005), component ConsoleWrap, interface IConsole, callee IUnknown
VBoxHeadless.exe: error: Context: "PowerUp(progress.asOutParam())" at line 1655 of file VBoxHeadless.cpp
This can be proved by other evidence. I try to delele log file in that path.
Windows alert that file has been opened by VirtualBox Headless Frontend and cannot be deleted.
So I kill all vboxheadless processes through Windows TaskManager, then tap
Code: Select all
VBoxManage startvm CentOS7-1 --type headless
Btw, I also used 'controlvm CentOS7-1 poweroff' to close my vm. But things work the same as above. So I'm so confused ):
I dont know it's a bug or something wrong with my cmd using.
Hope VirtualBox pros in this forum help me to solve this issue! Thx!
Sorry for poor English because I'm not a native speaker.
HostOS: Windows10.0.19041
GuestOS: CentOS7.9.2009
VirtualBox: 6.1.26 r145957
VBoxManage: 6.1.26r145957
VBoxHeadless: 6.1.26r145957