[Plugin] USB_Manager


SimonF

Recommended Posts

13 minutes ago, aim60 said:

virsh change-media seems to work for changing the iso in a cdrom drive that has been pre-defined in the VM.  I was thinking of USB Manager creating virtual usb ports with associated iso or vdisk files.  They could be hot-plugged into the VM as usb devices with VM Attach/Detach.  The advantage of implementing this in USB Manager is that commonly used iso or vdisk "ports" could be pre-defined, and switched between VMs as desired.  The advantage of implementing hot-plug in VM Manager is that not everyone has discovered this plugin.

Are you talking about Libvirt hotplug plugin or my hot plug as part of USB Manager.

 

image.thumb.png.0511b2fe12502469493ff19d10cb8185.png

 

But will look into it. Would need to make sure no conflict with UD also.

Link to comment
7 hours ago, aim60 said:

virsh change-media seems to work for changing the iso in a cdrom drive that has been pre-defined in the VM.  I was thinking of USB Manager creating virtual usb ports with associated iso or vdisk files.  They could be hot-plugged into the VM as usb devices with VM Attach/Detach.  The advantage of implementing this in USB Manager is that commonly used iso or vdisk "ports" could be pre-defined, and switched between VMs as desired.  The advantage of implementing hot-plug in VM Manager is that not everyone has discovered this plugin.

 

Found that I can add vdisks dynamically, Not been able to get iso to work as yet , unless you know the commands.

 

root@computenode:~# virsh attach-disk "Windows 10 test4" --targetbus usb --source /tmp/test.img  --target hda
Disk attached successfully

root@computenode:~# virsh detach-disk "Windows 10 test4" --target hda
Disk detached successfully

root@computenode:~# virsh attach-disk "Windows 10 test4" --targetbus usb --source /tmp/test.img  --target hda
Disk attached successfully

root@computenode:~# 

 

image.thumb.png.8ff8af4b738a0b0ef67b007cdfcf753c.pngimage.thumb.png.3c98555b388b7fde730c26b6678df273.png

Edited by SimonF
Link to comment
8 hours ago, SimonF said:

Are you talking about Libvirt hotplug plugin or my hot plug as part of USB Manager

Thanks for the screenshot.  Never noticed the USB Manager Hotplug section on the VMs page.  Since discovering that with USB Manager, I can use both of my licensed flash drives (with the same vendor id) at the same time, I haven't gone back to Libvirt hotplug.

 

I found this, https://gitlab.com/libvirt/libvirt/-/issues/261

  It looks like the hotplug cdrom on a usb bus was never implemented.  There was a commit 3 weeks ago.

 

Since cdroms are read-only, there might not be a conflict with ud.  And ud doesn't currently mount vdisks, although it would be a useful feature.

 

Think about a usb mounted vdisk as a virtual external hard drive.  It could be plugged into any vm, and with ud enhancement, could be mounted on the host.  Not every vm has network access to the host.

Edited by aim60
Link to comment
3 hours ago, autumnwalker said:

Installed plugin and getting the following error show up in Unraid GUI (below the menu bar):

 

Warning: parse_ini_file(/tmp/usb_manager/config/usb_manager.cfg): failed to open stream: No such file or directory in /usr/local/emhttp/plugins/dynamix/include/PageBuilder.php(58) : eval()'d code on line 1

 

Thoughts?

Have you tried removing and re-installing. I remove all the config and reinstalled no issue on my machine.

 

Does the directory exist? ls /tmp/usb_manager/config/ 

Link to comment
  • 2 weeks later...
On 8/20/2022 at 5:11 PM, SimonF said:

Was released about 2 hours ago. Have you updated the plugin?

 

Actually I still don't have this.

USB Manager says 2022.05.20, but also doesn't find an update for it.
(plugin updates work fine in my server - I just did a couple 5 minutes ago)

Maybe some version red flag? I am on 6.10.3.

 

Link to comment
11 hours ago, NLS said:

 

Actually I still don't have this.

USB Manager says 2022.05.20, but also doesn't find an update for it.
(plugin updates work fine in my server - I just did a couple 5 minutes ago)

Maybe some version red flag? I am on 6.10.3.

 

Not sure why you are not seeing the updates, works on 6.9.2 as below 6.10 and 6.11rcs Trying removing and reloading. Config will stay intack.

 

image.thumb.png.385cfe7a49fcedd62b9214d004289b9e.png

Link to comment
12 hours ago, NLS said:

 

Actually I still don't have this.

USB Manager says 2022.05.20, but also doesn't find an update for it.
(plugin updates work fine in my server - I just did a couple 5 minutes ago)

Maybe some version red flag? I am on 6.10.3.

 

