{"id":1708,"date":"2022-11-17T22:21:17","date_gmt":"2022-11-18T03:21:17","guid":{"rendered":"https:\/\/dc540.org\/xxx\/?p=1708"},"modified":"2022-11-17T22:21:20","modified_gmt":"2022-11-18T03:21:20","slug":"serial-number-0123456789abcdef-is-killing-me","status":"publish","type":"post","link":"https:\/\/dc540.org\/xxx\/2022\/11\/serial-number-0123456789abcdef-is-killing-me\/","title":{"rendered":"Serial Number 0123456789ABCDEF is killing me."},"content":{"rendered":"\n<p>I generally prefer to blog when I&#8217;ve solved an obscure problem, or even a not-so-obscure problem, because I&#8217;m proud of myself for doing it, and because for everyone out there who already knows the answer, there are 20 people out there who don&#8217;t, and I like to be helpful.<\/p>\n\n\n\n<p>Not this time. I&#8217;m blogging about it this time in the hopes that explaining it in sufficient detail might trigger an a-ha moment for me, or maybe that someone out there in the ether will find it and know, and feel that same urgent need to be helpful that I frequently feel.<\/p>\n\n\n\n<p>So I&#8217;ll be as concise as possible here:<\/p>\n\n\n\n<p>CentOS-based server running VirtualBox.<\/p>\n\n\n\n<p>Multiple USB devices connected to the server, intended to be passed through to individual VMs.<\/p>\n\n\n\n<p>These particular devices caused us to settle on VirtualBox, because it was on the only virtualization platform we found that could pass them through reliably in a usable way.<\/p>\n\n\n\n<p>So we found one that we like as far as function set and usability. We&#8217;re happily plugging along and making our VM work happily with it. OK, let&#8217;s make another one. Spin up another VM, plug in another (identical) device.<\/p>\n\n\n\n<p>Oh noes. The vendor, product, manufacturer name, and everything are all identical! What do we do? Those of you who&#8217;ve done this before, I know what you&#8217;re about to say. &#8220;Use the serial number in the VBox USB Filter, dumbass!&#8221; To that I say, &#8220;did you read the title of this post?&#8221; <\/p>\n\n\n\n<p>Yeah. This particular vendor rolled out this product commercially with generic, identical serial numbers. Whatever fucktard made that decision, I curse their existence.<\/p>\n\n\n\n<p>After a bit of futzing, we found that we could filter on &#8220;Port&#8221;, which is the port number assigned to the device, visible in lsusb and in the device in. \/dev\/bus\/usb\/001\/###.<\/p>\n\n\n\n<p>So yeah, we got on with our day and forgot about it. Oh yeah &#8212; then we got another one.<br><br>&#8220;No problem,&#8221; I said, &#8220;we know how to handle that.&#8221; So we&#8217;re working through setup, and I have the filter in place, and we pull it out and put it back in for whatever reason, and the filter&#8217;s not kicking in. I look again, and the port number has incremented!<\/p>\n\n\n\n<p>Yeah. USB port numbers in linux, at least in this distro, are dynamic. So you can&#8217;t expect them to continue to work after a server reboot, or maybe even after a device reset. Bad news.<\/p>\n\n\n\n<p>So a colleague sends me an article on using udev rules to find the uniqueness buried in udevadm attributes to generate a named symlink to the device. That sounds awesome.<\/p>\n\n\n\n<p>Well, less than awesome. The only uniqueness I was able to find in the attributes was &#8220;bus&#8221; and &#8220;devpath&#8221;, which are the physical USB bus and port the device is connected to. The lovely non-unique serial number is in there glaring at me triumphantly with its useless stupid face.<\/p>\n\n\n\n<p>So I futzed around with udev rules, trying to get that symlink to come up, and haven&#8217;t figured out quite the magic words yet. Maybe because the article is based on a ttyACM device that&#8217;s directly in \/dev, and my particular situation involves a device that shows up way under \/dev\/bus\/usb\/001\/### instead. In any case, I see no evidence of a symlink being created anywhere in the \/dev tree, and I have no way of knowing whether it would be usable in VBox USB filtering even if it did show up. So I&#8217;m calling it a night, and I&#8217;ll put fresh eyes on it tomorrow maybe.<\/p>\n\n\n\n<p>That&#8217;s my day, how&#8217;s youres?<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I generally prefer to blog when I&#8217;ve solved an obscure problem, or even a not-so-obscure problem, because I&#8217;m proud of myself for doing it, and because for everyone out there &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/dc540.org\/xxx\/2022\/11\/serial-number-0123456789abcdef-is-killing-me\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Serial Number 0123456789ABCDEF is killing me.&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[1],"tags":[],"class_list":["post-1708","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_likes_enabled":true,"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/dc540.org\/xxx\/wp-json\/wp\/v2\/posts\/1708","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/dc540.org\/xxx\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/dc540.org\/xxx\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/dc540.org\/xxx\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/dc540.org\/xxx\/wp-json\/wp\/v2\/comments?post=1708"}],"version-history":[{"count":1,"href":"https:\/\/dc540.org\/xxx\/wp-json\/wp\/v2\/posts\/1708\/revisions"}],"predecessor-version":[{"id":1709,"href":"https:\/\/dc540.org\/xxx\/wp-json\/wp\/v2\/posts\/1708\/revisions\/1709"}],"wp:attachment":[{"href":"https:\/\/dc540.org\/xxx\/wp-json\/wp\/v2\/media?parent=1708"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/dc540.org\/xxx\/wp-json\/wp\/v2\/categories?post=1708"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/dc540.org\/xxx\/wp-json\/wp\/v2\/tags?post=1708"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}