vboxmanage: Start Aborted VM

Discussions related to using VirtualBox on Linux hosts.
Locked
carpo1982
Posts: 6
Joined: 20. Jun 2015, 12:40

vboxmanage: Start Aborted VM

Post by carpo1982 »

A quick question. How do you start a VM that is in aborted state from vboxmanage? It reports that it's succesful, but then does not run (as confirmed by vboxmanage list runningvms)

In the documentation it states:

8.12. VBoxManage startvm This command starts a virtual machine that is currently in the "Powered off" or "Saved" states.

So how do you do it?
Perryg
Site Moderator
Posts: 34369
Joined: 6. Sep 2008, 22:55
Primary OS: Linux other
VBox Version: OSE self-compiled
Guest OSses: *NIX

Re: vboxmanage: Start Aborted VM

Post by Perryg »

Did you read the manual?

Here's the syntax:

Code: Select all

VBoxManage startvm <uuid|vmname>...
           [--type gui|sdl|headless]
For normal start you just need the command, with <vmname>
If you still have issues post the exact command you are typing here, as well as the results of VBoxManage list vms
Also the guests log file ( as an attachment )
carpo1982
Posts: 6
Joined: 20. Jun 2015, 12:40

Re: vboxmanage: Start Aborted VM

Post by carpo1982 »

Perryg wrote:Did you read the manual?

Here's the syntax:

Code: Select all

VBoxManage startvm <uuid|vmname>...
           [--type gui|sdl|headless]
For normal start you just need the command, with <vmname>
If you still have issues post the exact command you are typing here, as well as the results of VBoxManage list vms
Also the guests log file ( as an attachment )
Hi Perryg

I did indeed, which is why i quoted from it:

8.12. VBoxManage startvm This command starts a virtual machine that is currently in the "Powered off" or "Saved" states.

My problem isn't the command. It's that for an aborted VM it doesn't work.

I run:
vboxmanage startvm 482days

Which outputs:
Waiting for VM 482days to power on...
VM 482days has been successfully started.

vboxmanage list vms returns:
"482days" {df229181-b57f-4138-9ae7-be19530aa50e}

vboxmanage list runningvms returns: (nothing)

Log file attached.

Also: I can go into tthe GUI, hit start and it's all fine to start and works perfectly.
Attachments
VBox.log
(55.58 KiB) Downloaded 85 times
Perryg
Site Moderator
Posts: 34369
Joined: 6. Sep 2008, 22:55
Primary OS: Linux other
VBox Version: OSE self-compiled
Guest OSses: *NIX

Re: vboxmanage: Start Aborted VM

Post by Perryg »

I need clarification. You say start an aborted VM. Is that accurate? Was/is the guest in an aborted state? The log shows a start from suspend so it may be the guest or VirtualBox is confused.
Then you say you can start it from the GUI and it works properly. If this is so how do you stop the guest where it enters an aborted state?
carpo1982
Posts: 6
Joined: 20. Jun 2015, 12:40

Re: vboxmanage: Start Aborted VM

Post by carpo1982 »

In short, the host had an unexpected shutdown which means that the guest didn't cleanly quit. Hence the aborted state upon restart of the machine.

Upon reboot, i was able to restart it via the GUI, however vboxmanage behaved as I stated it above.

It's a bit of a mystery for me, although the remark in the manual that this works on Powered Off and Saved states makes me think, is this supposed to work with this command? Is there a way to change the state of a VM from the terminal?
Perryg
Site Moderator
Posts: 34369
Joined: 6. Sep 2008, 22:55
Primary OS: Linux other
VBox Version: OSE self-compiled
Guest OSses: *NIX

Re: vboxmanage: Start Aborted VM

Post by Perryg »

First lets check something. When you start the main manager does it still show as aborted?
If so this state must be taken care of. Normally you just discard the aborted state in the GUI and continue. All that is lost is what was not saved in what ever you were working on. Oh and just to be clear aborted is neither saved state nor powered off. It is kind of like in limbo.

If you must use the CLI then the following is the proper syntax:

Code: Select all

VBoxManage discardstate <uuid|vmname>
Note: I have never tried to use this but it is documented. Might want to do a backup if you have not already.
carpo1982
Posts: 6
Joined: 20. Jun 2015, 12:40

Re: vboxmanage: Start Aborted VM

Post by carpo1982 »

Yes, it does show as aborted.

Trying to carry out that command produces this error:

VBoxManage: error: Cannot delete the machine state as the machine is not in the saved state (machine state: Aborted)
VBoxManage: error: Details: code VBOX_E_INVALID_VM_STATE (0x80bb0002), component Console, interface IConsole, callee nsISupports
VBoxManage: error: Context: "DiscardSavedState(true )" at line 654 of file VBoxManageMisc.cpp

My concern is this. host restarts without any warning. This produces an Aborted state on the machine. I'd expect to be able to go in via SSH, and worse comes to worse, automatically restart it by hand, and that should be enough. Hence why i want to use the CLI. I don't want to have to faff around with VNC-over-SSH or any nonsense like that, i should just be able to SSH in, run a command and put the VM back up.

