sharing

About SheepShaver, a PPC Mac emulator for Windows, MacOS X, and Linux that can run System 7.5.3 to MacOS 9.0.4.

Moderators: Cat_7, Ronald P. Regensburg, ClockWise

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

Re: sharing

Post by Cat_7 »

See edited answer above. And also: on my host the installation just freezes after some time. So it might be another problem, not the extensions manager.

Best,
Cat7
emendelson
Forum All-Star
Posts: 1456
Joined: Tue Oct 14, 2008 12:12 am

Re: sharing

Post by emendelson »

EDIT: I wrote earlier that I couldn't get this to work. I created a new, clean SheepShaver Wrapper system, and I was able to enable file sharing over TCP/IP...
Last edited by emendelson on Sat May 14, 2022 9:18 pm, edited 1 time in total.
emendelson
Forum All-Star
Posts: 1456
Joined: Tue Oct 14, 2008 12:12 am

Re: sharing

Post by emendelson »

mathguy wrote: Sat May 14, 2022 3:50 pm On re-reading the notes for the emendelson mac os9 (http://www.columbia.edu/~em36/macos9osx.html), on page 2 I find the sentence "The Mac OS 9 application contains a standard US-English Mac OS 9 installation, without features that can't be used in this system, such as filesharing." (emphasis mine).
Whoever wrote those notes should have known better. All these features are disabled by default, but presumably can be turned on. More about this later...
User avatar
Cat_7
Expert User
Posts: 5691
Joined: Fri Feb 13, 2004 8:59 am
Location: Sittard, The Netherlands

Re: sharing

Post by Cat_7 »

Well, who was it? ;-)

So I finally got the mac os 9 app to connect to a sheepshaver running in Windows. (but not the other way around)

I think I needed:
-chooser
-file sharing extension
-file sharing library
-shareway ip personal bgnd (to get file sharing over tcp/ip active)
emendelson
Forum All-Star
Posts: 1456
Joined: Tue Oct 14, 2008 12:12 am

Re: sharing

Post by emendelson »

Cat_7 wrote: Sat May 14, 2022 9:01 pm Well, who was it? ;-)

So I finally got the mac os 9 app to connect to a sheepshaver running in Windows. (but not the other way around)

I think I needed:
-chooser
-file sharing extension
-file sharing library
-shareway ip personal bgnd (to get file sharing over tcp/ip active)
First, ignore my earlier message about not getting this to work in the SheepShaver Wrapper. I made a fresh installation, added the line that you specified in the prefs, and was able to check the Enable file sharing over TCP/IP option.

Before I try to reinvent the wheel, am I right to think that I should be able to connect between two Macs, with the same settings in SheepShaver (except of course different computer names...)?
User avatar
Cat_7
Expert User
Posts: 5691
Joined: Fri Feb 13, 2004 8:59 am
Location: Sittard, The Netherlands

Re: sharing

Post by Cat_7 »

Yes, two sheepshavers on different machines (so having different ip addresses for the hosts)
Two instances on the same machine will not work.

Best,
Cat_7
emendelson
Forum All-Star
Posts: 1456
Joined: Tue Oct 14, 2008 12:12 am

Re: sharing

Post by emendelson »

mathguy wrote: Sat May 14, 2022 3:50 pm On re-reading the notes for the emendelson mac os9 (http://www.columbia.edu/~em36/macos9osx.html), on page 2 I find the sentence "The Mac OS 9 application contains a standard US-English Mac OS 9 installation, without features that can't be used in this system, such as filesharing." (emphasis mine).

I assume this is definitive, and I will not be able to make your excellent suggestion work on my implementation.
To continue, whoever wrote those notes didn't get it right (he's made dozens of worse mistakes in the past, so I'm not surprised about this one). The way to make this work in the Mac OS 9 app is to go to Contents->Resources->Files->macOS.sheepvm and show package contents. Add Cat_7's "redir" line to the "prefs" file and also (I think) to "prefs original", under the slirp line.

Then start up the Mac OS 9 app, enable the control panels and extensions listed in Cat_7's post, and move Chooser from the Apple Menu Items (disabled) folder into Apple Menu Items. Then restart.
emendelson
Forum All-Star
Posts: 1456
Joined: Tue Oct 14, 2008 12:12 am

Re: sharing

Post by emendelson »

And, Cat_7, yes: it works! I was able to connect SheepShaver on one Mac to SheepShaver on the other by the entering the IP address of the remote Mac in the File Sharing control panel. Amazing!

EDIT: After a few tries, I was able to connect in both directions. Very impressed! Is there any hope of a wiki guide for doing this?

Probably the author of the web pages about these apps should update them to add information, but who knows whether if he'll be able to get the details correct?

SECOND EDIT: In order to be able to connect TO the Mac OS 9 app, you need to do the following. First, open the package and burrow down to Files->sheepvmfiles, and edit the file basicprefs. Beneath the "slip" line add

redir tcp:548:10.0.2.15:548

and save the file. It can't hurt to add the same line in two files inside MacOS.sheepvm, the files named "prefs" and "prefs original".

Startup Mac OS 9, holding down the Option key. In the options menu that appears, choose Restore default settings... and agree to the prompts. Then restart Mac OS 9.
User avatar
Cat_7
Expert User
Posts: 5691
Joined: Fri Feb 13, 2004 8:59 am
Location: Sittard, The Netherlands

Re: sharing

Post by Cat_7 »

What we need here is a third-person shooter ;-)

