VBoxManage command 'startvm --type' cannot be correctly closed by 'controlvm acpipowerbutton'

Discussions about using Linux guests in VirtualBox.

VBoxManage command 'startvm --type' cannot be correctly closed by 'controlvm acpipowerbutton'

Postby Q2K3 » 24. Sep 2021, 15:20

Thx for your attention!

I use VBoxMange.exe to manage my vms in cmd.

After using
Code: Select all   Expand viewCollapse view
VBoxManage startvm CentOS7-1 --type headless

my vm named CentOS7-1 starts. Everything works well.

I close vm using
Code: Select all   Expand viewCollapse view
VBoxManage controlvm CentOS7-1 acpipowerbutton

btw acpi is enabled in the CentOS7-1 vm

taping
Code: Select all   Expand viewCollapse view
VBoxManage list runningvms

nothing print out. So the vm should have been closed.

But when I want to start my vm named CentOS7-1 again using the same cmd.
IT FAILED! output as below:
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


Then I find there are some processes named VirtualBox Headless Fronted left through TaskManager in Windows.
So I try to use VBoxHeadless.exe to start the vm and find some useful info.
After using
Code: Select all   Expand viewCollapse view
VBoxHeadless -s CentOS7-1

The Output as below:
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


Things seem clear now! The old vboxheadless processes are not closed perfectly so they hold log file even after the vm has been closed.
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   Expand viewCollapse view
VBoxManage startvm CentOS7-1 --type headless

THE VM NAMED CentOS7-1 STARTS. EVERYTHING WORKS AGAIN.

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
Q2K3
 
Posts: 6
Joined: 24. Sep 2021, 14:18

Re: VBoxManage command 'startvm --type' cannot be correctly closed by 'controlvm acpipowerbutton'

Postby scottgus1 » 24. Sep 2021, 15:26

Curious. Another poster here: viewtopic.php?f=6&t=103974 reports the same thing, headless is not closing. Maybe a bug crept in?

If you downgrade Virtualbox a few versions does the same headless-remaining problem happen?
scottgus1
Site Moderator
 
Posts: 13760
Joined: 30. Dec 2009, 20:14
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Windows, Linux

Re: VBoxManage command 'startvm --type' cannot be correctly closed by 'controlvm acpipowerbutton'

Postby Q2K3 » 24. Sep 2021, 15:35

scottgus1 wrote:Curious. Another poster here: reports the same thing, headless is not closing. Maybe a bug crept in?

If you downgrade Virtualbox a few versions does the same headless-remaining problem happen?


Sorry for posting same content again. After 20 mins impatient searching, not foud same post. So I try to post my problem out.
So how to know this bug is fixed in further version of VirtualBox?
Also Thx for your attention and reminding.
Q2K3
 
Posts: 6
Joined: 24. Sep 2021, 14:18

Re: VBoxManage command 'startvm --type' cannot be correctly closed by 'controlvm acpipowerbutton'

Postby Q2K3 » 24. Sep 2021, 16:02

GOOD NEWS!
All cmds work super well in VirtualBox 6.1.22r144080(VBoxManage and VBoxHeadless the same version)
So definitely some BUGS are invaded around VBoxHeadless module in VirtualBox 6.1.26 r145957.
Q2K3
 
Posts: 6
Joined: 24. Sep 2021, 14:18

Re: VBoxManage command 'startvm --type' cannot be correctly closed by 'controlvm acpipowerbutton'

Postby scottgus1 » 24. Sep 2021, 18:42

Q2K3 wrote:Sorry for posting same content again.

Not a problem at all. This situation is new and unexpected.

Q2K3 wrote:All cmds work super well in VirtualBox 6.1.22

This is good news! If you'd care to try, roll ahead to 6.1.26 again. If the commands fail, roll back to 6.1.22. If they start working again, then we have a definite series of steps for reproduction that the devs can use. A post on the Bugtracker with a good description and a link back to this topic would show the devs how to start investigating.
scottgus1
Site Moderator
 
Posts: 13760
Joined: 30. Dec 2009, 20:14
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Windows, Linux

Re: VBoxManage command 'startvm --type' cannot be correctly closed by 'controlvm acpipowerbutton'

Postby Q2K3 » 25. Sep 2021, 11:28

This is good news! If you'd care to try, roll ahead to 6.1.26 again. If the commands fail, roll back to 6.1.22. If they start working again, then we have a definite series of steps for reproduction that the devs can use.

I switch versions between 6.1.26 and 6.1.22. Things work well in 6.1.22, but things still incorrectly work in 6.1.26.


A post on the Bugtracker with a good description and a link back to this topic would show the devs how to start investigating.

Thx for your advice. I already posted a ticket on the bugtracker https://www.virtualbox.org/ticket/20574
Hope pro devs can solve this problem.

what's more, through log file named VBoxHardening. I find log file which is closed incorrectly lack two lines outputs comparing to log file which is closed correctly:
Code: Select all   Expand viewCollapse view
3fd0.3fd4: supR3HardNtChildWaitFor[2]: Quitting: ExitCode=0x0 (rcNtWait=0x0, rcNt1=0x0, rcNt2=0x103, rcNt3=0x103, 604653 ms, the end);
3f98.3f9c: supR3HardNtChildWaitFor[1]: Quitting: ExitCode=0x0 (rcNtWait=0x0, rcNt1=0x0, rcNt2=0x103, rcNt3=0x103, 605077 ms, the end);

