FTP-Server on MacOS 9.2 host

About Qemu-system-ppc, a PPC Mac emulator for Windows, macOS and Linux that can run Mac OS 9.0 up to Mac OS X 10.5

Moderators: Cat_7, Ronald P. Regensburg

Post Reply
Kuulest
Space Cadet
Posts: 8
Joined: Fri Nov 13, 2020 10:53 am

FTP-Server on MacOS 9.2 host

Post by Kuulest »

I'm using X.14 Mojave and qemu-system-ppc-screamer 5.2.0, the guest system is MacOS 9.2.

I tried to setup an FTP-server as described in https://www.emaculation.com/doku.php/pp ... mu-for-osx. Thus qemu is started with the following script

Code: Select all

#!/bin/bash
cd "$(dirname "$0")"

./qemu-system-ppc-screamer -L pc-bios -boot c -M mac99,via=pmu -m 512 \
-prom-env 'auto-boot?=true' -prom-env 'boot-args=-v' -prom-env 'vga-ndrv?=true' \
-drive file=MacOS9.qcow2,format=qcow2,media=disk \
-device sungem,netdev=network01 -netdev user,id=network01,hostfwd=tcp::2121-:21 \
-device VGA,edid=on -g 1024x768x32 \
-k en-us -rtc base=localtime
On MacOS9 Netpresenz is running, AppleTalk is active, there is an IP address and an FTP-user is defined. On MacOS9 everything looks ok.
The problem is on the host side. Actually I don't know, how to find the server. I tried CyberDuck as well as Filezilla – active FTP enabled – but the server at ftp:://10.0.2.15:2121 cannot be found.

Within the network preferences of X.14 there is the possibility to define some "virtual connections". Do I have to use these? If yes, how?

thanks in advance, Kuulest
User avatar
adespoton
Forum All-Star
Posts: 4227
Joined: Fri Nov 27, 2009 5:11 am
Location: Emaculation.com
Contact:

Re: FTP-Server on MacOS 9.2 host

Post by adespoton »

Kuulest wrote: Tue Jan 25, 2022 7:50 pm I'm using X.14 Mojave and qemu-system-ppc-screamer 5.2.0, the guest system is MacOS 9.2.

I tried to setup an FTP-server as described in https://www.emaculation.com/doku.php/pp ... mu-for-osx. Thus qemu is started with the following script

Code: Select all

#!/bin/bash
cd "$(dirname "$0")"

./qemu-system-ppc-screamer -L pc-bios -boot c -M mac99,via=pmu -m 512 \
-prom-env 'auto-boot?=true' -prom-env 'boot-args=-v' -prom-env 'vga-ndrv?=true' \
-drive file=MacOS9.qcow2,format=qcow2,media=disk \
-device sungem,netdev=network01 -netdev user,id=network01,hostfwd=tcp::2121-:21 \
-device VGA,edid=on -g 1024x768x32 \
-k en-us -rtc base=localtime
On MacOS9 Netpresenz is running, AppleTalk is active, there is an IP address and an FTP-user is defined. On MacOS9 everything looks ok.
The problem is on the host side. Actually I don't know, how to find the server. I tried CyberDuck as well as Filezilla – active FTP enabled – but the server at ftp:://10.0.2.15:2121 cannot be found.

Within the network preferences of X.14 there is the possibility to define some "virtual connections". Do I have to use these? If yes, how?

thanks in advance, Kuulest
On the host system, from Terminal.app, run sudo lsof -nP -iTCP -sTCP:LISTEN

Check the results to ensure that qemu-system-ppc is listening on port 2121. If it is, then something's odd on the guest side. If it isn't, qemu-system-ppc may not have permission to open that port. Does running it with sudo make a difference? Do you have a firewall installed that could be blocking it?

Also, you can try ftp://127.0.0.1:2121 as the port might only be available on the local interface (lsof command above should show what interfaces it's available on).

Oh, and I almost forgot what I was originally going to say: FTP has two versions: active and passive. They differ in whether the guest or host has to initiate the connection for the data stream. You'll want to be running the server in active mode so that the server connects from port 20 back to the initiating port+1. If you're in passive mode, the server will be opening another listening port, and doing so dynamically, so you won't know what to forward. https://slacksite.com/other/ftp.html for more details on how FTP works (and can break).
User avatar
Cat_7
Expert User
Posts: 6145
Joined: Fri Feb 13, 2004 8:59 am
Location: Sittard, The Netherlands

