Can not start virtual machines with libvirt

Discussions related to using VirtualBox on Linux hosts.
Post Reply
MacPolloZ
Posts: 2
Joined: 14. Mar 2023, 19:38

Can not start virtual machines with libvirt

Post by MacPolloZ »

Hi, I am using libvirt for some projects, and I want to have full control over virtualbox machines with it. However, I have encountered an error when I try to start any vm using libvirt.
When using the following command where <vm_name> is the vm's name I want to start (e.g. Debian):

Code: Select all

virsh --connect vbox:///session start <vm_name>
I receive the following error:

Code: Select all

error: Failed to start domain <vm_name>
error: operation failed: OpenRemoteSession/LaunchVMProcess failed, domain can't be started
I have also tried using the python package (python-libvirt) to start VMs, but it resulted in the same error.

Taking a look at the virtualbox logs I found the following error

Code: Select all

02:00:36.620577 nspr-5   ERROR [COM]: aRC=VBOX_E_IPRT_ERROR (0x80bb0005) aIID={85632c68-b5bb-4316-a900-5eb28d3413df} aComponent={MachineWrap} aText={Could not launch the VM process for the machine <vm_name> (VERR_ENV_INVALID_VAR_NAME)}, preserve=false aResultDetail=-752
I've been looking around to solve this error, but nothing so far.

Here are some specifications:
virtualbox version: 6.1.44r156814
OS: Fedora Linux 38 (Workstation Edition)
Linux kernel: 6.2.15-300.fc38.x86_64
Libvirt version: 9.0.0
Although this error occurs with any virtual machine, please let me know if you need any specific VM information (including logs) that might be helpful.
mpack
Site Moderator
Posts: 39134
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Mostly XP

Re: Can not start virtual machines with libvirt

Post by mpack »

As far as I'm aware - and correct me if you have reason to believe otherwise - libvirt is a third party Linux-only tool for management of VMs. It has no special status within the VirtualBox community. If you have questions about libvirt you should ask the libvirt community.
MacPolloZ
Posts: 2
Joined: 14. Mar 2023, 19:38

Re: Can not start virtual machines with libvirt

Post by MacPolloZ »

mpack wrote:As far as I'm aware - and correct me if you have reason to believe otherwise - libvirt is a third party Linux-only tool for management of VMs. It has no special status within the VirtualBox community. If you have questions about libvirt you should ask the libvirt community.
Since the error comes from VirtualBox, I thought I could post it here. But maybe you're right, I'll also post it there.
scottgus1
Site Moderator
Posts: 20945
Joined: 30. Dec 2009, 20:14
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Windows, Linux

Re: Can not start virtual machines with libvirt

Post by scottgus1 »

MacPolloZ wrote:virsh --connect vbox:///session start <vm_name>
If this is the exact command being used, then it's probably a syntax error. < and > are special characters. The VM name needs to be surrounded by double quotes:

virsh --connect vbox:///session start "vm_name"

And note that case counts in Virtualbox VM names.
Post Reply