Connecting MorphOS to a network

File: Smart SMBFS

[Edit 151117] jPV was nice and gave me a new, better script. See bottom.

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.

151116_001-smart_smbfs_unpacked

Click on the drawer.

151116_002-smart_smbfs_drawer

Right click on Smart_SMBFS and chose Edit.

151116_003-smart_smbfs_script_before

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

151116_004-smart_smbfs_script_after

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.

151116_005-smart_smbfs_network_on

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.

151116_006-smart_smbfs_network_drawer

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.

151116_010-smart_smbfs_network_off

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'”`

151116_011-smart_smbfs_stop_all

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.

151116_012-smart_smbfs_stop_all_icon

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). Sometimes after quitting it doesn’t start again on the first try. Try again, it usually works the second time.

151116_013-smart_smbfs_work_done

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.

[Edit] Here is a new script that will do the same as above (thanks jPV!). But instead of two script you can use this one to both start and stop SMBFS. We are using the same shares as above in this example.

IF NOT EXISTS env:smbrem
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
SetEnv smbrem 1
ELSE
RUN >NIL: break `status com “smbfs ‘//wdtvlive/douga'”`
RUN >NIL: break `status com “smbfs ‘//wdtvlive/momo'”`
RUN >NIL: break `status com “smbfs ‘//aresone/download'”`
RUN >NIL: break `status com “smbfs ‘//aresone/video'”`
RUN >NIL: break `status com “smbfs ‘//aresone/shared'”`
Unsetenv smbrem
ENDIF

Just use the same procedure as I did when making the Quit_Smart_SMBFS script and you will have an icon to start and quit this script.

This entry was posted in Uncategorized and tagged . Bookmark the permalink.

6 Responses to Connecting MorphOS to a network

  1. Sarre Jacques says:

    If I knew Smart SMBFS earlier.. 🙂 SMBFS stands for Server Message Block File System, which is a perfectly useless piece of information 😀

    Liked by 1 person

  2. daedalus2097 says:

    Nice writeup! For simplicity, have you tried using my SMBMounter commodity? It’s 68k but I’ve tested it under MorphOS and it works fine. It lets you edit, mount and unmount your shares all with a nice GUI, and if you have some of SAMBA’s components in your path (you don’t need to fully install or configure it, don’t worry), it can also search for devices and shares on your network.

    Liked by 1 person

    • Yasu says:

      I havn’t. Like all things a lot of people like to do there are several ways to do the same thing. And I find this way to suit my needs nicely 🙂

      Liked by 1 person

    • diffos says:

      Previous versions of SMBMounter had an “old school GUI” that was not usable in MOS cos of bugs.
      But now it also includes a MUI one that works fine !
      As you already mentioned, automatic lookup for hosts and shares reqires parts of the Samba (server) package.
      I wonder where one can find the latest one. MorphOS Files has no Samba at all, and Aminet contains an old one from 2007 only….(that always asks for AmiTCP: assign unnecessarily , but ,well, it works nonetheless).

      Like

  3. daedalus2097 says:

    Also, to get your MorphOS machine to be accessible from Windows, you need to install and configure SAMBA. It’s a totally different beast and quite complicated so I generally don’t use it, but it does work…

    Like

    • Yasu says:

      I thought so too. So I don’t bother with it. Being able to access Windows in MorphOS is enough as I try to use Windows as little as possible.

      Liked by 1 person

Leave a comment