Re: FTP-Server on MacOS 9.2 host

Post by Cat_7 »

Hi,

You might not be able to connect to IP address 10.0.2.15, try localhost:2121 or yourhostipaddress:2121 instead.
(and I'm assuming it was a typo when you wrote "ftp:://10.0.2.15:2121")

Best,
Cat_7
Kuulest
Space Cadet
Posts: 8
Joined: Fri Nov 13, 2020 10:53 am

Re: FTP-Server on MacOS 9.2 host

Post by Kuulest »

Also, you can try ftp://127.0.0.1:2121 as the port might only be available on the local interface (lsof command above should show what interfaces it's available on).
That's the point! I didn't understand, that the connection should be within the local interface.
Now I get logged in, though I still cannot access or upload any files. This seems to be rights problem within MacOS9 I have to dig into.

Anyway, the main problem is solved, thank you.
User avatar
adespoton
Forum All-Star
Posts: 4227
Joined: Fri Nov 27, 2009 5:11 am
Location: Emaculation.com
Contact:

Re: FTP-Server on MacOS 9.2 host

Post by adespoton »

Kuulest wrote: Wed Jan 26, 2022 3:31 pm
Also, you can try ftp://127.0.0.1:2121 as the port might only be available on the local interface (lsof command above should show what interfaces it's available on).
That's the point! I didn't understand, that the connection should be within the local interface.
Now I get logged in, though I still cannot access or upload any files. This seems to be rights problem within MacOS9 I have to dig into.

Anyway, the main problem is solved, thank you.
See my last bit above; it sounds like you now have a working control channel on port 21, but port 20 data operation is still blocked. Likely the client is attempting to connect to Netpresenz in passive mode (the modern default), which will always fail.
User avatar
Cat_7
Expert User
Posts: 6145
Joined: Fri Feb 13, 2004 8:59 am
Location: Sittard, The Netherlands

Re: FTP-Server on MacOS 9.2 host

Post by Cat_7 »

Hi,

I tried with both -net user and hostfwd and a tap network connection.
With tap I could connect using FileZilla, get the directory listing and copy files. That seems to confirm rights etc on the Mac OS side are OK.
(On Mac OS you need to share some folder/disk through the File/Get info/Sharing option and set the appropriate rights beside configuring Netpresenz)

With the hostfwd option, I can log in to Mac OS with FileZilla, but the directly listing fails and transfer do too.
(On both Windows and Linux hosts)

Filezilla shows:
Status: Connecting to 127.0.0.1:2121...
Status: Connection established, waiting for welcome message...
Status: Plain FTP is insecure. Please switch to FTP over TLS.
Status: Server does not support non-ASCII characters.
Status: Logged in
Status: Retrieving directory listing...
Command: PWD
Response: 257 "/MacOS9.2" PWD command successful.
Command: TYPE I
Response: 200 Type set to I, binary transfer mode [macbinary disabled].
Command: PORT 10,0,2,15,187,185
Response: 200 PORT command successful.
Command: LIST
Response: 150 ASCII transfer started.
Response: 426 Connection aborted, local error (-23008).
Error: Failed to retrieve directory listing

Apple error -23008 connectionDoesntExist: The TCP stream has no open connection.

Best,
Cat_7
User avatar
Cat_7
Expert User
Posts: 6145
Joined: Fri Feb 13, 2004 8:59 am
Location: Sittard, The Netherlands

Re: FTP-Server on MacOS 9.2 host

Post by Cat_7 »

Ha,

And then I succeeded ;-)

Filezilla settings:
FTP: active, no fallback
FTP Active mode: "Use the following IP address" 10.0.2.2 (this seems to make the difference)

For a connection created in the Site manager:

General:
Protocol FTP
Host: localhost, port 2121
Encryption: Only use plain FTP
Logon Type Ask for password
(enter a user name)

Advanced
Server type Default

Transfer settings:
Active

Charset:
Autodetect
Kuulest
Space Cadet
Posts: 8
Joined: Fri Nov 13, 2020 10:53 am

Re: FTP-Server on MacOS 9.2 host

Post by Kuulest »

Sorry for the long delay, but now it works!!! :smile:

Thank you again!
Post Reply