0

Reference post: Create virtual USB drive

Problem statement: I would like to create/ convert and area on my (Ubuntu 20.04) filesystem such that application's think a USB is connected to my machine, and any files I place in that filesystem directory show up in the "virtual/ faux" usb.

I followed the instructions provided in the response in the reference post linked above. When I view my file explorer, this mount shows up as a connected drive, but applications don't seem to recognize that any USB is connected. I've even changed the mkfs type to fat, and still it is not recognized.

  • why USB? Wouldn't just any mountable medium that appears do it? Is there something specifcally requiring USB here? Does USB matter? – Marcus Müller Oct 18 '22 at 14:14
  • Yes, the application I am working with normally depends on reteiving certain files solely from a USB. I am trying to simulate that connection. – LaBeaux Oct 18 '22 at 14:59
  • but your application doesn't speak USB. It speaks "files on a volume"; the USB handling is done by the linux kernel, that's the point of having an operating system (else, every single program would need to have every single device driver). That's why I'm asking whether USB is the important point, or whether it's just about storage. – Marcus Müller Oct 18 '22 at 15:05
  • I suppose It might be better clarifying to state that I need my linux kernel to treat this area on the file system 'like' a USB. The application I'm working with has some logic to detect when a USB is inserted to the system and when certain files are present on that USB. I don't have visibility into exactly what the requirements for that trigger are, but I'm interested to know if I can reproduce those same conditions but using a filesystem location instead of the normal USB-to-FS handling done by the OS. – LaBeaux Oct 19 '22 at 19:01
  • But emulating a full actual USB device is really really hard and slow ("A USB" is a terrible misnomer. You mean "a USB-attached mass storage device"; the fact that you abstract this so much is really why I'm having a hard time explaining this! Emulating something being attached via USB takes emulating an intricate, very-small-transfers physical bus that's very low-level.). Emulating a storage device on the other hand is trivial. I bet your application doesn't care about whether the mass storage device is attached via USB, thunderbolt, firewire, eSATA, or PCIe, or just a disk image. – Marcus Müller Oct 19 '22 at 19:05

0 Answers0