I updated the SheepShaver for Windows guide to include the following:
Redirecting a TCP/IP port from the guest to the host or the network

You can redirect a guest port to a host port so you can run services on Mac OS that are accessible on your host or on the network.
Add a preference to the SheepShaver_prefs file in your SheepShaver folder.
Note: These settings can be lost when running the SheepShaverGUI.exe!

To forward a running webserver add:

Code: Select all

redir tcp:8080:10.0.2.15:80
On your host navigate to localhost:8080 to see the web site.

To forward an FTP server (such as netpresenz) add:

Code: Select all

redir tcp:2121:10.0.2.15:21
Use an ftp client capable of connecting to old ftp servers (such as FileZilla) to connect to the IP address of your host and port number 2121.

To share files over the Apple Filing Protocol (AFP, file sharing over tcp/ip) add:

Code: Select all

redir tcp:548:10.0.2.15:548
And enable file sharing, including the option to share over TCP/IP. Then run SheepShaver or Basilisk (or Qemu) on another computer and use the chooser option "AppleShare"and then "Server IP address". Enter the IP address of the machine running AFP and enter your credentials. Any other system capable of communicating over the version of AFP running in your installation can connect.

Note: You can add multiple redir lines to the prefs file to gain access to more services running on the guest.

Redirecting to ports below 1024 might require running as administrator, which is not advised.
Last edited by Ronald P. Regensburg on Sun May 15, 2022 1:09 pm, edited 1 time in total.
Reason: Removed wiki formatting
User avatar
Ronald P. Regensburg
Expert User
Posts: 7282
Joined: Thu Feb 09, 2006 10:24 pm
Location: Amsterdam, Netherlands

Re: sharing

Post by Ronald P. Regensburg »

The SheepShaver for OSX/macOS guide is maintained by me. At the time I became aware of this feature, I added only very elementary instructions about "Port forwarding in slirp networking" under "Advanced Settings": https://www.emaculation.com/doku.php/sh ... uilds_only

I assumed that users who want to use this feature would know how to proceed. Should I add more detailed instructions?
emendelson
Forum All-Star
Posts: 1456
Joined: Tue Oct 14, 2008 12:12 am

Re: sharing

Post by emendelson »

Ronald P. Regensburg wrote: Sun May 15, 2022 9:35 am The SheepShaver for OSX/macOS guide is maintained by me. At the time I became aware of this feature, I added only very elementary instructions about "Port forwarding in slirp networking" under "Advanced Settings": https://www.emaculation.com/doku.php/sh ... uilds_only

I assumed that users who want to use this feature would know how to proceed. Should I add more detailed instructions?
I never understood that "port forwarding" meant something like "how to network between copies of SheepShaver on two different systems," so possibly the guide could give some more explanation?
User avatar
Cat_7
Expert User
Posts: 5691
Joined: Fri Feb 13, 2004 8:59 am
Location: Sittard, The Netherlands

Re: sharing

Post by Cat_7 »

Well, it is a bit more than that.

SheepShaver supports various networking modes:

-One mode is through a tap device, which puts SheepShaver on the same network as the host and other machines. This requires running a tap device bridged to the default network connection on the host. Currently this is only feasible on windows and linux, as tap networking is no longer supported on macOS hosts.

-Then there is the default network mode called slirp. This functionality presents a DHCP server to SheepShaver (hence it gets the 10.0.2.15 address) and a DNS server. The built-in NAT (network address translation) allows network traffic between the host address and the Mac OS address. The most important limitation of the slirp method is that it does not allow initiating network connections into SheepShaver and only allows traffic on certain ports. This then is bypassed by the redir option in the TCP/IP port level so all traffic described by the functionality behind that port is allowed to flow in both ways.

