VMware Modern Apps Community
Pollard
Enthusiast
Enthusiast

Photon 4R1 how to passthrough usb

Trying to passthrough a usb controller so my portainer/octoprint can connect to my controller. Not seeing it under systemctl cant find much information on how to set this up. 

0 Kudos
21 Replies
DCasota
Expert
Expert

Spoiler
 

@Pollard


@Pollard wrote:

Just now circling back on this. I ended up getting a new 32-bit board for my printer that shows up as STMicroelectronics GENERICSTM32F103RC CDC in FS Mode.

Pollard_0-1638024212310.png

I was able to get octoprint working with it just by passing the usb device through and using g host /dev/ttyUSB0 and container /dev/ttyACM0. 

 

 

 

** Adding this in here ** Mine quit working recently after an update ran 

ls -l /dev/serial/by-id  which informed me for whatever reason my host change from /dev/ttyUSB0 to /dev/ttyACM0 so now I haver to put the for the host and container.


Please, forget the recent replies. Wrong way. It doesn't help for the /dev/ttyACM0 issue.

If the symlink /dev/ttyACM0 still is an issue, have a look to the directory content /etc/udev/rules.d/  
- there might be a rules configuration file beside the 99-vmware-hotplug.rules file.
   Inside such a file, you could find something like KERNEL=="ttyACM", Subsystem, VendorId, ProductID, Symlink, ...
- An usb device attached to the vm should be e.g. /dev/bus/usb/001/003.
  To identify the usb device, run e.g. lsusb -D /dev/bus/usb/001/003 . To identify symlink try e.g. ls -l /dev/bus/usb/001 .
- udevadm info /dev/bus/usb/001/003 shows device information from udev database.
  udevadm info -q path /dev/bus/usb/001/003 shows the full pci path.
- Files in /etc/modprobe.d/ are used to pass module settings to udev . On ESXi with attached usb devices for a Photon OS vm, see usb.conf entries sequence ohci and uhci .
This is the way.

0 Kudos
DCasota
Expert
Expert

It's have been a while..

If someone still is interesting, here a description what it takes to passthrough usb.

Photon OS is hardened. This is is old stuff and reasonable for cloud-native purposes.

This also means that you cannot plugin e.g. usb devices and assume sort of plug'n'play feature availability from modules.

The restriction by Linux kernel configuration is a barrier to protect users, to maintain functionality and provide safety.

This means do not use Photon OS as yet another common-purpose Linux distro because it never was intended for that.

As a Linux developer, you must have learned how to make build packages and how to maintain them, resolve package dependencies, taking into account of different cpu architectures and different flavors, etc.

For this kind of maintenance, the best way for Photon OS actually is to start with docs Building Package or Kernel Modules Using a Script | (vmware.github.io) .

In this context, how to recompile Linux kernel has been a question in the Photon OS github forum: Is there a menuconfig for Photon OS 4.0 Rev2 to recompile the kernel? · Issue #1412 · vmware/photon .... Kernel Live patching is a 2nd way. Both ways aren't documented yet in the meaning as official tutorial.

So, is passthrough usb possible within Photon OS? At the edge yes but it depends on taking the extra mile.

0 Kudos