Hope this additional msg can help pro devs to solve this problems.
Last edited by scottgus1 on 25. Sep 2021, 15:21, edited 2 times in total.
Reason: added ticket link
Q2K3
 
Posts: 6
Joined: 24. Sep 2021, 14:18

Re: VBoxManage command 'startvm --type' cannot be correctly closed by 'controlvm acpipowerbutton'

Postby scottgus1 » 25. Sep 2021, 15:21

Thanks for trying the back-and-forth version change and posting the ticket! I put a link to it in your post.

Hopefully this will get a fix soon, as headless seems to get used a lot.
scottgus1
Site Moderator
 
Posts: 13760
Joined: 30. Dec 2009, 20:14
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Windows, Linux

Re: VBoxManage command 'startvm --type' cannot be correctly closed by 'controlvm acpipowerbutton'

Postby fth0 » 25. Sep 2021, 23:17

While trying to replicate a similar sequence of events, I ran into another problem:

When I start a Linux Mint VM in Normal mode and then send the ACPI Shutdown event, Linux Mint displays a dialog where I have to select Shutdown, or it will wait at this dialog forever (at least for 10 minutes ;)). Linux Mint stays completely usable in this state. When I start the Linux Mint VM in Headless mode and send the ACPI Shutdown event, it doesn't shut down, perhaps for the same reason. I don't know if that plays any role in your setup, though.
fth0
Volunteer
 
Posts: 2606
Joined: 14. Feb 2019, 03:06
Location: Germany
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: Linux, Windows 10, ...

Re: VBoxManage command 'startvm --type' cannot be correctly closed by 'controlvm acpipowerbutton'

Postby fth0 » 28. Sep 2021, 15:12

Q2K3 wrote:Then I find there are some processes named VirtualBox Headless Fronted left through TaskManager in Windows.

How many Windows processes named "VBoxHeadless.exe" were running before sending the ACPI shutdown, and how many afterwards? Do you need more than 1 VM to reproduce the problem?

Q2K3 wrote:I switch versions between 6.1.26 and 6.1.22. Things work well in 6.1.22, but things still incorrectly work in 6.1.26.

Can you also try VirtualBox 6.1.24?
fth0
Volunteer
 
Posts: 2606
Joined: 14. Feb 2019, 03:06
Location: Germany
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: Linux, Windows 10, ...

Re: VBoxManage command 'startvm --type' cannot be correctly closed by 'controlvm acpipowerbutton'

Postby Q2K3 » 30. Sep 2021, 07:56

thx for you reply :)

fth0 wrote:How many Windows processes named "VBoxHeadless.exe" were running before sending the ACPI shutdown, and how many afterwards? Do you need more than 1 VM to reproduce the problem?

While the single vm is running, the number of processes named "VBoxHeadless.exe" is 3.
with vm increases 1, the number of processes named "VBoxHeadless.exe" also increase 3.
In my situation, if the vm was not closed correctly after sending the ACPI shutdown (means the vm cannot be started and reports error msgs I mentioned above), the number of processes named "VBoxHeadless.exe" is still 3.
But the memory usage of processes come down after sending the ACPI shutdown. (from 32M to 18M)

fth0 wrote:Can you also try VirtualBox 6.1.24?

I've tried VirtualBox 6.1.24 in the last few days. It seems to work well in the situation I mentioned above. No "VBoxHeadless.exe" processes are running after sending the ACPI shutdown.
I guess some bugs getting especially into VirtualBox 6.1.26 and causing problems above.
Q2K3
 
Posts: 6
Joined: 24. Sep 2021, 14:18

Re: VBoxManage command 'startvm --type' cannot be correctly closed by 'controlvm acpipowerbutton'

Postby fth0 » 30. Sep 2021, 08:38

Thanks for testing. It's surprising to me that all 3 VBoxHeadless processes keep running, I would have expected only 1 or 2. I've updated your ticket accordingly.
fth0
Volunteer
 
Posts: 2606
Joined: 14. Feb 2019, 03:06
Location: Germany
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: Linux, Windows 10, ...

Re: VBoxManage command 'startvm --type' cannot be correctly closed by 'controlvm acpipowerbutton'

Postby fth0 » 12. Oct 2021, 19:39

This issue should be fixed in the VirtualBox test builds 6.1.27r147422 and newer.
fth0
Volunteer
 
Posts: 2606
Joined: 14. Feb 2019, 03:06
Location: Germany
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: Linux, Windows 10, ...

Re: VBoxManage command 'startvm --type' cannot be correctly closed by 'controlvm acpipowerbutton'

Postby Q2K3 » 15. Oct 2021, 04:27

fth0 wrote:This issue should be fixed in the VirtualBox test builds 6.1.27r147422 and newer.


Thx for replying! :)
I will try the test version on my laptop and report my problems whether is still existed.
Also thx for pro devs and forums users paying attentions to my problems.
Q2K3
 
Posts: 6
Joined: 24. Sep 2021, 14:18


Return to Linux Guests

Who is online

Users browsing this forum: No registered users and 7 guests