3

I need to make a large file transfer between a Macbook air and Ubuntu Desktop (16.04). Is this possible with a usb to usb cable? Would I need a driver to get the cable to work in Ubuntu?

Thanks

James
  • 33

5 Answers5

4

Typically, data is transferred between computers using a network, such as your LAN. A lot of the time a router is involved, but you can create a network between two machines in the same way, using WiFi or crossover cables. While it may be obvious, the speed of the transfer will be limited by the speed of the network speed, so you should try to use wire connections if possible.

Once you establish a network, you can use programs such as rsync, sshfs, scp or even samba to share files between the computers.

Another solution, especially when dealing with raw data (vs files), or a lot of data, would be for you to remove the HDD from one machine, and connect it to the other machine. You can buy special SATA to USB cables or self-powered devices to make this easier. Unfortunately, it is unlikely that you can remove the HDD from the Apple product.


Is there a reason both of these machines couldn't be hooked up to a router/switch so that you could use SAMBA, or other data-transferring programs? How often do you intend to need to do this? Do you actually have a Standard A to Standard A USB cable?

You can find more information about difficulties using USB in this way by checking out this explanation, or look at a more hopeful explanation that this is possible by using TCP/IP over USB.

earthmeLon
  • 11,247
  • A Standard A to Standard A USB cable wouldn't be enough. The cables for this purpose that existed some 15-20 years ago add some hardware (chip) on it and, If I'm not mistaken, emulated a mass storage device in the destination PC and worked for Windows only with proprietary drivers/software. –  Jan 22 '17 at 00:18
1

I realize that this question was asked years ago but I'll answer in case someone has the same question and finds this thread. One means to transfer files to and from most newer Macs by USB is with target disk mode. Apple has support pages on this, and other tech sites cover this option as well. https://support.apple.com/guide/mac-help/transfer-files-mac-computers-target-disk-mode-mchlp1443/mac

https://www.macworld.com/article/2911813/got-a-new-macbook-usb-target-disk-mode-works-with-the-right-cable-which-apple-doesnt-sell.html

The Apple support pages will claim it only works with Thunderbolt and FireWire but I have successfully used USB transfers between two Mac laptops using a common USB-C male to USB-A male cable. I also recall seeing Apple list USB as a supported means to use target disk mode in older support documents. This may suggest that USB target disk mode is no longer supported by Apple but that does not mean it doesn't work, it does work because I used it.

That solves the problem of making the connection but not of getting the Ubuntu host computer to read and write the Mac drive. Depending on how the Mac is setup the drive could be formatted in a number of different file systems, could have multiple partitions (for dual boot with Boot Camp as an example), and could be encrypted. As I recall it should be trivial to mount and read an unencrypted macOS drive as this is something included in most Linux distributions or is easily installed. Read and write access might be slightly more difficult. If the drive is encrypted then target disk mode may not be helpful in transferring files with anything other than another macOS computer.

I have tried file transfers between Ubuntu and macOS using an active USB transfer cable without success. Such cables are called "easy transfer" cables (named after the Windows utility by that name) or "LapLink" cables (after a popular manufacturer of such cables) or just "USB transfer cable". With some effort such cables should work well, I have not put in the required effort just yet. Be aware that there are two kinds of such cables. There's the USB 2.0 version which is widely supported but limited to 480 Mbps speeds. There's the much faster USB 3.x cables, which can transfer date at gigabit speeds, but may leave the user with driver and configuration difficulty. It's this configuration difficulty that I've run into. Ubuntu sees the cable as an Ethernet adapter but the macOS computer sees it as a serial adapter. Such cables can act in a network emulation mode or serial emulation mode but both systems need to use the same mode for a connection to be established.

There are open source projects out there that are working on means to aid in USB host to USB host data transfer. One is called something like "USB gadgets" which allows a Linux USB host to act like a USB device. With a virtual USB device emulated on an Ubuntu host the macOS USB host could see the Ubuntu system as a USB standard drive, network device, or serial device. Most computers with a USB-C port is capable of acting in USB device mode, this is required of any laptop that uses USB-C to charge its batteries. This can be demonstrated by plugging such a laptop into another computer using a USB-C male to USB-A male cable, the laptop will appear to the other computer as a USB device. For this connection to do more than provide power to the laptop there needs to be the right kinds of software on both systems, and "USB gadgets" is one project to create that software.

In summary there's three methods I know of to try. There's target disk mode on most or all Mac computers with a USB-C port. This allows the Mac to act as a USB drive to another computer with a passive USB cable. There's active USB cables that will appear to both systems as a network or serial adapter. There's the USB gadget software that will allow an Ubuntu computer to act like a USB device to another computer, and using a passive USB cable. This will require the Ubuntu system to have a relatively common USB-C port or an uncommon USB-B port. All options carry their own pros and cons.

MacGuffin
  • 377
1

a thunderbolt cable will do just nicely, just connect the 2 devices using their thunderbolt ports if they have tehse, networkmanager will create a link local network, both hosts share the same ip, you can then scp files over, or even enable file sharing in the mac and browse the filesystem from the ubuntu machine.

https://christian.kellner.me/2018/05/24/thunderbolt-networking-on-linux/

0

I succeeded with the following actions.

1, connect Ubuntun and Mac (using USB port) with a ethernet cable.

2, you need to assign IP address manually in both computers:

In Ubuntu, you can use this command:

sudo ip ad add 10.0.0.3/24 dev eth0

Or you can follow this link with more details there.

In Mac, go to "system preference > Networks". There are several connections in the left panel. Note: choose "AX88179A" instead of "USB 10/1000..". Then config it as shown in the picture.

Snapshot of network preference, Assign IP address in Mac

"AX88179A" may appear differently in your Mac (mine is MacbookPro MacOS big sur 11.6). You can plug and unplug the ethernet cable and see which connection changes its order in the left panel. Then it is the one you should manually config.

Lin
  • 31
-2

USB is not made to connect two computers. It is a bus system, where you have one computer (taking the role of a bus master) and several slave devices that send or receive some data on request of the master. Even your smartphone, when connected to your PC via USB, will act as a slave device, similar to a thumb drive.

What you need is either a network (e.g. Wifi or LAN), or a mass storage device to move the date between both computers (e.g. a thumb drive or a external hard disk). You won't need special drivers for either option.

craesh
  • 125
  • FYI, some 15-20 years ago there were USB cables for the exact purpose the OP wants. –  Jan 22 '17 at 00:14
  • Do you have any sources for that? Haven't heard of it. Is there a standard for it, or just a proprietary solution that may be abandoned as of today? – craesh Jan 22 '17 at 12:24
  • 1
    I thought abandoned but they still exist: http://plugable.com/products/usb-easy-tran/ –  Jan 22 '17 at 19:11
  • Interesting! But according to the website: "Linux kernels 3.0 and later support the cable as a high-speed virtual network interface, but offer no special file transfer support. No support for Mac." so it won't be of use for the OP. But anyway, if I understood it correctly, it is not in contradiction to what I wrote above. It's still a master-slave architecture, where the device acts as slave for two masters and does some magic in between. – craesh Jan 22 '17 at 19:27
  • No, not in contradiction at all. And I saw it now because you asked :) Before (first comment), I was merely reminiscing. –  Jan 22 '17 at 19:29
  • “ USB is not made to connect two computers.” USB-C supported computer to computer connections since 2014. We had USB 3.0 document how to do computer to computer connections by USB-A to USB-A in 2008. There’s been documentation on how to take advantage of this capability for kernel debugging in Windows and Linux since perhaps 2012. The hardware is there if the USB controllers followed the spec. It is incorrect to claim USB is not made for this, it is in the spec. – MacGuffin Oct 16 '22 at 02:55