unable to execute VBoxManage command in python executable (created with pyinstaller)


OS: Ubuntu 16.04 LTS

make an install.py file executable:

pyinstaller -w install.py --onefile

install.py script:

import os
VM = os.system('VBoxManage startvm win10 --type headless')
if VM == 0:
   print("win10 started...")
   print("win10 not started....")

Problem: When I run the python3 install.py on ubuntu terminal it works fine. After that I created it's an executable file with the command mentioned above and when I execute the executable file on the terminal by giving command chmod 777 install & ./install. It gives an error below:


VBoxManage: error: Failed to create the VirtualBox object!
VBoxManage: error: Code NS_ERROR_FACTORY_NOT_REGISTERED (0x80040154) - Class not registered (extended info not available)
VBoxManage: error: Most likely, the VirtualBox COM server is not running or failed to start.

I don't know what's going wrong python script works fine but when I created it's executable it gives same error every time.

Thanks in advance.

asked on Super User May 15, 2020 by ahsan azeem

0 Answers

Nobody has answered this question yet.

User contributions licensed under CC BY-SA 3.0