EDIT: Just so you can see i'm not going crazy, VM aborted in the VirtualBox Manager
EDIT2: Wow that file was big. Made it smaller and reuploaded :)
Attachments
Screen Shot 2015-06-20 at 21.19.16.jpg
Screen Shot 2015-06-20 at 21.19.16.jpg (27.05 KiB) Viewed 17395 times
Perryg
Site Moderator
Posts: 34369
Joined: 6. Sep 2008, 22:55
Primary OS: Linux other
VBox Version: OSE self-compiled
Guest OSses: *NIX

Re: vboxmanage: Start Aborted VM

Post by Perryg »

Well a forced power down does have a tendency to trash things, especially virtual guests.

Post the guests *.vbox file ( compressed ) as an attachment.
carpo1982
Posts: 6
Joined: 20. Jun 2015, 12:40

Re: vboxmanage: Start Aborted VM

Post by carpo1982 »

Perryg wrote:Well a forced power down does have a tendency to trash things, especially virtual guests.

Post the guests *.vbox file ( compressed ) as an attachment.
It wouldn't allow me to do an .vbox extention, so I renamed it to .xml instead. As attached.
Attachments
482days.xml
(9.01 KiB) Downloaded 80 times
Perryg
Site Moderator
Posts: 34369
Joined: 6. Sep 2008, 22:55
Primary OS: Linux other
VBox Version: OSE self-compiled
Guest OSses: *NIX

Re: vboxmanage: Start Aborted VM

Post by Perryg »

That was the reason I asked you to compress it, but never mind.

Code: Select all

<VirtualBox xmlns="http://www.innotek.de/VirtualBox-settings" version="1.14-linux">
  <Machine uuid="{df229181-b57f-4138-9ae7-be19530aa50e}" name="482days" OSType="Ubuntu_64" snapshotFolder="Snapshots" lastStateChange="2015-06-20T20:46:53Z" aborted="true">
    <MediaRegistry>
      <HardDisks>
        <HardDisk uuid="{8188fe2d-538c-4c57-abf4-43e4f39b2db0}" location="482days.vdi" format="VDI" type="Normal"/>
      </HardDisks>
      <DVDImages/>
      <FloppyImages/>
    </MediaRegistry>
    <ExtraData>
      <ExtraDataItem name="GUI/LastCloseAction" value="PowerOff"/>
If you remove the aborted="true" it should return to a working shut off state. I would back it up before editing it and make sure the guest is shut off and VirtualBox is not running when you do this.
carpo1982
Posts: 6
Joined: 20. Jun 2015, 12:40

Re: vboxmanage: Start Aborted VM

Post by carpo1982 »

Right okay. Does work and I can script that as well. Cheers chap for your help.
noteirak
Site Moderator
Posts: 5229
Joined: 13. Jan 2012, 11:14
Primary OS: Debian other
VBox Version: OSE Debian
Guest OSses: Debian, Win 2k8, Win 7
Contact:

Re: vboxmanage: Start Aborted VM

Post by noteirak »

Aborted means: the VM process or the VBoxSVC stopped unexpectidly, that's all.
For the sake of clarification: aborted is the same state as powered off, just a different label to give feedback of a crash. Any command working with Powered Off state should be able to run with Aborted also.
If you fond something that does not, then it's a bug and should be reported on the bugtracker.
Hyperbox - Virtual Infrastructure Manager - https://apps.kamax.lu/hyperbox/
Manage your VirtualBox infrastructure the free way!
MKANET
Posts: 14
Joined: 8. Jul 2020, 03:17

Re: vboxmanage: Start Aborted VM

Post by MKANET »

carpo1982 wrote:Right okay. Does work and I can script that as well. Cheers chap for your help.
Thank you so much for this forum thread! I was having the same exact issue. I also start/stop my VM (Home Assistant) via CLI, so my VM starts and stops automatically when Windows boots up and shuts down, respectively. However, if the VM ever has an "aborted" status... my VM will never start.

Anyway, thanks for the tips here, I made a small PowerShell script to remove aborted="true" from MyVM.vbox before starting my Home Assistant VM. I couldn't find any other way to resolve the issue.

PowerShell

Code: Select all

$File = "C:\Users\MKANET\VirtualBox VMs\HA\HA.vbox"
((Get-Content -path $File -Raw) -replace " aborted=`"true`"", "") | Set-Content -Path $File -Force
mpack
Site Moderator
Posts: 39156
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Mostly XP

Re: vboxmanage: Start Aborted VM

Post by mpack »

MKANET wrote:I couldn't find any other way to resolve the issue.
It's not an "issue", it's just a tag telling you what happened the last time you ran the VM. So you resolve it by running the VM again.

Inexpert messing with VirtualBox config files is definitely not indicated here. ISTM a script like this is a bad idea - it has no intelligence whatever in where it removes those tokens from. Generally speaking VirtualBox files should be manipulated using provided VirtualBox tools, with manual editing being a very last resort.
Locked