About the TCP/IP protocol. It is layered. One layer describes the formatting of the traffic between two or more TCP/IP addresses. On top of that layer the protocol allows the use of several so called ports. There is a list of well-known port numbers providing various functionalities over the TCP/IP transport protocol. You can look it up on the internet. Some ports are supported by many applications. (like port 80 for http traffic, or port 21 for ftp traffic, or 443 for https traffic. Then there is mail, etc. all having their own port numbers). Apple and other companies have some ports registered and reserved for specific traffic (in our case port 548 for AFP over TCP/IP, whereas Appletalk is using ports 201 to 208).

So what we do with a redir line is bypass the one-side-only-may-start-traffic limitation of slirp and expose functionality behind a port number to the outside world. But not connected to the SheepShaver internal IP address (which is not reacheable) but redirected to the host IP address. But note this option also has caveats: if there is e.g. a web server running on the host, there would be a second webserver running on the same host with the same port number. For obvious reasons this is impossible, so we can redirect the web server from port 80 in SheepShaver to e.g. port 8080 on the host. That way there can be no confusion as to to which port opened on which IP address traffic should go. This is not possible for the APF protocol tied to port 548 as we cannot tell a AFP guest to use a different port. So redirecting port 548 only works on hosts that themselves do not already have an open port 548. Hope that clarifies it a bit.

Best,
Cat_7
emendelson
Forum All-Star
Posts: 1456
Joined: Tue Oct 14, 2008 12:12 am

Re: sharing

Post by emendelson »

That clarifies enormously. Thank you!

(And I was able to connect from a Mac SheepShaver to a Windows one, but not from Windows to Mac - exactly what you reported earlier, I think.)
mathguy
Student Driver
Posts: 17
Joined: Sun May 08, 2022 4:38 pm

Re: sharing

Post by mathguy »

emendelson wrote: Sat May 14, 2022 2:58 pm
mathguy wrote: Sat May 14, 2022 12:35 pm I appreciate your detailed solution, but it seems that the emendelson implementation of sheepshaver is missing FileSharingLib, preventing me from activating file sharing in my emulator Mac OS9 running in Monterey 12.3.1.
If you have my Mac OS 9 app:

You can enable sharing by using the Apple menu, then Control Panels, then Extensions Manager, then check the box next to File Sharing. EDIT: Also check the box next to File Sharing Library if it is not already checked. (But read the posts by Cat_7 below for warnings.)
Note that the Extensions Manager offers two options relevant to this discussion. 1. Mac OS 9 Single User and 2. Mac OS 9 Multiple Users. Single User option does not offer the File Sharing LIbrary option.

Perhaps the use of the second option should be obvious, but this whole process, to me, is like "a maze of twisty little passages, all alike. There is a bottle of water here.," like "a maze of twisty little passages, all alike. There is tasty food here.", like "a maze of twisty little passages, all alike. There are some keys on the ground here."

Best
Mathguy
emendelson
Forum All-Star
Posts: 1456
Joined: Tue Oct 14, 2008 12:12 am

Re: sharing

Post by emendelson »

Just ignore the Multiple Users option. It isn't practical under recent versions of macOS, and I've revised the download page to say that.

And wait until tomorrow to download a fixed version of the app. I've now got file sharing working both to and from the Mac OS 9 app, but it is not enabled by default, for security reasons.

