3

I have two computers, a Debian laptop and windows PC.

I have data available in my Debian machine which I want to use in windows machine. I'm aware of NFS and network file sharing, but is it possible to use USB to solve this issue?

Making Debian to act like USB device, I can connect it to windows PC to share some of my data stored on Debian Machine using USB male-to-male cable.

Is it possible to accomplish it using USB?

migrated from serverfault.com Jul 23 '15 at 19:59

This question came from our site for system and network administrators.

4

Both the laptop and the PC are USB hosts with female type A connectors. You cannot directly connect two USB hosts with a Male-Male cable. One of the device's would need to act as a peripheral, which wouldn't be supported by the USB chipset on the motherboard.

Some devices support acting as a host or peripheral with USB on-the-go, but I don't think any personal computers would support this.

There are active cables that act as two peripheral's (one for each host), but you would have to make sure they were supported by the OS.

2

There are ways to connect devices using USB, such as http://www.linux-usb.org/usbnet/. This however simulates an ethernet network, which you are probably trying to avoid. I'm pretty sure it's not possible to connect a computer as a USB drive.

Your best bet is probably the regular network way, or you can write the USB interconnect driver yourself.

  • I'm pretty sure it's not possible to connect a computer - I don't believe that. But if you did do something you would probably have to present the storage to the remote computer as a block device. Since USB storage is not a network file sharing protocol, it most likely expects to have exclusive direct access to the filesystem. – Zoredache Jul 22 '15 at 19:07
1

The issue with using USB in this manner is that USB is a Master-Slave protocol, and most computers only come with Master or Host capable USB ports.

If you were to find a way to add a Slave (or Device) port to your laptop, then you could use the Mass Storage Gadget implementation found here to make your laptop show up as a mass storage device.

If you can't find a way to add a Slave port to your laptop, you can go with the Ethernet(or similar)-over-USB method using a host-to-host network cable; this requires a special USB bridge cable, not a straight USB A to A cable. If you use a straight USB A to A cable, you can burn up your power supplies! This will create a USB based network connection between the machines, one that you can even bridge to your Ethernet network. You'll also need the appropriate drivers for the cable for each system.

-1

I can think of one solution: clone the laptop HDD to a USB. Change the BIOS settings in the Windows box to boot USB first and then you boot your Debian system on the Win computer like a USB. If the Windows partition is not encrypted, you will be able to mount it from your portable Debian system and can exchange files as you wish.

You might need a USB with 64 or 128 GB depending on how much info there's in your Debian system. And I believe that you were not looking for a way to migrate your entire laptop to a USB, but nevertheless, this is a solution to the problem you want to solve:

"Make Debian act as a USB device which I can plug into another machine."

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy