Mailing List Archive

File transfer via USB?
I'm trying to figure out a convenient way to transfer files between a
Linux machine (running Gentoo) and a Windows 10 machine (which has no
internet access). IP connection between the machines is not allowed.

Yes, I can shuffle a USB flash drive back and forth, but that's
really annoying.

Can I run an MTP server on a Linux host and connect a USB-C port on
the Linux machine to the USB-C port on the Windows machine (assuming
the Linux port is dual-role, which I need to confirm).

--
Grant
Re: File transfer via USB? [ In reply to ]
Grant:
> I'm trying to figure out a convenient way to transfer files between a
> Linux machine (running Gentoo) and a Windows 10 machine (which has no
> internet access). IP connection between the machines is not allowed.

No IP doesn't prohibit ethernet.

You could possible use:
raw ethernet frames
netbeui
samba
ethertalk (appletalk)
http://netatalk.sourceforge.net/
ipx (netware)
ftp://ftp.koansoftware.com/public/opensource/mars_nwe/mars_nwe-0.99.pl21.tgz

I have previously (in the 90's) used mars, worked great.

Regards,
/Karl Hammar
Re: File transfer via USB? [ In reply to ]
On 2021-04-22 14:27-0000 Grant Edwards <grant.b.edwards@gmail.com>
wrote:

> I'm trying to figure out a convenient way to transfer files between a
> Linux machine (running Gentoo) and a Windows 10 machine (which has no
> internet access). IP connection between the machines is not allowed.

The easiest solution would be to connect both machines with an ethernet
cable and run samba on Linux. The interfaces will be configured with a
link-local address¹ automatically.

> Yes, I can shuffle a USB flash drive back and forth, but that's
> really annoying.
>
> Can I run an MTP server on a Linux host and connect a USB-C port on
> the Linux machine to the USB-C port on the Windows machine (assuming
> the Linux port is dual-role, which I need to confirm).

If USB connections between the 2 machines are allowed then “IP
connection between the machines is not allowed” surely does not apply
to direct ethernet connections between the 2 machines?

¹ <https://en.wikipedia.org/wiki/Link-local_address>

--
Get my PGP key with `gpg --locate-keys tastytea@tastytea.de` or at
<https://tastytea.de/tastytea.asc>.
Re: File transfer via USB? [ In reply to ]
On 2021-04-22, tastytea <gentoo@tastytea.de> wrote:
> On 2021-04-22 14:27-0000 Grant Edwards <grant.b.edwards@gmail.com>
> wrote:
>
>> I'm trying to figure out a convenient way to transfer files between a
>> Linux machine (running Gentoo) and a Windows 10 machine (which has no
>> internet access). IP connection between the machines is not allowed.
>
> The easiest solution would be to connect both machines with an ethernet
> cable and run samba on Linux. The interfaces will be configured with a
> link-local address¹ automatically.

That won't use IP?

>> Yes, I can shuffle a USB flash drive back and forth, but that's
>> really annoying.
>>
>> Can I run an MTP server on a Linux host and connect a USB-C port on
>> the Linux machine to the USB-C port on the Windows machine (assuming
>> the Linux port is dual-role, which I need to confirm).
>
> If USB connections between the 2 machines are allowed then “IP
> connection between the machines is not allowed” surely does not apply
> to direct ethernet connections between the 2 machines?

I was told that it did.

It's possible that a local point-to-point Ethernet connection with a
non-IP protocol would work.

One idea was to configure a Raspberry py with USB port in gadget mode
and run an MTP server for use by the Windows side. The Linux side can
use NFS or whatever. If the Linux machine had USB ports that
supported gadget mode (or USB-C dual-role), then I could just run the
MTP server on it, but I'm doubtful that's the case.

However, I've done some testing, and the description of the situation
that I was given doesn't seem to to be correct, so I think my initial
question is (at least for the moment) moot.

--
Grant
Re: Re: File transfer via USB? [ In reply to ]
On 22/04/2021 17:29, Grant Edwards wrote:
>> The easiest solution would be to connect both machines with an ethernet
>> cable and run samba on Linux. The interfaces will be configured with a
>> link-local address¹ automatically.

> That won't use IP?
>
Doesn't have to. In the past it would have used NetBEUI, but that's
probably bit-rotted ...

There's probably others - IP isn't the only game in town, it's just the
usual suspect ... :-)

Cheers,
Wol
Re: Re: File transfer via USB? [ In reply to ]
On Thu, Apr 22, 2021 at 04:29:26PM -0000, Grant Edwards wrote:
>On 2021-04-22, tastytea <gentoo@tastytea.de> wrote:
>> On 2021-04-22 14:27-0000 Grant Edwards <grant.b.edwards@gmail.com>
>> wrote:
>>
>>> I'm trying to figure out a convenient way to transfer files between a
>>> Linux machine (running Gentoo) and a Windows 10 machine (which has no
>>> internet access). IP connection between the machines is not allowed.
>>
>> The easiest solution would be to connect both machines with an ethernet
>> cable and run samba on Linux. The interfaces will be configured with a
>> link-local address? automatically.
>
>That won't use IP?
>

Honestly, I don't get the problem you're stating with using IP. If you
connect 2 machines with Ethernet, assign them both a static IP address
on the same subnet, with no gateway or anything, you can easily have
them communicate using the IP addresses only. A computer doesn't require
internet access to have local network IP connectivity.

--
Kusoneko
https://kusoneko.moe

GPG Fingerprint: E5FD 4F97 502A 0BB3 04F4 4BA1 4405 15F2 4B65 A136
Fediverse: @kusoneko@misskey.kusoneko.moe
XMPP&E-Mail: kusoneko@kusoneko.moe

https://email.is-not-s.ms

A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?
Re: File transfer via USB? [ In reply to ]
On 2021-04-22, Kusoneko <kusoneko@kusoneko.moe> wrote:

>>That won't use IP?
>
> Honestly, I don't get the problem you're stating with using IP.

There's no problem. It's just not allowed.

> If you connect 2 machines with Ethernet, assign them both a static
> IP address on the same subnet, with no gateway or anything, you can
> easily have them communicate using the IP addresses only.

I know that, but it's not allowed.

> A computer doesn't require internet access to have local network IP
> connectivity.

It is prohibited/verboten/illegal.

And I think the Windows machine is configured so that it just can't be
done. But even if that wasn't the case, it's not permitted.
Re: Re: File transfer via USB? [ In reply to ]
Security? Are serial ports available? - Before Ethernet became
affordable for the home user we use to use some variety of Laplink and
its was fast enough in its day- a quick search shows its still available.

If MTP is ok, use a phone as the middleman - though that basically the
same process as a usb sneakernet and is a security problem.

BillK


On 23/4/21 7:42 am, Grant Edwards wrote:
> On 2021-04-22, Kusoneko <kusoneko@kusoneko.moe> wrote:
>
>>> That won't use IP?
>> Honestly, I don't get the problem you're stating with using IP.
> There's no problem. It's just not allowed.
>
>> If you connect 2 machines with Ethernet, assign them both a static
>> IP address on the same subnet, with no gateway or anything, you can
>> easily have them communicate using the IP addresses only.
> I know that, but it's not allowed.
>
>> A computer doesn't require internet access to have local network IP
>> connectivity.
> It is prohibited/verboten/illegal.
>
> And I think the Windows machine is configured so that it just can't be
> done. But even if that wasn't the case, it's not permitted.
>
>
>
Re: File transfer via USB? [ In reply to ]
On Thu, Apr 22, 2021, at 9:27 AM, Grant Edwards wrote:
> I'm trying to figure out a convenient way to transfer files between a
> Linux machine (running Gentoo) and a Windows 10 machine (which has no
> internet access). IP connection between the machines is not allowed.
>
> Yes, I can shuffle a USB flash drive back and forth, but that's
> really annoying.
>
> Can I run an MTP server on a Linux host and connect a USB-C port on
> the Linux machine to the USB-C port on the Windows machine (assuming
> the Linux port is dual-role, which I need to confirm).
>

Two usb-serial converters will be easiest. You can set some USB3 ports (typically one per machine) to device mode for debugging. It shows up as a serial device in userland. Gadget mode USB would work but needs something like an RPi.
Re: File transfer via USB? [ In reply to ]
On 4/22/21 9:25 AM, karl@aspodata.se wrote:
> No IP doesn't prohibit ethernet.

I agree technically. Though I suspect it /may/ be problematic with the
spirit behind / motivating the ban on IP.

> You could possible use:
> raw ethernet frames

Do you have any recommendations of utilities for each side?

> netbeui
> samba

I thought that Samba has *LONG* been NetBIOS over TCP/IP (a.k.a. NBT).
Is NetBEUI code /still/ in Samba?

> ethertalk (appletalk)
> http://netatalk.sourceforge.net/
> ipx (netware)
> ftp://ftp.koansoftware.com/public/opensource/mars_nwe/mars_nwe-0.99.pl21.tgz

I believe that IPX support has been removed from 4.<something> kernels.
Maybe 5.<something>.

DECnet Phase III or Phase IV.

> I have previously (in the 90's) used mars, worked great.

I've never run MARS but I've done more than a little with Novell
NetWare. I recently had a 4.14 kernel mount an NCPFS from a server.
(4.14 obviously still has IPX.)



--
Grant. . . .
unix || die
Re: File transfer via USB? [ In reply to ]
Grant:
> On 4/22/21 9:25 AM, karl@aspodata.se wrote:
> > No IP doesn't prohibit ethernet.
>
> I agree technically. Though I suspect it /may/ be problematic with the
> spirit behind / motivating the ban on IP.

In that case, your usb-connection (or anything) will probably
be a borderline case to, since that is also a network...
But I guess the thing fobidden is anything makeing the ms-win box
recognize and use somthing to communicate outwards.

> > You could possible use:
> > raw ethernet frames
>
> Do you have any recommendations of utilities for each side?

Don't know much about the windows side, but I found this:
https://stackoverflow.com/questions/766912/raw-ethernet-frames-using-winsock
https://www.winpcap.org/
https://hacked10bits.blogspot.com/2011/12/sending-raw-ethernet-frames-in-6-easy.html
seems to be some programming involved.

> > netbeui
> > samba
>
> I thought that Samba has *LONG* been NetBIOS over TCP/IP (a.k.a. NBT).
> Is NetBEUI code /still/ in Samba?

Seems it never was, though there were patches:
https://flylib.com/books/en/3.151.1.29/1/

> > ethertalk (appletalk)
> > http://netatalk.sourceforge.net/
> > ipx (netware)
> > ftp://ftp.koansoftware.com/public/opensource/mars_nwe/mars_nwe-0.99.pl21.tgz
>
> I believe that IPX support has been removed from 4.<something> kernels.
> Maybe 5.<something>.

4.18-rc1 it seems.

> DECnet Phase III or Phase IV.

Ah, forgot that one.

> > I have previously (in the 90's) used mars, worked great.
>
> I've never run MARS but I've done more than a little with Novell
> NetWare. I recently had a 4.14 kernel mount an NCPFS from a server.
> (4.14 obviously still has IPX.)

///

About the original question. Here what a few thing I dig up.

https://www.amazon.com/Laplink-High-Speed-Transfer-Cable-PCmover/dp/B0093H83DW
https://sourceforge.net/projects/lptransfer/
https://github.com/viveris/uMTP-Responder

It is usually simple to setup and use a serial null-modem cable and
run kermit or somthing on the MS-Win side and add a getty (I've used
mgetty) handling the serial port on the linux side.

Regards,
/Karl Hammar
Re: File transfer via USB? [ In reply to ]
Karl:
...
> About the original question. Here what a few thing I dig up.
> https://www.amazon.com/Laplink-High-Speed-Transfer-Cable-PCmover/dp/B0093H83DW
...

With

Secure ms-win box - usb laplink cable - dummy ms-win box - tcp/ip -
linux box

you could be able to do it with usb.

Possible have a directory on the linux side be mounted (network share I
think it called) on the dummy ms-win box. Then by using the laplink
cable/software, transfer things from linux to secure box, it "should"
work but I don't know if the laplink thing handles network shares on
the dummy well.

Their homepage is https://web.laplink.com/

Regards,
/Karl Hammar
Re: File transfer via USB? [ In reply to ]
On 4/23/21 7:45 PM, karl@aspodata.se wrote:
> Grant:

I think you are conflating me for the OP. Easy to do with the same
first name. ;-)

> In that case, your usb-connection (or anything) will probably be a
> borderline case to, since that is also a network... But I guess the
> thing fobidden is anything makeing the ms-win box recognize and use
> somthing to communicate outwards.

I agree and that such is a possibility and is something that Grant
/Edwards/ -- the OP -- will need to make a judgement call on.

> Don't know much about the windows side, but I found this:
> https://stackoverflow.com/questions/766912/raw-ethernet-frames-using-winsock
> https://www.winpcap.org/
> https://hacked10bits.blogspot.com/2011/12/sending-raw-ethernet-frames-in-6-easy.html
> seems to be some programming involved.

That's about what I had expected. Not many, if any, ready built tools
for transferring raw Ethernet frames. Though plenty of scaffolding to
create it.

> Seems it never was, though there were patches:
> https://flylib.com/books/en/3.151.1.29/1/

That's about what I remember.

> 4.18-rc1 it seems.

Thank you for finding and sharing that milestone.

Aside: I don't like using "milestone" to describe the point that was
removed. Particularly something I think is good.

> Ah, forgot that one.

;-)

> About the original question. Here what a few thing I dig up.
>
> https://www.amazon.com/Laplink-High-Speed-Transfer-Cable-PCmover/dp/B0093H83DW

This is the USB version of the Laplink cable concept.

Decidedly different than the old serial & parallel versions of which
I've used many times. LapLink, INTERLNK.EXE & INTERSVR.EXE, and '95's
Direct Cable Connection used them. I suspect there may have been more
that I'm not aware of.

> https://sourceforge.net/projects/lptransfer/

Interesting.

I'm not sure why a separate program was needed. Maybe it didn't
monopolize the server side the same way that INTERSVR.EXE did.

Because INTERLNK.EXE would map a drive to the server and return control
to the command prompt / batch script allowing use of the new drive letter.

> https://github.com/viveris/uMTP-Responder

Interesting.

This is most likely to be the lease problematic considering that it
turns the Linux end into a /special/ USB flash drive.

> It is usually simple to setup and use a serial null-modem cable and
> run kermit or somthing on the MS-Win side and add a getty (I've used
> mgetty) handling the serial port on the linux side.

Is it wrong that the first thing that came to mind when reading the OP's
post is UUCP with as high speed serial as possible?

I wonder if the USB LapLink (type) cable or USB On The Go gadget cables
could present as a multi-megabit serial interface.



--
Grant. . . .
unix || die
Re: File transfer via USB? [ In reply to ]
Grant:
> On 4/23/21 7:45 PM, karl@aspodata.se wrote:
> > Grant:
>
> I think you are conflating me for the OP. Easy to do with the same
> first name. ;-)

Well, your sig is at a cursory look wery alike, but now I see you
have some extra dots and an || expression.

...
> Is it wrong that the first thing that came to mind when reading the OP's
> post is UUCP with as high speed serial as possible?

I doubt that many are fluen in cu and uucp, are they even available on
the ms-win side. Who knows, this might work https://www.uupc.net/

> I wonder if the USB LapLink (type) cable or USB On The Go gadget cables
> could present as a multi-megabit serial interface.

You can always build yourself two pairs of RS232 to RS422 converters
and see where the limit on your serial ports are. You can even try with
other deserializes/serializers. What speed do you want ?

Regards,
/Karl Hammar
Re: File transfer via USB? [ In reply to ]
On 2021-04-25, Grant Taylor <gtaylor@gentoo.tnetconsulting.net> wrote:

>> It is usually simple to setup and use a serial null-modem cable and
>> run kermit or somthing on the MS-Win side and add a getty (I've used
>> mgetty) handling the serial port on the linux side.
>
> Is it wrong that the first thing that came to mind when reading the OP's
> post is UUCP with as high speed serial as possible?

Nope. Many years ago I used UUCP a number of times for "production"
projects involving data gathering from remote systems via
dial-up. 25+ years ago, I wrote an article about one of those projects
for Linux Journal.

UUCP would work a treat for the problem I initially posed. Back in
the day, I always used Taylor-UUCP, and I'm pretty sure I could get it
working again on Linux, but I have little confidence I could get it
working on Win10. I'd probably have better luck with Kermit.

> I wonder if the USB LapLink (type) cable or USB On The Go gadget cables
> could present as a multi-megabit serial interface.

It turns out the initial requirements that I was given were wrong, and
the Windows machine does have some limited Internet access via a VPN
and proxy, and I can get files to/from the Windows machine that way.

So my initial question is moot.

--
Grant
Re: File transfer via USB? [ In reply to ]
On 2021-04-25, karl@aspodata.se <karl@aspodata.se> wrote:
> Grant:
>> On 4/23/21 7:45 PM, karl@aspodata.se wrote:
>> > Grant:
>>
>> I think you are conflating me for the OP. Easy to do with the same
>> first name. ;-)
>
> Well, your sig is at a cursory look wery alike, but now I see you
> have some extra dots and an || expression.
>
> ...
>> Is it wrong that the first thing that came to mind when reading the OP's
>> post is UUCP with as high speed serial as possible?
>
> I doubt that many are fluen in cu and uucp, are they even available on
> the ms-win side. Who knows, this might work https://www.uupc.net/
>
>> I wonder if the USB LapLink (type) cable or USB On The Go gadget cables
>> could present as a multi-megabit serial interface.
>
> You can always build yourself two pairs of RS232 to RS422 converters
> and see where the limit on your serial ports are. You can even try with
> other deserializes/serializers. What speed do you want ?

I've got USB<->serial RS422 adapters that will easily do 1Mbps. That
would probably be good enough 90% of the time.

--
Grant
Re: File transfer via USB? [ In reply to ]
On 4/25/21 11:39 AM, karl@aspodata.se wrote:
> I doubt that many are fluen in cu and uucp,

I think that lack of knowledge / dumb / ignorant about something is (or
can be) a relatively easy problem to solve.

As in there is (or was) no knowledge about something and there will be
(or is) knowledge at some point in the future.

> are they even available on the ms-win side.

I used Taylor-UUCP (no known relation) on Windows XP a number of years
ago via Cygwin. I suspect that Windows Subsystem for Linux could be
pressed into service for similar today.

> Who knows, this might work https://www.uupc.net/

Probably.

> You can always build yourself two pairs of RS232 to RS422 converters
> and see where the limit on your serial ports are.

What would the RS232 to RS422 get you? Why not just use RS232 between
the computers? What does RS422 provide to make the extra conversions
worth while?

> You can even try with other deserializes/serializers. What speed do
> you want ?

Probably. I would be afraid that they would have a lower RoI,
particularly on the effort front.



--
Grant. . . .
unix || die
Re: Re: File transfer via USB? [ In reply to ]
On 4/25/21 12:14 PM, Grant Edwards wrote:
> Nope. Many years ago I used UUCP a number of times for "production"
> projects involving data gathering from remote systems via dial-up.

:-)

> 25+ years ago, I wrote an article about one of those projects for
> Linux Journal.

Can you narrow that down any more? I'd like to go find a copy of it and
read it.

> UUCP would work a treat for the problem I initially posed.

:-)

> Back in the day, I always used Taylor-UUCP, and I'm pretty sure I could
> get it working again on Linux, but I have little confidence I could
> get it working on Win10.

I'm quite confident that Taylor-UUCP can be made to work on contemporary
Linux and macOS (Big Sur and it's predecessors) as I've got exactly that
working. What's more, I've got it working across SSH as a transport in
lieu of serial connections.

> I'd probably have better luck with Kermit.

Please elaborate.

I know very little about Kermit. I've looked at it a number of times
over the last 20 years, but it's never presented a feature that I
couldn't do with other things. I don't know if I'm just too late to the
Kermit game to properly appreciate it or if I'm completely missing
something.

My fear is that Kermit would be more manual for transferring files one
at a time. Maybe I'm wrong.

Hence, please elaborate about Kermit. ;-)

> It turns out the initial requirements that I was given were wrong, and
> the Windows machine does have some limited Internet access via a VPN
> and proxy, and I can get files to/from the Windows machine that way.

~chuckle~

That happens.

> So my initial question is moot.

;-)



--
Grant. . . .
unix || die
Re: Re: File transfer via USB? [ In reply to ]
>On 4/25/21 12:14 PM, Grant Edwards wrote:
>> Nope. Many years ago I used UUCP a number of times for "production"
>> projects involving data gathering from remote systems via dial-up.
>
>:-)
>
>> 25+ years ago, I wrote an article about one of those projects for
>> Linux Journal.
>
>Can you narrow that down any more? I'd like to go find a copy of it and
>read it.

A quick Duckduckgo search for "linux journal" grant edwards
yields

https://www.linuxjournal.com/article/2880
Still available. Reading it takes me back...
DaveF
Re: Re: File transfer via USB? [ In reply to ]
On 4/25/21 4:08 PM, David M. Fellows wrote:
> A quick Duckduckgo search for "linux journal" grant edwards yields
>
> https://www.linuxjournal.com/article/2880

Thank you for the link Dave.

I'll read that later tonight.

> Still available. Reading it takes me back...

:-)



--
Grant. . . .
unix || die
Re: File transfer via USB? [ In reply to ]
On 2021-04-25, Grant Taylor <gtaylor@gentoo.tnetconsulting.net> wrote:
> On 4/25/21 12:14 PM, Grant Edwards wrote:

>> Nope. Many years ago I used UUCP a number of times for "production"
>> projects involving data gathering from remote systems via dial-up.
>
>:-)
>
>> 25+ years ago, I wrote an article about one of those projects for
>> Linux Journal.
>
> Can you narrow that down any more? I'd like to go find a copy of it
> and read it.

https://www.linuxjournal.com/article/2880

>> I'd probably have better luck with Kermit.
>
> Please elaborate.

I've used Kermit on Windows before. I already have Kermit installed on
Linux and use it every day. I've never run UUCP on Windows, and have
no idea that would be involved in getting it running in Win10 (I know
that WSL is out of the question -- I haven't looked into Cygwin).

> My fear is that Kermit would be more manual for transferring files one
> at a time. Maybe I'm wrong.

Yes, it would definitly be less convenient than UUCP.

>> and proxy, and I can get files to/from the Windows machine that way.
>
> ~chuckle~
>
> That happens.
>
>> So my initial question is moot.
>
> ;-)