cassowary icon indicating copy to clipboard operation
cassowary copied to clipboard

Ability to disable access to libvirtd at application startup.

Open MuratovAS opened this issue 3 years ago • 5 comments

Good afternoon. I use casualsnek with my remote desktop, I don't have virtual machines on host. It would be very nice if the application did not access libvirtd at startup. I had to install it and run it, but I don't need it. Without it, I get an error on startup. I think you can add the Only remote desktop parameter to the settings

MuratovAS avatar Feb 09 '22 17:02 MuratovAS

cassowary should skip using libvirt if VM name is set to be blank from GUI, for requiring libvirt-python to be installed is needed because it's imported before code runs even if not used. By the way can you mention when you needed to run libvirt related things. It will make it easier to locate and clean unnecessary calls to libvirt :)

casualsnek avatar Feb 09 '22 17:02 casualsnek

I tried to reproduce the installation process on a clean ubuntu 20.04 system. When I run cassowary I get an error because libvirt-python is missing. The installation of libvirt-python requires libvirtd. Ultimately, libvirtd is needed to run cassowary even if I don't use a virtual machine. I thought about what can be done.

  • I think it is possible to provide conditions for the presence of libvirt-python and libvirtd in the system. If it is missing? Launch the application with blocked VM management functions (make fields and buttons inactive).
  • Provide a flag to the application to allow the application to run without libvirt-python, even if it is installed.

MuratovAS avatar Feb 10 '22 09:02 MuratovAS

Importing modules during runtime is a bad idea, so python will terminate our application due to import error before code checks if libvirt-python is installed. While, i will find a way to handle it properly till then you can try installing a blank libvirt-python package that just resolves dependency with actual libvirt being installed. If you are okay with it, i can send a blank libvirt-python package that you can install after uninstalling original libvirt and libvirt-python.

casualsnek avatar Feb 10 '22 09:02 casualsnek

You can try catch an import to know if a library is available. Then you could disable the libvirt integrations if it isn't available. I'm also looking for a solution to connect to an existing windows vm.

michaelarnauts avatar Feb 17 '22 13:02 michaelarnauts

I will add that in next version, for existing VM you can install windows component and fill the details like hostname, username, IP address and password and it should work !

casualsnek avatar Feb 17 '22 14:02 casualsnek