EDIT: New version now posted (16 May), with revised instructions on the download page (use Cmd-R to refresh the page if you don't see the file- sharing instructions).
mathguy
Student Driver
Posts: 17
Joined: Sun May 08, 2022 4:38 pm

Re: sharing

Post by mathguy »

emendelson wrote: Mon May 16, 2022 1:26 am Just ignore the Multiple Users option. It isn't practical under recent versions of macOS, and I've revised the download page to say that.

And wait until tomorrow to download a fixed version of the app. I've now got file sharing working both to and from the Mac OS 9 app, but it is not enabled by default, for security reasons.

EDIT: New version now posted (16 May), with revised instructions on the download page (use Cmd-R to refresh the page if you don't see the file- sharing instructions).
Thank you muchly. This works.

Best regards,

Mathguy
emendelson
Forum All-Star
Posts: 1456
Joined: Tue Oct 14, 2008 12:12 am

Re: sharing

Post by emendelson »

mathguy wrote: Mon May 16, 2022 10:55 pm Thank you muchly. This works.
Were you actually able to connect between SheepShaver and your real-world hardware? I'm very impressed. Many thanks to Cat_7 for showing the way!
mathguy
Student Driver
Posts: 17
Joined: Sun May 08, 2022 4:38 pm

Re: sharing

Post by mathguy »

Yes, connect over a LAN, and transfer files from the real-world hardware to the Sheepshaver OS 9 desk top.

Again, many thanks to all who helped so much.

Grateful,

Mathguy
galgot
Granny Smith
Posts: 117
Joined: Thu Feb 13, 2014 3:59 pm

Re: sharing

Post by galgot »

For what's worth... I've found this in the BasiliskII README (but not in any SheepShaver docs included in /macemu...) :

Code: Select all

redir <port redirection description>

  This item defines a port to be forwarded from the host to the client. 
  The format is "[protocol]:hostport:[clientaddress]:clientport", where
  protocol is "udp" or "tcp" (default), hostport is the port on your
  computer to forward to the Mac, clientaddress is the IP address of the Mac
  in the virtual network (defaults to 10.0.2.15), and clientport is the port on
  the Mac to be exposed. For example, if you have a web server in MacOS running
  on port 80, you can expose it as port 8000 with the line below:

  redir tcp:8000:10.0.2.15:80
Of interest for me is that it states "udp" or "tcp" protocols. Because I usually use Timbuktu on my BasiliskII VMs, and Timbuktu up to version 5.1 use udp, then from version 5.2 uses tcp and runs only on PPC... all versions uses port 407.
Anyway, I've tried :

Code: Select all

redir udp:407:10.0.2.15:407
in BII but it doesn't work.
But some tcp redir, like :

Code: Select all

redir tcp:8000:10.0.2.15:80
works perfect. All tested on Raspbian btw.

I've yet to try on a SheepShaver machine...
Mods, If this post "talks" too much about BII in the SheepShaver section , it can be moved :)
Last edited by galgot on Tue May 17, 2022 12:08 pm, edited 2 times in total.
User avatar
Ronald P. Regensburg
Expert User
Posts: 7282
Joined: Thu Feb 09, 2006 10:24 pm
Location: Amsterdam, Netherlands

Re: sharing

Post by Ronald P. Regensburg »

No need to move the post. BasiliskII and SheepShaver share much code and thus share many of these features. Apparently this forwarding feature is much older than we knew. It was forgotten and rediscovered and mentioned in the (BasiliskII) forum in 2012: viewtopic.php?f=6&t=7782
User avatar
Cat_7
Expert User
Posts: 5691
Joined: Fri Feb 13, 2004 8:59 am
Location: Sittard, The Netherlands

Re: sharing

Post by Cat_7 »

redir udp:407:10.0.2.15:407
You might try to redirect both:
redir udp:407:10.0.2.15:407
redir tcp:407:10.0.2.15:407

Note that on Linux you might have to run Basilisk as root for it to open ports below 1024. Then also note it will use a prefs file in the root folder....

Best,
Cat_7
galgot
Granny Smith
Posts: 117
Joined: Thu Feb 13, 2014 3:59 pm

Re: sharing

Post by galgot »

Cat_7 wrote: Tue May 17, 2022 1:00 pm
redir udp:407:10.0.2.15:407
You might try to redirect both:
redir udp:407:10.0.2.15:407
redir tcp:407:10.0.2.15:407

Note that on Linux you might have to run Basilisk as root for it to open ports below 1024. Then also note it will use a prefs file in the root folder....

Best,
Cat_7
Ahaa... thanks, didn't know about that root and ports issue, will try.
Did tried redirect both tcp and udp , no joy.
mathguy
Student Driver
Posts: 17
Joined: Sun May 08, 2022 4:38 pm

Re: sharing

Post by mathguy »

Dear emendelson,

Is it possible that in rewriting the prefs files, the ability to link to the internet via cassillia got messed up?

Mathguy
emendelson
Forum All-Star
Posts: 1456
Joined: Tue Oct 14, 2008 12:12 am

Re: sharing

Post by emendelson »

I have no idea. Why not try removing the added line, according to my instructions on my page, and let us know what happens?
User avatar
Cat_7
Expert User
Posts: 5691
Joined: Fri Feb 13, 2004 8:59 am
Location: Sittard, The Netherlands

Re: sharing

Post by Cat_7 »

I'd be surprised if that was due to the redir line.
Over here Classilla works OK with it included in the prefs.

Best,
Cat_7
Post Reply