Convert KVM raw img to qcow2

With this simple command your can convert raw img to qcow2:

qemu-img convert -f raw -O qcow2 <source>.img <destination>.qcow2

and then edit your virtual domain XML file and replace type="img" with type="qcow2" and update the disk file name.

Done. 🙂

PyInstaller with Python 3.6 and PySide2 fails on Windows 10

Pyinstaller spits out warnings lthat it could not find libraries like api-ms-win-core-* and api-ms-win-crt-*. This leads to an executable working on windows 10, even on a new machine, but not on earlier versions as pyinstaller fails to bundle the needed files.

The fix is quite simple:

  1. Download Visual Studio 2017 community from microsoft website
  2. Install following components:
    Windows Universal CRT SDK
    Windows 8.1 SDK
    VC++ 2015.3 v140 toolset for desktop
    Windows Universal C Runtime
  3. When invoking pyinstaller use
    –path "C:\Program Files (x86)\Windows Kits\10\Redist\ucrt\DLLs\x86"

Done 🙂

well the path is for the 32bit libraries, guess what, replace DLLs\x86 with DLLs\x64 when using python 64bit

OR install Visual C++ 2017 Redist package on the destination machine.

If the packaged application still does not run please install the mentioned redist package

USB drive not recognised (error -71)

CentOS 7 recently had an error when connecting a USB drive. I guess this came after updating to the latest kernel. The errors in dmesg or /var/log/messages were:

[ 4159.607574] usb 1-1: new full speed USB device using uhci_hcd and address 4
[ 2079.875502] usb 1-1: device descriptor read/64, error -71
[ 2080.099379] usb 1-1: device descriptor read/64, error -71
[ 2080.319263] usb 1-1: new full speed USB device using uhci_hcd and address 5
[ 2080.443858] usb 1-1: device descriptor read/64, error -71
[ 4161.322029] usb 1-1: device descriptor read/64, error -71
[ 4161.537896] usb 1-1: new full speed USB device using uhci_hcd and address 6
[ 4161.945615] usb 1-1: device not accepting address 6, error -71
[ 4162.057577] usb 1-1: new full speed USB device using uhci_hcd and address 7
[ 4162.465330] usb 1-1: device not accepting address 7, error -71

After some googleing i found a fix for that:

# vim /etc/modprobe.d/options.conf

and add following line to it:

options usbcore use_both_schemes=y

more information about what this line does can be found here.