Connecting MorphOS to a network
File: Smart SMBFS
One of the few things I never bothered to learn anything about is how networks work. Mostly because it used to be such a complicated matter when I was young and into computers, and later in life when I started to actually need it it had already become a simple task. Just insert a LAN cable and let Windows do the job for you. So my knowledge about networking is pretty much zero.
At home we have several devices hooked up in a shared network. Some directly into a socket in the wall and some via a router (so more computers can access the internet). The other day, when looking for some files in my media centre I accidentally pressed the wrong button and found myself looking at a screen where the device asked me for my user name and password to connect to my PC. Until now I did not see a need to connect my PC and media centre via our home network, but once I accidentally saw that is was possible and easy I could no longer imagine not doing it. Just like so many times before this new “need” came to me by accident.
I of course started to wonder if I could do the same with MorphOS. Or rather, if it was uncomplicated enough for someone like me to try it.
After asking around in the MorphOS IRC channel I got help from the MorphOS developer “bigfoot” who guided me to make this work. And it was not as hard as I thought it would be. There are several ways to do it, but this is the way I found to be easiest (though I did not look at them all, eager to just getting this to work).
First, go to Aminet and download Smart SMBFS. It’s a script that helps mount networks by using the in MorphOS built in SMBFS (don’t ask me what it stands for). Unpack it.
Click on the drawer.
Right click on Smart_SMBFS and chose Edit.
This is what the script looks like. Now it’s up to us to check out what our network is called. I’m using Windows 7 so I click on Network. There I see my media centre (called Mediacenter) and my computer (called Yasupc). Knowing this is not enough though. I need to know the name of some directories I need to access. In the media centres case it’s two hard drives called Douga and Momo. They are not password protected. In my PC:s case I decide to right click on some drawers –> Properties –> Sharing –> Share. Then I clicked on the listing –> chose Everyone –> clicked on Add –> pressed Share. Two got Permission level Read and one (“Shared”) Read/Write. The PC is also password protected. I add the information in the script above.
RUN >NIL: smbfs //mediacenter/douga workgroup foo volume Douga devicename smb0
RUN >NIL: smbfs //mediacenter/momo workgroup foo volume Momo devicename smb1
RUN >NIL: smbfs //yasupc/download workgroup foo volume A1_Download devicename smb2 username Yasu password xxx
RUN >NIL: smbfs //yasupc/video workgroup foo volume A1_Video devicename smb3 username Yasu password xxx
RUN >NIL: smbfs //yasupc/shared workgroup foo volume A1_Shared devicename smb4 username Yasu password xxx
RUN >NIL: is used so that the program runs in the background (not giving me any data I don’t need to see anyway). Then we start the program SMBFS. Then we add the paths. After that we write workgroup foo for some reason. Then we give the device a name which will be shown under MorphOS. And then we give it a proper name so the system can tell them apart. In the case of my PC we also add my user name and password (not really xxx) which is the same you use when you log in to Windows.
Note that the lines that starts with “;” will not be executed.
If everything is correct then you just need to save and double click on the icon. Now this is what we see on my desktop.
Now when we click on Douga we see the correct folders. We can also move files between the systems if we want (since my media centre isn’t read/write protected), or play movies through the network. My PC has got the folder Shared (“A1_Shared”) so I can move files between the systems. Even though MorphOS is 32 bit and my Windows is 64 bit this works pretty well. I get problem only sometimes with copying files, but I suspect is has something to do with the file names. What is good and not good to use is different between the systems. Renaming the files usually solves the problem.
This was easy enough. Now, how do we shut it down?
Start Shell and write “status”. You will see a list of processes. Look for one of your shared networks and type “Break <process number>”. For example “Break 5”. Now this process should be gone when you type “status” again, as well as not showing on the desktop any more. In this case, “Break 5” killed Douga.
This is easy enough, but it would be better if you could quit all of them at once. No problem! Go to the Smart_SMBFS drawer and create a text file there. Type these lines.
RUN >NIL: break `status com “smbfs ‘//mediacenter/douga'”`
RUN >NIL: break `status com “smbfs ‘//mediacenter/momo'”`
RUN >NIL: break `status com “smbfs ‘//yasupc/download'”`
RUN >NIL: break `status com “smbfs ‘//yasupc/video'”`
RUN >NIL: break `status com “smbfs ‘//yasupc/shared'”`
Save it as Quit_Smart_SMBFS and copy the icon from Smart_SMBFS so it turns into an executable script. Right click on the new icon and make sure it looks like this.
If it does, then all the networked drives will quit when the icon is clicked on. Now your drawer should look like this (I’ve added an icon for my text about how to quit manually, in case I forget).
The good thing about this approach, besides being simple, is that it doesn’t matter if the PC or media centre or both isn’t on. SMBFS will only start those that it sees and ignore the rest. So if only your PC is on, it will access only your PC. If only your media centre is on, it will only access that. If nothing is on, nothing happens. And you can put these icons in a panel or on your desktop for easy access.
Note that I have not been able to access my MorphOS machine in Windows. This is probably because MorphOS runs a file system Windows doesn’t support.