Make a computer act as a virtual USB device for other equipments












11















Some applications simulate a virtual USB or CD Rom drive as if a USB drive is attached to the computer.



Is there any configuration or application that provides a virtual USB drive, not for the the operating system itself, but for other equipments which accept USB drive, through a USB port.



So I'll have a virtual hard disk (e.g. a *.vdi file) in the computer, which is connected, through a USB socket, as a USB drive to some other equipment (e.g. a cell phone or a laptop).










share|improve this question





























    11















    Some applications simulate a virtual USB or CD Rom drive as if a USB drive is attached to the computer.



    Is there any configuration or application that provides a virtual USB drive, not for the the operating system itself, but for other equipments which accept USB drive, through a USB port.



    So I'll have a virtual hard disk (e.g. a *.vdi file) in the computer, which is connected, through a USB socket, as a USB drive to some other equipment (e.g. a cell phone or a laptop).










    share|improve this question



























      11












      11








      11


      2






      Some applications simulate a virtual USB or CD Rom drive as if a USB drive is attached to the computer.



      Is there any configuration or application that provides a virtual USB drive, not for the the operating system itself, but for other equipments which accept USB drive, through a USB port.



      So I'll have a virtual hard disk (e.g. a *.vdi file) in the computer, which is connected, through a USB socket, as a USB drive to some other equipment (e.g. a cell phone or a laptop).










      share|improve this question
















      Some applications simulate a virtual USB or CD Rom drive as if a USB drive is attached to the computer.



      Is there any configuration or application that provides a virtual USB drive, not for the the operating system itself, but for other equipments which accept USB drive, through a USB port.



      So I'll have a virtual hard disk (e.g. a *.vdi file) in the computer, which is connected, through a USB socket, as a USB drive to some other equipment (e.g. a cell phone or a laptop).







      usb






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Mar 19 '14 at 22:54









      Gilles

      537k12810871604




      537k12810871604










      asked Mar 19 '14 at 11:03









      user62511user62511

      72731529




      72731529






















          4 Answers
          4






          active

          oldest

          votes


















          10














          You would need to add a USB Device/Peripheral controller to the computer, as opposed to the USB Host Controller they tend to come with.



          Something like this: https://www.maximintegrated.com/en/products/interface/controllers-expanders/MAX3420E.html



          Unfortunately, you'd have to find a way to wire it onto your motherboard. Technically, it can be done. Practically, you'd have to redesign the motherboard to include it. You might be lucky enough to find an SPI or I2C bus exposed somewhere on your motherboard to allow you to add it, but they're usually wired directly into whatever they're being used for unless you're using a dev board or single-board computer with exposed GPIO and other ports such as a Raspberry Pi.



          The other option would be a USB On-the-Go Controller. Motherboards designed for embedded and portable devices tend to have a USB OTG (On-the-go) contoller, which can function as either a Host or Device controller. For example, the aforementioned Raspberry Pi has an On-the-Go Controller, but on all models except the Pi Zero that gets rewired to a host port or an onboard USB hub denying the use of USB device functionality. The BeagleBone Black has an OTG port.



          That's not all though - once you've got the hardware, you'd also need the software. Linux has some useful kernel USB Gadget drivers ("USB gadget" is another term for USB peripheral/device) such as g_serial and g_ethernet that allow you to plug your device into another computer and be visible as a serial or ethernet-over-USB device (there are others for exposing a device as mass storage, which allow you to use a file as a block device and expose the computer as a mass storage gadget). The BeagleBone Black tends to come with this enabled by default, so you can simply plug it into your PC over USB and see it as a networked device - and I believe it also appears as a mass storage device by using a composite driver (which allows it to appear as multiple USB device types over a single connection.) The Pi Zero can use these, but does not by default. For Windows or other OSes, you'd probably have to write that device driver yourself.



          So, theoretically, you can do it. You can tear down your desktop PC, try and find an unused compatible bus on the motherboard somewhere (most likely some unused pins on a controller IC), or a way to extend an internal I2C or SPI bus, or something you can tear out and replace, and solder a USB OTG or device controller chip onto it. Then you can install Linux and use a gadget driver, or write your own for another OS. Practically, unless you're a top-notch electronics engineer, you're not going to be able to do it. At least, not until someone comes out with that elusive adapter with a device or OTG port on it that plugs into a USB port (theoretically, that could be done with a microcontroller such an Arduino wired to a pair of USB device controller ICs), and writes the drivers to run it.






          share|improve this answer





















          • 1





            great explanation, can you please update the answer if you (with your knowledge) see something new regards your sentence "until someone comes out with exclusive adapter...". There are laptops with usb-c in 2018, could they be a solution.?

            – Asain Kujovic
            Sep 10 '18 at 16:41



















          6














          USB is dissymmetric: one side is a host, the other side is a peripheral device. You can't make a peripheral device act as a host or vice versa. It is possible for a USB port to be able to act as either side; this is called USB on-the-go and is present on some mobile phones and tablets. The ports are physically device-type ports, not host-type ports. I've never seen a PC with a device port. This requires electronics on the controller, it isn't enough to make a cable that fits on both ends.



          So no, you won't be able to make a PC into a USB device.



          If you want to use a computer as a USB storage device, you can use a mobile phone or tablet with a USB connection instead of using a PC.






          share|improve this answer


























          • Can you elaborate a bit more, how using a mobile phone could help me turning my PC into a USB storage device / host, that I could plug to another compter, TV or device? I think, I'm missing this point, though I think I have a fair knowledge about USB OTG.

            – trejder
            Mar 10 '15 at 8:15











          • @trejder As I wrote, I've never seen a PC with a device port (“PC” excluding x86 tablets).

            – Gilles
            Mar 10 '15 at 8:19











          • Yes, but I'm refferring to your last sentence: "If you want to make a computer into a USB storage device, you can use a mobile phone or tablet with a USB connection". Maybe I'm missing something, but I understand it as "You can use mobile phone or tablet to turn computer into USB storage device". If so, then the question is: How?

            – trejder
            Mar 10 '15 at 8:23






          • 1





            @trejder Ah, “computer” in that sentence is not “PC”, it's “computer”. A phone/tablet is a different kind of computer from a PC. Is that what's troubling you?

            – Gilles
            Mar 10 '15 at 8:27






          • 1





            @trejder No. Usually your best bet is to establish a network connection one way or another. You can use Firewire as a network connection between any two PCs with a Firewire port, but many PCs don't have one. Most PCs have an Ethernet port, you can connect two PCs with an Ethernet cable (very old PCs require a crossover cable but modern ones can take an ordinary cable). To make a PC serve as a storage device for a mobile device, you typically need to get the PC onto wifi somehow.

            – Gilles
            Mar 10 '15 at 8:35



















          2














          You can consider using one of special "USB-USB bridged cables", sometimes called "USB networking cables". Like one mentioned in these articles:





          • Connecting Two PCs using USB-USB Cable,


          • Connecting two computers with a USB cable,


          • How to Link Two Computers Using a USB Cable.


          They allow you to transfer files between two PCs. I've been using these kind of cables over ten years ago (in times of Windows XP) and in that times all such cables available to the market required a special driver and software. They let you transfer files only through special file commander, that shiped along with cable drivers on a installation disk and therefore did not allow one PC to act to another as pure USB external device.



          I'm not sure, if anything has changed since then and if new solutions allow you only to transfer files using special software and -- if you can force one PC to act as an external device to another PC.






          share|improve this answer































            2














            As explained in the answer by by Matt Thomson, it is not properly possible to make a physical USB port of a PC computer act as a USB slave device, as the USB slave controller is missing.



            That means if we have an adapter board that can provide slave-mode USB (such as the Raspberry Pi Zero), we have to connect it to your host PC by a different channel, such as wired Ethernet. I have two different proposals what protocol you could run over that Ethernet connection:



            (1) Expose the USB port over IP network.



            Use software to expose the USB slave-mode port of the Raspberry Pi Zero as a virtual USB device to your PC. The USB/IP project provides this, by means of a driver that can transport USB over IP networks. Here is an example of using USB/IP to provide a simulated USB device to a computer – which would be your PC here.



            What I don't know in this proposed solution is if the USB/IP software is already able to expose a USB slave port over IP network, or only a USB host port as normal.



            But even if that works, you still have to set up or adapt device drivers on your PC in such a way that they (1) accept the incoming USB/IP connection as a USB connection, (2) provide USB slave-mode rather than USB host-mode, (3) simulate a USB mass storage device by serving the data from the assigned location (your .vdi file).



            Overall, that's a complex way of doing it.



            (2) Expose the file over IP network.



            This is a much simpler way for how to utilize the Ethernet connection to the Raspberry Pi Zero: on the Raspberry Pi Zero, mount the data stored on your PC via a network file system. These files then appear logically as part of the Pi Zero's file system, and you can serve them with the Linux USB gadget driver to make the Raspberry Pi look like a USB mass storage device to connected devices.






            share|improve this answer

























              Your Answer








              StackExchange.ready(function() {
              var channelOptions = {
              tags: "".split(" "),
              id: "106"
              };
              initTagRenderer("".split(" "), "".split(" "), channelOptions);

              StackExchange.using("externalEditor", function() {
              // Have to fire editor after snippets, if snippets enabled
              if (StackExchange.settings.snippets.snippetsEnabled) {
              StackExchange.using("snippets", function() {
              createEditor();
              });
              }
              else {
              createEditor();
              }
              });

              function createEditor() {
              StackExchange.prepareEditor({
              heartbeatType: 'answer',
              autoActivateHeartbeat: false,
              convertImagesToLinks: false,
              noModals: true,
              showLowRepImageUploadWarning: true,
              reputationToPostImages: null,
              bindNavPrevention: true,
              postfix: "",
              imageUploader: {
              brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
              contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
              allowUrls: true
              },
              onDemand: true,
              discardSelector: ".discard-answer"
              ,immediatelyShowMarkdownHelp:true
              });


              }
              });














              draft saved

              draft discarded


















              StackExchange.ready(
              function () {
              StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f120368%2fmake-a-computer-act-as-a-virtual-usb-device-for-other-equipments%23new-answer', 'question_page');
              }
              );

              Post as a guest















              Required, but never shown

























              4 Answers
              4






              active

              oldest

              votes








              4 Answers
              4






              active

              oldest

              votes









              active

              oldest

              votes






              active

              oldest

              votes









              10














              You would need to add a USB Device/Peripheral controller to the computer, as opposed to the USB Host Controller they tend to come with.



              Something like this: https://www.maximintegrated.com/en/products/interface/controllers-expanders/MAX3420E.html



              Unfortunately, you'd have to find a way to wire it onto your motherboard. Technically, it can be done. Practically, you'd have to redesign the motherboard to include it. You might be lucky enough to find an SPI or I2C bus exposed somewhere on your motherboard to allow you to add it, but they're usually wired directly into whatever they're being used for unless you're using a dev board or single-board computer with exposed GPIO and other ports such as a Raspberry Pi.



              The other option would be a USB On-the-Go Controller. Motherboards designed for embedded and portable devices tend to have a USB OTG (On-the-go) contoller, which can function as either a Host or Device controller. For example, the aforementioned Raspberry Pi has an On-the-Go Controller, but on all models except the Pi Zero that gets rewired to a host port or an onboard USB hub denying the use of USB device functionality. The BeagleBone Black has an OTG port.



              That's not all though - once you've got the hardware, you'd also need the software. Linux has some useful kernel USB Gadget drivers ("USB gadget" is another term for USB peripheral/device) such as g_serial and g_ethernet that allow you to plug your device into another computer and be visible as a serial or ethernet-over-USB device (there are others for exposing a device as mass storage, which allow you to use a file as a block device and expose the computer as a mass storage gadget). The BeagleBone Black tends to come with this enabled by default, so you can simply plug it into your PC over USB and see it as a networked device - and I believe it also appears as a mass storage device by using a composite driver (which allows it to appear as multiple USB device types over a single connection.) The Pi Zero can use these, but does not by default. For Windows or other OSes, you'd probably have to write that device driver yourself.



              So, theoretically, you can do it. You can tear down your desktop PC, try and find an unused compatible bus on the motherboard somewhere (most likely some unused pins on a controller IC), or a way to extend an internal I2C or SPI bus, or something you can tear out and replace, and solder a USB OTG or device controller chip onto it. Then you can install Linux and use a gadget driver, or write your own for another OS. Practically, unless you're a top-notch electronics engineer, you're not going to be able to do it. At least, not until someone comes out with that elusive adapter with a device or OTG port on it that plugs into a USB port (theoretically, that could be done with a microcontroller such an Arduino wired to a pair of USB device controller ICs), and writes the drivers to run it.






              share|improve this answer





















              • 1





                great explanation, can you please update the answer if you (with your knowledge) see something new regards your sentence "until someone comes out with exclusive adapter...". There are laptops with usb-c in 2018, could they be a solution.?

                – Asain Kujovic
                Sep 10 '18 at 16:41
















              10














              You would need to add a USB Device/Peripheral controller to the computer, as opposed to the USB Host Controller they tend to come with.



              Something like this: https://www.maximintegrated.com/en/products/interface/controllers-expanders/MAX3420E.html



              Unfortunately, you'd have to find a way to wire it onto your motherboard. Technically, it can be done. Practically, you'd have to redesign the motherboard to include it. You might be lucky enough to find an SPI or I2C bus exposed somewhere on your motherboard to allow you to add it, but they're usually wired directly into whatever they're being used for unless you're using a dev board or single-board computer with exposed GPIO and other ports such as a Raspberry Pi.



              The other option would be a USB On-the-Go Controller. Motherboards designed for embedded and portable devices tend to have a USB OTG (On-the-go) contoller, which can function as either a Host or Device controller. For example, the aforementioned Raspberry Pi has an On-the-Go Controller, but on all models except the Pi Zero that gets rewired to a host port or an onboard USB hub denying the use of USB device functionality. The BeagleBone Black has an OTG port.



              That's not all though - once you've got the hardware, you'd also need the software. Linux has some useful kernel USB Gadget drivers ("USB gadget" is another term for USB peripheral/device) such as g_serial and g_ethernet that allow you to plug your device into another computer and be visible as a serial or ethernet-over-USB device (there are others for exposing a device as mass storage, which allow you to use a file as a block device and expose the computer as a mass storage gadget). The BeagleBone Black tends to come with this enabled by default, so you can simply plug it into your PC over USB and see it as a networked device - and I believe it also appears as a mass storage device by using a composite driver (which allows it to appear as multiple USB device types over a single connection.) The Pi Zero can use these, but does not by default. For Windows or other OSes, you'd probably have to write that device driver yourself.



              So, theoretically, you can do it. You can tear down your desktop PC, try and find an unused compatible bus on the motherboard somewhere (most likely some unused pins on a controller IC), or a way to extend an internal I2C or SPI bus, or something you can tear out and replace, and solder a USB OTG or device controller chip onto it. Then you can install Linux and use a gadget driver, or write your own for another OS. Practically, unless you're a top-notch electronics engineer, you're not going to be able to do it. At least, not until someone comes out with that elusive adapter with a device or OTG port on it that plugs into a USB port (theoretically, that could be done with a microcontroller such an Arduino wired to a pair of USB device controller ICs), and writes the drivers to run it.






              share|improve this answer





















              • 1





                great explanation, can you please update the answer if you (with your knowledge) see something new regards your sentence "until someone comes out with exclusive adapter...". There are laptops with usb-c in 2018, could they be a solution.?

                – Asain Kujovic
                Sep 10 '18 at 16:41














              10












              10








              10







              You would need to add a USB Device/Peripheral controller to the computer, as opposed to the USB Host Controller they tend to come with.



              Something like this: https://www.maximintegrated.com/en/products/interface/controllers-expanders/MAX3420E.html



              Unfortunately, you'd have to find a way to wire it onto your motherboard. Technically, it can be done. Practically, you'd have to redesign the motherboard to include it. You might be lucky enough to find an SPI or I2C bus exposed somewhere on your motherboard to allow you to add it, but they're usually wired directly into whatever they're being used for unless you're using a dev board or single-board computer with exposed GPIO and other ports such as a Raspberry Pi.



              The other option would be a USB On-the-Go Controller. Motherboards designed for embedded and portable devices tend to have a USB OTG (On-the-go) contoller, which can function as either a Host or Device controller. For example, the aforementioned Raspberry Pi has an On-the-Go Controller, but on all models except the Pi Zero that gets rewired to a host port or an onboard USB hub denying the use of USB device functionality. The BeagleBone Black has an OTG port.



              That's not all though - once you've got the hardware, you'd also need the software. Linux has some useful kernel USB Gadget drivers ("USB gadget" is another term for USB peripheral/device) such as g_serial and g_ethernet that allow you to plug your device into another computer and be visible as a serial or ethernet-over-USB device (there are others for exposing a device as mass storage, which allow you to use a file as a block device and expose the computer as a mass storage gadget). The BeagleBone Black tends to come with this enabled by default, so you can simply plug it into your PC over USB and see it as a networked device - and I believe it also appears as a mass storage device by using a composite driver (which allows it to appear as multiple USB device types over a single connection.) The Pi Zero can use these, but does not by default. For Windows or other OSes, you'd probably have to write that device driver yourself.



              So, theoretically, you can do it. You can tear down your desktop PC, try and find an unused compatible bus on the motherboard somewhere (most likely some unused pins on a controller IC), or a way to extend an internal I2C or SPI bus, or something you can tear out and replace, and solder a USB OTG or device controller chip onto it. Then you can install Linux and use a gadget driver, or write your own for another OS. Practically, unless you're a top-notch electronics engineer, you're not going to be able to do it. At least, not until someone comes out with that elusive adapter with a device or OTG port on it that plugs into a USB port (theoretically, that could be done with a microcontroller such an Arduino wired to a pair of USB device controller ICs), and writes the drivers to run it.






              share|improve this answer















              You would need to add a USB Device/Peripheral controller to the computer, as opposed to the USB Host Controller they tend to come with.



              Something like this: https://www.maximintegrated.com/en/products/interface/controllers-expanders/MAX3420E.html



              Unfortunately, you'd have to find a way to wire it onto your motherboard. Technically, it can be done. Practically, you'd have to redesign the motherboard to include it. You might be lucky enough to find an SPI or I2C bus exposed somewhere on your motherboard to allow you to add it, but they're usually wired directly into whatever they're being used for unless you're using a dev board or single-board computer with exposed GPIO and other ports such as a Raspberry Pi.



              The other option would be a USB On-the-Go Controller. Motherboards designed for embedded and portable devices tend to have a USB OTG (On-the-go) contoller, which can function as either a Host or Device controller. For example, the aforementioned Raspberry Pi has an On-the-Go Controller, but on all models except the Pi Zero that gets rewired to a host port or an onboard USB hub denying the use of USB device functionality. The BeagleBone Black has an OTG port.



              That's not all though - once you've got the hardware, you'd also need the software. Linux has some useful kernel USB Gadget drivers ("USB gadget" is another term for USB peripheral/device) such as g_serial and g_ethernet that allow you to plug your device into another computer and be visible as a serial or ethernet-over-USB device (there are others for exposing a device as mass storage, which allow you to use a file as a block device and expose the computer as a mass storage gadget). The BeagleBone Black tends to come with this enabled by default, so you can simply plug it into your PC over USB and see it as a networked device - and I believe it also appears as a mass storage device by using a composite driver (which allows it to appear as multiple USB device types over a single connection.) The Pi Zero can use these, but does not by default. For Windows or other OSes, you'd probably have to write that device driver yourself.



              So, theoretically, you can do it. You can tear down your desktop PC, try and find an unused compatible bus on the motherboard somewhere (most likely some unused pins on a controller IC), or a way to extend an internal I2C or SPI bus, or something you can tear out and replace, and solder a USB OTG or device controller chip onto it. Then you can install Linux and use a gadget driver, or write your own for another OS. Practically, unless you're a top-notch electronics engineer, you're not going to be able to do it. At least, not until someone comes out with that elusive adapter with a device or OTG port on it that plugs into a USB port (theoretically, that could be done with a microcontroller such an Arduino wired to a pair of USB device controller ICs), and writes the drivers to run it.







              share|improve this answer














              share|improve this answer



              share|improve this answer








              edited May 14 '16 at 15:06

























              answered May 14 '16 at 14:54









              Matt ThomasonMatt Thomason

              21625




              21625








              • 1





                great explanation, can you please update the answer if you (with your knowledge) see something new regards your sentence "until someone comes out with exclusive adapter...". There are laptops with usb-c in 2018, could they be a solution.?

                – Asain Kujovic
                Sep 10 '18 at 16:41














              • 1





                great explanation, can you please update the answer if you (with your knowledge) see something new regards your sentence "until someone comes out with exclusive adapter...". There are laptops with usb-c in 2018, could they be a solution.?

                – Asain Kujovic
                Sep 10 '18 at 16:41








              1




              1





              great explanation, can you please update the answer if you (with your knowledge) see something new regards your sentence "until someone comes out with exclusive adapter...". There are laptops with usb-c in 2018, could they be a solution.?

              – Asain Kujovic
              Sep 10 '18 at 16:41





              great explanation, can you please update the answer if you (with your knowledge) see something new regards your sentence "until someone comes out with exclusive adapter...". There are laptops with usb-c in 2018, could they be a solution.?

              – Asain Kujovic
              Sep 10 '18 at 16:41













              6














              USB is dissymmetric: one side is a host, the other side is a peripheral device. You can't make a peripheral device act as a host or vice versa. It is possible for a USB port to be able to act as either side; this is called USB on-the-go and is present on some mobile phones and tablets. The ports are physically device-type ports, not host-type ports. I've never seen a PC with a device port. This requires electronics on the controller, it isn't enough to make a cable that fits on both ends.



              So no, you won't be able to make a PC into a USB device.



              If you want to use a computer as a USB storage device, you can use a mobile phone or tablet with a USB connection instead of using a PC.






              share|improve this answer


























              • Can you elaborate a bit more, how using a mobile phone could help me turning my PC into a USB storage device / host, that I could plug to another compter, TV or device? I think, I'm missing this point, though I think I have a fair knowledge about USB OTG.

                – trejder
                Mar 10 '15 at 8:15











              • @trejder As I wrote, I've never seen a PC with a device port (“PC” excluding x86 tablets).

                – Gilles
                Mar 10 '15 at 8:19











              • Yes, but I'm refferring to your last sentence: "If you want to make a computer into a USB storage device, you can use a mobile phone or tablet with a USB connection". Maybe I'm missing something, but I understand it as "You can use mobile phone or tablet to turn computer into USB storage device". If so, then the question is: How?

                – trejder
                Mar 10 '15 at 8:23






              • 1





                @trejder Ah, “computer” in that sentence is not “PC”, it's “computer”. A phone/tablet is a different kind of computer from a PC. Is that what's troubling you?

                – Gilles
                Mar 10 '15 at 8:27






              • 1





                @trejder No. Usually your best bet is to establish a network connection one way or another. You can use Firewire as a network connection between any two PCs with a Firewire port, but many PCs don't have one. Most PCs have an Ethernet port, you can connect two PCs with an Ethernet cable (very old PCs require a crossover cable but modern ones can take an ordinary cable). To make a PC serve as a storage device for a mobile device, you typically need to get the PC onto wifi somehow.

                – Gilles
                Mar 10 '15 at 8:35
















              6














              USB is dissymmetric: one side is a host, the other side is a peripheral device. You can't make a peripheral device act as a host or vice versa. It is possible for a USB port to be able to act as either side; this is called USB on-the-go and is present on some mobile phones and tablets. The ports are physically device-type ports, not host-type ports. I've never seen a PC with a device port. This requires electronics on the controller, it isn't enough to make a cable that fits on both ends.



              So no, you won't be able to make a PC into a USB device.



              If you want to use a computer as a USB storage device, you can use a mobile phone or tablet with a USB connection instead of using a PC.






              share|improve this answer


























              • Can you elaborate a bit more, how using a mobile phone could help me turning my PC into a USB storage device / host, that I could plug to another compter, TV or device? I think, I'm missing this point, though I think I have a fair knowledge about USB OTG.

                – trejder
                Mar 10 '15 at 8:15











              • @trejder As I wrote, I've never seen a PC with a device port (“PC” excluding x86 tablets).

                – Gilles
                Mar 10 '15 at 8:19











              • Yes, but I'm refferring to your last sentence: "If you want to make a computer into a USB storage device, you can use a mobile phone or tablet with a USB connection". Maybe I'm missing something, but I understand it as "You can use mobile phone or tablet to turn computer into USB storage device". If so, then the question is: How?

                – trejder
                Mar 10 '15 at 8:23






              • 1





                @trejder Ah, “computer” in that sentence is not “PC”, it's “computer”. A phone/tablet is a different kind of computer from a PC. Is that what's troubling you?

                – Gilles
                Mar 10 '15 at 8:27






              • 1





                @trejder No. Usually your best bet is to establish a network connection one way or another. You can use Firewire as a network connection between any two PCs with a Firewire port, but many PCs don't have one. Most PCs have an Ethernet port, you can connect two PCs with an Ethernet cable (very old PCs require a crossover cable but modern ones can take an ordinary cable). To make a PC serve as a storage device for a mobile device, you typically need to get the PC onto wifi somehow.

                – Gilles
                Mar 10 '15 at 8:35














              6












              6








              6







              USB is dissymmetric: one side is a host, the other side is a peripheral device. You can't make a peripheral device act as a host or vice versa. It is possible for a USB port to be able to act as either side; this is called USB on-the-go and is present on some mobile phones and tablets. The ports are physically device-type ports, not host-type ports. I've never seen a PC with a device port. This requires electronics on the controller, it isn't enough to make a cable that fits on both ends.



              So no, you won't be able to make a PC into a USB device.



              If you want to use a computer as a USB storage device, you can use a mobile phone or tablet with a USB connection instead of using a PC.






              share|improve this answer















              USB is dissymmetric: one side is a host, the other side is a peripheral device. You can't make a peripheral device act as a host or vice versa. It is possible for a USB port to be able to act as either side; this is called USB on-the-go and is present on some mobile phones and tablets. The ports are physically device-type ports, not host-type ports. I've never seen a PC with a device port. This requires electronics on the controller, it isn't enough to make a cable that fits on both ends.



              So no, you won't be able to make a PC into a USB device.



              If you want to use a computer as a USB storage device, you can use a mobile phone or tablet with a USB connection instead of using a PC.







              share|improve this answer














              share|improve this answer



              share|improve this answer








              edited Mar 10 '15 at 8:28

























              answered Mar 20 '14 at 1:47









              GillesGilles

              537k12810871604




              537k12810871604













              • Can you elaborate a bit more, how using a mobile phone could help me turning my PC into a USB storage device / host, that I could plug to another compter, TV or device? I think, I'm missing this point, though I think I have a fair knowledge about USB OTG.

                – trejder
                Mar 10 '15 at 8:15











              • @trejder As I wrote, I've never seen a PC with a device port (“PC” excluding x86 tablets).

                – Gilles
                Mar 10 '15 at 8:19











              • Yes, but I'm refferring to your last sentence: "If you want to make a computer into a USB storage device, you can use a mobile phone or tablet with a USB connection". Maybe I'm missing something, but I understand it as "You can use mobile phone or tablet to turn computer into USB storage device". If so, then the question is: How?

                – trejder
                Mar 10 '15 at 8:23






              • 1





                @trejder Ah, “computer” in that sentence is not “PC”, it's “computer”. A phone/tablet is a different kind of computer from a PC. Is that what's troubling you?

                – Gilles
                Mar 10 '15 at 8:27






              • 1





                @trejder No. Usually your best bet is to establish a network connection one way or another. You can use Firewire as a network connection between any two PCs with a Firewire port, but many PCs don't have one. Most PCs have an Ethernet port, you can connect two PCs with an Ethernet cable (very old PCs require a crossover cable but modern ones can take an ordinary cable). To make a PC serve as a storage device for a mobile device, you typically need to get the PC onto wifi somehow.

                – Gilles
                Mar 10 '15 at 8:35



















              • Can you elaborate a bit more, how using a mobile phone could help me turning my PC into a USB storage device / host, that I could plug to another compter, TV or device? I think, I'm missing this point, though I think I have a fair knowledge about USB OTG.

                – trejder
                Mar 10 '15 at 8:15











              • @trejder As I wrote, I've never seen a PC with a device port (“PC” excluding x86 tablets).

                – Gilles
                Mar 10 '15 at 8:19











              • Yes, but I'm refferring to your last sentence: "If you want to make a computer into a USB storage device, you can use a mobile phone or tablet with a USB connection". Maybe I'm missing something, but I understand it as "You can use mobile phone or tablet to turn computer into USB storage device". If so, then the question is: How?

                – trejder
                Mar 10 '15 at 8:23






              • 1





                @trejder Ah, “computer” in that sentence is not “PC”, it's “computer”. A phone/tablet is a different kind of computer from a PC. Is that what's troubling you?

                – Gilles
                Mar 10 '15 at 8:27






              • 1





                @trejder No. Usually your best bet is to establish a network connection one way or another. You can use Firewire as a network connection between any two PCs with a Firewire port, but many PCs don't have one. Most PCs have an Ethernet port, you can connect two PCs with an Ethernet cable (very old PCs require a crossover cable but modern ones can take an ordinary cable). To make a PC serve as a storage device for a mobile device, you typically need to get the PC onto wifi somehow.

                – Gilles
                Mar 10 '15 at 8:35

















              Can you elaborate a bit more, how using a mobile phone could help me turning my PC into a USB storage device / host, that I could plug to another compter, TV or device? I think, I'm missing this point, though I think I have a fair knowledge about USB OTG.

              – trejder
              Mar 10 '15 at 8:15





              Can you elaborate a bit more, how using a mobile phone could help me turning my PC into a USB storage device / host, that I could plug to another compter, TV or device? I think, I'm missing this point, though I think I have a fair knowledge about USB OTG.

              – trejder
              Mar 10 '15 at 8:15













              @trejder As I wrote, I've never seen a PC with a device port (“PC” excluding x86 tablets).

              – Gilles
              Mar 10 '15 at 8:19





              @trejder As I wrote, I've never seen a PC with a device port (“PC” excluding x86 tablets).

              – Gilles
              Mar 10 '15 at 8:19













              Yes, but I'm refferring to your last sentence: "If you want to make a computer into a USB storage device, you can use a mobile phone or tablet with a USB connection". Maybe I'm missing something, but I understand it as "You can use mobile phone or tablet to turn computer into USB storage device". If so, then the question is: How?

              – trejder
              Mar 10 '15 at 8:23





              Yes, but I'm refferring to your last sentence: "If you want to make a computer into a USB storage device, you can use a mobile phone or tablet with a USB connection". Maybe I'm missing something, but I understand it as "You can use mobile phone or tablet to turn computer into USB storage device". If so, then the question is: How?

              – trejder
              Mar 10 '15 at 8:23




              1




              1





              @trejder Ah, “computer” in that sentence is not “PC”, it's “computer”. A phone/tablet is a different kind of computer from a PC. Is that what's troubling you?

              – Gilles
              Mar 10 '15 at 8:27





              @trejder Ah, “computer” in that sentence is not “PC”, it's “computer”. A phone/tablet is a different kind of computer from a PC. Is that what's troubling you?

              – Gilles
              Mar 10 '15 at 8:27




              1




              1





              @trejder No. Usually your best bet is to establish a network connection one way or another. You can use Firewire as a network connection between any two PCs with a Firewire port, but many PCs don't have one. Most PCs have an Ethernet port, you can connect two PCs with an Ethernet cable (very old PCs require a crossover cable but modern ones can take an ordinary cable). To make a PC serve as a storage device for a mobile device, you typically need to get the PC onto wifi somehow.

              – Gilles
              Mar 10 '15 at 8:35





              @trejder No. Usually your best bet is to establish a network connection one way or another. You can use Firewire as a network connection between any two PCs with a Firewire port, but many PCs don't have one. Most PCs have an Ethernet port, you can connect two PCs with an Ethernet cable (very old PCs require a crossover cable but modern ones can take an ordinary cable). To make a PC serve as a storage device for a mobile device, you typically need to get the PC onto wifi somehow.

              – Gilles
              Mar 10 '15 at 8:35











              2














              You can consider using one of special "USB-USB bridged cables", sometimes called "USB networking cables". Like one mentioned in these articles:





              • Connecting Two PCs using USB-USB Cable,


              • Connecting two computers with a USB cable,


              • How to Link Two Computers Using a USB Cable.


              They allow you to transfer files between two PCs. I've been using these kind of cables over ten years ago (in times of Windows XP) and in that times all such cables available to the market required a special driver and software. They let you transfer files only through special file commander, that shiped along with cable drivers on a installation disk and therefore did not allow one PC to act to another as pure USB external device.



              I'm not sure, if anything has changed since then and if new solutions allow you only to transfer files using special software and -- if you can force one PC to act as an external device to another PC.






              share|improve this answer




























                2














                You can consider using one of special "USB-USB bridged cables", sometimes called "USB networking cables". Like one mentioned in these articles:





                • Connecting Two PCs using USB-USB Cable,


                • Connecting two computers with a USB cable,


                • How to Link Two Computers Using a USB Cable.


                They allow you to transfer files between two PCs. I've been using these kind of cables over ten years ago (in times of Windows XP) and in that times all such cables available to the market required a special driver and software. They let you transfer files only through special file commander, that shiped along with cable drivers on a installation disk and therefore did not allow one PC to act to another as pure USB external device.



                I'm not sure, if anything has changed since then and if new solutions allow you only to transfer files using special software and -- if you can force one PC to act as an external device to another PC.






                share|improve this answer


























                  2












                  2








                  2







                  You can consider using one of special "USB-USB bridged cables", sometimes called "USB networking cables". Like one mentioned in these articles:





                  • Connecting Two PCs using USB-USB Cable,


                  • Connecting two computers with a USB cable,


                  • How to Link Two Computers Using a USB Cable.


                  They allow you to transfer files between two PCs. I've been using these kind of cables over ten years ago (in times of Windows XP) and in that times all such cables available to the market required a special driver and software. They let you transfer files only through special file commander, that shiped along with cable drivers on a installation disk and therefore did not allow one PC to act to another as pure USB external device.



                  I'm not sure, if anything has changed since then and if new solutions allow you only to transfer files using special software and -- if you can force one PC to act as an external device to another PC.






                  share|improve this answer













                  You can consider using one of special "USB-USB bridged cables", sometimes called "USB networking cables". Like one mentioned in these articles:





                  • Connecting Two PCs using USB-USB Cable,


                  • Connecting two computers with a USB cable,


                  • How to Link Two Computers Using a USB Cable.


                  They allow you to transfer files between two PCs. I've been using these kind of cables over ten years ago (in times of Windows XP) and in that times all such cables available to the market required a special driver and software. They let you transfer files only through special file commander, that shiped along with cable drivers on a installation disk and therefore did not allow one PC to act to another as pure USB external device.



                  I'm not sure, if anything has changed since then and if new solutions allow you only to transfer files using special software and -- if you can force one PC to act as an external device to another PC.







                  share|improve this answer












                  share|improve this answer



                  share|improve this answer










                  answered Mar 10 '15 at 9:24









                  trejdertrejder

                  3381621




                  3381621























                      2














                      As explained in the answer by by Matt Thomson, it is not properly possible to make a physical USB port of a PC computer act as a USB slave device, as the USB slave controller is missing.



                      That means if we have an adapter board that can provide slave-mode USB (such as the Raspberry Pi Zero), we have to connect it to your host PC by a different channel, such as wired Ethernet. I have two different proposals what protocol you could run over that Ethernet connection:



                      (1) Expose the USB port over IP network.



                      Use software to expose the USB slave-mode port of the Raspberry Pi Zero as a virtual USB device to your PC. The USB/IP project provides this, by means of a driver that can transport USB over IP networks. Here is an example of using USB/IP to provide a simulated USB device to a computer – which would be your PC here.



                      What I don't know in this proposed solution is if the USB/IP software is already able to expose a USB slave port over IP network, or only a USB host port as normal.



                      But even if that works, you still have to set up or adapt device drivers on your PC in such a way that they (1) accept the incoming USB/IP connection as a USB connection, (2) provide USB slave-mode rather than USB host-mode, (3) simulate a USB mass storage device by serving the data from the assigned location (your .vdi file).



                      Overall, that's a complex way of doing it.



                      (2) Expose the file over IP network.



                      This is a much simpler way for how to utilize the Ethernet connection to the Raspberry Pi Zero: on the Raspberry Pi Zero, mount the data stored on your PC via a network file system. These files then appear logically as part of the Pi Zero's file system, and you can serve them with the Linux USB gadget driver to make the Raspberry Pi look like a USB mass storage device to connected devices.






                      share|improve this answer






























                        2














                        As explained in the answer by by Matt Thomson, it is not properly possible to make a physical USB port of a PC computer act as a USB slave device, as the USB slave controller is missing.



                        That means if we have an adapter board that can provide slave-mode USB (such as the Raspberry Pi Zero), we have to connect it to your host PC by a different channel, such as wired Ethernet. I have two different proposals what protocol you could run over that Ethernet connection:



                        (1) Expose the USB port over IP network.



                        Use software to expose the USB slave-mode port of the Raspberry Pi Zero as a virtual USB device to your PC. The USB/IP project provides this, by means of a driver that can transport USB over IP networks. Here is an example of using USB/IP to provide a simulated USB device to a computer – which would be your PC here.



                        What I don't know in this proposed solution is if the USB/IP software is already able to expose a USB slave port over IP network, or only a USB host port as normal.



                        But even if that works, you still have to set up or adapt device drivers on your PC in such a way that they (1) accept the incoming USB/IP connection as a USB connection, (2) provide USB slave-mode rather than USB host-mode, (3) simulate a USB mass storage device by serving the data from the assigned location (your .vdi file).



                        Overall, that's a complex way of doing it.



                        (2) Expose the file over IP network.



                        This is a much simpler way for how to utilize the Ethernet connection to the Raspberry Pi Zero: on the Raspberry Pi Zero, mount the data stored on your PC via a network file system. These files then appear logically as part of the Pi Zero's file system, and you can serve them with the Linux USB gadget driver to make the Raspberry Pi look like a USB mass storage device to connected devices.






                        share|improve this answer




























                          2












                          2








                          2







                          As explained in the answer by by Matt Thomson, it is not properly possible to make a physical USB port of a PC computer act as a USB slave device, as the USB slave controller is missing.



                          That means if we have an adapter board that can provide slave-mode USB (such as the Raspberry Pi Zero), we have to connect it to your host PC by a different channel, such as wired Ethernet. I have two different proposals what protocol you could run over that Ethernet connection:



                          (1) Expose the USB port over IP network.



                          Use software to expose the USB slave-mode port of the Raspberry Pi Zero as a virtual USB device to your PC. The USB/IP project provides this, by means of a driver that can transport USB over IP networks. Here is an example of using USB/IP to provide a simulated USB device to a computer – which would be your PC here.



                          What I don't know in this proposed solution is if the USB/IP software is already able to expose a USB slave port over IP network, or only a USB host port as normal.



                          But even if that works, you still have to set up or adapt device drivers on your PC in such a way that they (1) accept the incoming USB/IP connection as a USB connection, (2) provide USB slave-mode rather than USB host-mode, (3) simulate a USB mass storage device by serving the data from the assigned location (your .vdi file).



                          Overall, that's a complex way of doing it.



                          (2) Expose the file over IP network.



                          This is a much simpler way for how to utilize the Ethernet connection to the Raspberry Pi Zero: on the Raspberry Pi Zero, mount the data stored on your PC via a network file system. These files then appear logically as part of the Pi Zero's file system, and you can serve them with the Linux USB gadget driver to make the Raspberry Pi look like a USB mass storage device to connected devices.






                          share|improve this answer















                          As explained in the answer by by Matt Thomson, it is not properly possible to make a physical USB port of a PC computer act as a USB slave device, as the USB slave controller is missing.



                          That means if we have an adapter board that can provide slave-mode USB (such as the Raspberry Pi Zero), we have to connect it to your host PC by a different channel, such as wired Ethernet. I have two different proposals what protocol you could run over that Ethernet connection:



                          (1) Expose the USB port over IP network.



                          Use software to expose the USB slave-mode port of the Raspberry Pi Zero as a virtual USB device to your PC. The USB/IP project provides this, by means of a driver that can transport USB over IP networks. Here is an example of using USB/IP to provide a simulated USB device to a computer – which would be your PC here.



                          What I don't know in this proposed solution is if the USB/IP software is already able to expose a USB slave port over IP network, or only a USB host port as normal.



                          But even if that works, you still have to set up or adapt device drivers on your PC in such a way that they (1) accept the incoming USB/IP connection as a USB connection, (2) provide USB slave-mode rather than USB host-mode, (3) simulate a USB mass storage device by serving the data from the assigned location (your .vdi file).



                          Overall, that's a complex way of doing it.



                          (2) Expose the file over IP network.



                          This is a much simpler way for how to utilize the Ethernet connection to the Raspberry Pi Zero: on the Raspberry Pi Zero, mount the data stored on your PC via a network file system. These files then appear logically as part of the Pi Zero's file system, and you can serve them with the Linux USB gadget driver to make the Raspberry Pi look like a USB mass storage device to connected devices.







                          share|improve this answer














                          share|improve this answer



                          share|improve this answer








                          edited Feb 3 at 22:08

























                          answered Oct 31 '17 at 0:08









                          taniustanius

                          35037




                          35037






























                              draft saved

                              draft discarded




















































                              Thanks for contributing an answer to Unix & Linux Stack Exchange!


                              • Please be sure to answer the question. Provide details and share your research!

                              But avoid



                              • Asking for help, clarification, or responding to other answers.

                              • Making statements based on opinion; back them up with references or personal experience.


                              To learn more, see our tips on writing great answers.




                              draft saved


                              draft discarded














                              StackExchange.ready(
                              function () {
                              StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f120368%2fmake-a-computer-act-as-a-virtual-usb-device-for-other-equipments%23new-answer', 'question_page');
                              }
                              );

                              Post as a guest















                              Required, but never shown





















































                              Required, but never shown














                              Required, but never shown












                              Required, but never shown







                              Required, but never shown

































                              Required, but never shown














                              Required, but never shown












                              Required, but never shown







                              Required, but never shown







                              Popular posts from this blog

                              How to reconfigure Docker Trusted Registry 2.x.x to use CEPH FS mount instead of NFS and other traditional...

                              is 'sed' thread safe

                              How to make a Squid Proxy server?