BartekSz95 / phpvirtualbox

A web interface to manage and access Virtualbox machines.
Other
55 stars 15 forks source link

Can not take snapshots - vboxweb-service errors with VBOX_E_INVALID_VM_STATE #12

Open smithgcovert1 opened 8 months ago

smithgcovert1 commented 8 months ago

Using VirtualBox 7.0.12 on Ubuntu 22.04, with RC1:

When trying to create a new snapshot, the vboxweb-service echos the following error message: 00:00:49.625848 SQW02 API method name: IMachine::TakeSnapshot 00:00:49.625855 SQW02 API return code: 0x80bb0002 (VBOX_E_INVALID_VM_STATE) 00:00:49.625861 SQW02 COM error info result code: 0x80bb0002 (VBOX_E_INVALID_VM_STATE) 00:00:49.625865 SQW02 COM error info text: Cannot take a live snapshot of a virtual machine unless it is running.

When I look at the request / response to take a snapshot, here is the request body: { "{\"fn\":\"snapshotTake\",\"params\":{\"vm\":\"a205117d-2e0f-4eb8-99f4-9d58263a6105\",\"name\":\"Snapshot 1\",\"description\":\"\"},\"persist\":null}": "" }

And this is the response body: {"data":{"responseData":false,"success":false,"key":"53474945cfd7ac0bf8114767c209c2a6"},"errors":[],"persist":[],"messages":[]}

I can create snapshots using the local VirtualBox UX.

I have tried creating snapshots with the VM running and stopped, and get the same result.

Of note: Restoring, deleting, other management tasks of snapshots seem to work fine. The only problem seems to be creating a new snapshot of a VM.

It does not appear that I have any general issues with my VirtualBox install or vboxweb-service -- but happy to investigate and return any info on my install. I just upgraded from VirtualBox 6.1 / phpvirtualbox, and creating snapshots was working before my upgrade.

smithgcovert1 commented 8 months ago

Of possible note:

The error message in vboxweb-service is "Cannot take a live snapshot of a virtual machine unless it is running.", whether the VM is running or stopped.

BartekSz95 commented 8 months ago

I will take a look on this error, because something was changed in VBox 7.0.x. Thanks for report and your investigation.

ChrisTG742 commented 4 months ago

Any news on that yet?

BartekSz95 commented 3 months ago

@ChrisTG742 sorry, I'm actually very bussy in my job, we have big project for our client. I'll take a look when I have time.

smithgcovert1 commented 3 months ago

I was thinking about taking a look at this myself, but for the life of me, can not find the VirtualBox REST API docs.

Does anyone know where they can be found?

ChrisTG742 commented 3 months ago

AFAIC it should be covered by this doc here: https://download.virtualbox.org/virtualbox/SDKRef.pdf HTH