Ok, I think you may have installed the old v1 version that was in CA for a while. You need to remove the plugin and install again from CA.

Link to comment
  • 2 weeks later...
2 hours ago, casperse said:

Hi Again 🙂

I had many problems attaching the CONBE II stick to my VM running Home assistant

And I reverted to use your great plugin for this, but for some reason I keep getting this error:

image.thumb.png.89691439fd48c27e4955b96825107aff.png

Some think strange the USB for both is using 04?

image.thumb.png.60b508b2110fede9ae7e5b8f21780586.png

image.thumb.png.7749e0f31d9305410d730c6c0d8aa2b7.png

 

Any input to what I can try, would be much appreciated 

What output do you get if you hover over the virsh error?

 

The port number is only used if you enable connect as serial via the slider which is required for map Conbee II correctly above 6.9.2

 

Edited by SimonF
  • Like 2
Link to comment
13 minutes ago, SimonF said:

What output do you get if you hover over the virsh error?

 

The port number is only used if you enable connect as serial via the slider which is required for map Conbee II correctly above 6.9.2

 

THANKS! SO MUCH - I enabled the Conbee II as a serial and it seem to work now!

image.thumb.png.c2865935faffe07f24b227a8c9f6b635.png

My only problem now is that I don't know the correct path in the HA VM anymore?
I know this is kind of off-topic but do you know how to define/find the new USB path in HA?
 

      {
        "entry_id": "2bb51ca17b7fa61b8d997ce1d3f2c8a2",
        "version": 3,
        "domain": "zha",
        "title": "ConBee II, s/n: DE2421314 - dresden elektronik ingenieurtechnik GmbH",
        "data": {
          "device": {
            "path": "/dev/serial/by-id/usb-dresden_elektronik_ingenieurtechnik_GmbH_ConBee_II_DE2421314-if00"
          },
          "radio_type": "deconz"
        },



 

Link to comment
6 minutes ago, casperse said:

THANKS! SO MUCH - I enabled the Conbee II as a serial and it seem to work now!

image.thumb.png.c2865935faffe07f24b227a8c9f6b635.png

My only problem now is that I don't know the correct path in the HA VM anymore?
I know this is kind of off-topic but do you know how to define/find the new USB path in HA?
 

      {
        "entry_id": "2bb51ca17b7fa61b8d997ce1d3f2c8a2",
        "version": 3,
        "domain": "zha",
        "title": "ConBee II, s/n: DE2421314 - dresden elektronik ingenieurtechnik GmbH",
        "data": {
          "device": {
            "path": "/dev/serial/by-id/usb-dresden_elektronik_ingenieurtechnik_GmbH_ConBee_II_DE2421314-if00"
          },
          "radio_type": "deconz"
        },



 

The path will be like this now.

 

/dev/serial/by-id/usb-QEMU_QEMU_USB_SERIAL_1-0000:00:07.7-4-if00-port0

 

Have a look at this post https://community.home-assistant.io/t/solved-conbee-2-fails-to-connect-to-zha-ha-in-unraid-vm/431276

 

 

Link to comment
39 minutes ago, casperse said:

THANKS! SO MUCH - I enabled the Conbee II as a serial and it seem to work now!

image.thumb.png.c2865935faffe07f24b227a8c9f6b635.png

My only problem now is that I don't know the correct path in the HA VM anymore?
I know this is kind of off-topic but do you know how to define/find the new USB path in HA?
 

      {
        "entry_id": "2bb51ca17b7fa61b8d997ce1d3f2c8a2",
        "version": 3,
        "domain": "zha",
        "title": "ConBee II, s/n: DE2421314 - dresden elektronik ingenieurtechnik GmbH",
        "data": {
          "device": {
            "path": "/dev/serial/by-id/usb-dresden_elektronik_ingenieurtechnik_GmbH_ConBee_II_DE2421314-if00"
          },
          "radio_type": "deconz"
        },



 

Also you dont seem to have connected as serial, should show like this: connected(serial) for either port or device maps

 

image.thumb.png.97de8b6e8492f2ba15e135bc3f23bbe8.png

Edited by SimonF
Link to comment
40 minutes ago, SimonF said:

Also you dont seem to have connected as serial, should show like this:

 

image.thumb.png.97de8b6e8492f2ba15e135bc3f23bbe8.png

Yes it seem i have this error:

image.png.dcb3916eddd65d80a5a1ff4809a15432.png

But I have changed the XML looking in the XML I now have to entries? like someone here also experienced

What should I do... both here are port 4 should I just change one to something else?

Again thanks for helping, been at this all day 😞

 

 

image.thumb.png.b0472ca709aaf9aabde5008c06c1c17f.png

 

 

Link to comment
11 minutes ago, casperse said:

Yes it seem i have this error:

image.png.dcb3916eddd65d80a5a1ff4809a15432.png

But I have changed the XML looking in the XML I now have to entries? like someone here also experienced

What should I do... both here are port 4 should I just change one to something else?

Again thanks for helping, been at this all day 😞

 

 

image.thumb.png.b0472ca709aaf9aabde5008c06c1c17f.png

 

 

Did you add the XML manually? It may be you changed the slider to serial when it was connected.

 

If you added the lines by hand remove them.

 

Change slider back to off. Disconnect from VM, Change Slider to on and reconnect.

 

XML should look like this if added via the plugin, I use the alias to remove.

 

    <serial type='dev'>
      <source path='/dev/serial/by-id/usb-dresden_elektronik_ingenieurtechnik_GmbH_ConBee_II_DEX-if00'/>
      <target type='usb-serial' port='1'>
        <model name='usb-serial'/>
      </target>
      <alias name='ua-serial001011'/>
      <address type='usb' bus='0' port='4'/>

Link to comment
49 minutes ago, SimonF said:

Did you add the XML manually? It may be you changed the slider to serial when it was connected.

 

If you added the lines by hand remove them.

 

Change slider back to off. Disconnect from VM, Change Slider to on and reconnect.

 

XML should look like this if added via the plugin, I use the alias to remove.

 

    <serial type='dev'>
      <source path='/dev/serial/by-id/usb-dresden_elektronik_ingenieurtechnik_GmbH_ConBee_II_DEX-if00'/>
      <target type='usb-serial' port='1'>
        <model name='usb-serial'/>
      </target>
      <alias name='ua-serial001011'/>
      <address type='usb' bus='0' port='4'/>

Great reading the guide I did add the XML input manually SORRY 

Everything is now removed:

image.thumb.png.9058f767c1effc51f169b2cf0f9fd351.png

So everything should now finally be okay on the Unraid and XML part!

But for some reason I still get the in HA

image.thumb.png.d8fdde5e39e33ab73d4b753a2e96612c.png

 

Might be a stupid Q but how can I validate the path in HA?

      {
        "entry_id": "2bb51ca17b7fa61b8d997ce1d3f2c8a2",
        "version": 3,
        "domain": "zha",
        "title": "ConBee II, s/n: DE2421314 - dresden elektronik ingenieurtechnik GmbH",
        "data": {
          "device": {
            "path": "/dev/serial/by-id/usb-QEMU_QEMU_USB_SERIAL_1-0000:00:07.7-4-if00-port0"
          },
          "radio_type": "deconz"
        },

Again your help is much appreciated without ZigBee most of the smart house doesn't work - so I am not that popular at home right now LOL 

Link to comment
9 minutes ago, casperse said:

Great reading the guide I did add the XML input manually SORRY 

Everything is now removed:

image.thumb.png.9058f767c1effc51f169b2cf0f9fd351.png

So everything should now finally be okay on the Unraid and XML part!

But for some reason I still get the in HA

image.thumb.png.d8fdde5e39e33ab73d4b753a2e96612c.png

 

Might be a stupid Q but how can I validate the path in HA?

      {
        "entry_id": "2bb51ca17b7fa61b8d997ce1d3f2c8a2",
        "version": 3,
        "domain": "zha",
        "title": "ConBee II, s/n: DE2421314 - dresden elektronik ingenieurtechnik GmbH",
        "data": {
          "device": {
            "path": "/dev/serial/by-id/usb-QEMU_QEMU_USB_SERIAL_1-0000:00:07.7-4-if00-port0"
          },
          "radio_type": "deconz"
        },

Again your help is much appreciated without ZigBee most of the smart house doesn't work - so I am not that popular at home right now LOL 

I am not an expert in ha, but from the HA console if I run hw info I see

 

image.thumb.png.86eb2c9d852b7725445c4b21c45a734e.png

And from settings->system->hardware click on ... and select all hardware.

 

image.thumb.png.77f87fadbec48cd10ae80ffff48b69c1.png

Edited by SimonF
Link to comment
21 minutes ago, casperse said:

Finally I found this under the "3 dots" under /config/hardware on the HA UI

image.thumb.png.8345781a9e7186c9de8b9c76fe6ba791.png

The path was: "path": "/dev/serial/by-id/usb-QEMU_QEMU_USB_SERIAL_1-0000:00:07.0-4-if00-port0"

Thanks everything is up and running and I can get everyone off my back LOL

Have a great weekend, you saved mine! Cheers

 

Happy to help and Glad you got it working you have a good weekend now too :)

  • Thanks 1
Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.