site  news  contact

EasyShare, super easy network file and printer sharing

February 08, 2018 — BarryK

I (Barry Kauler) am the developer of EasyOS and Quirky, small simple Linux distributions. These distros, and their "dad" Puppy Linux, offer various applications and utilities for file and printer sharing over a local network. However, I wanted to go to the "next step" in terms of simplicity. EasyShare is the result.

This web page is a tutorial, showing how easy EasyShare is to use. I am running EasyOS or Quirky, as EasyShare is built-in, however, in theory, EasyShare can be ported to any Linux distribution.

If you would like to try EasyShare for yourself, download EasyOS version 0.7.1 or greater, or Quirky Linux 8.4 or greater. Note that earlier versions of EasyOS have an earlier effort called QuickSamba, that uses smbnetfs, however, I discovered that smbnetfs has too many serious issues, so did an almost complete rewrite and created EasyShare, and added printer and SSHFS support.

OK, now to show you just how easy EasyShare is...

Step 1: Start EasyShare

It is in the menu, however, for extra convenience, I placed it on the desktop, labeled "share". Just click on the icon...

image

There is one vital requirement, that we have a local network, with other computers connected to it. Usually this is achieved with a wi-fi or ethernet router. I plan to write a tutorial on that too, though it is pretty straightforward to setup -- in the case of an ethernet router, just plug each computer into the router, and run the web-interface of the router to configure it for Internet access, etc.

I have a couple of routers, see blog posts:

TotoLink N100R: http://bkhome.org/news/201712/toto-link-wifiethernet-routerrepeater.html
TotoLink A2004NS: http://bkhome.org/news/201712/totolink-a2004ns-fast-wirelessethernet-router.html

Anyway, that is a digression. As I have a local network, with three computers connected, I can proceed with the demo. For the purposes of the demo. one of them, my little Mele PCG35 Apo mini-pc has been booted with Windows 10. The second computer is my venerable Asus laptop, running EasyOS. The third PC, that I am typing this tutorial on, is my midi-tower, also running EasyOS. The midi-tower has my Brother HL2040 laser printer connected (via USB).

Booting a pristine EasyOS, an ethernet connection is automatically detected. All that i have to do is click the "share" icon on the desktop...

Step 2: Firewall

And we encounter the first hurdle...

image

EasyShare insists that the firewall be running, with appropriate ports unblocked for CUPS (for printing) and Samba (for file sharing and printing from Windows). As this is a pristine bootup, I have to click "Firewall Setup" and tick the appropriate boxes in the firewall...

image

Hit the "Apply" button in the firewall, and we are back at EasyShare...

Step 3: Samba and printer setup

EasyShare has jumped the firewall hurdle, and now requests setup of file-sharing and printer...

image

...as you can see, printer setup and mode of file-sharing is just a matter of ticking the appropriate radiobutton.

EasyShare offers two modes of file-sharing, by Samba or by SSHFS. Samba is good for sharing with Windows computers, but has limitations of file permissions and ownership when sharing between Linux computers. In the latter situation, choose SSHFS.

Note also, printing between Linux computers is easy and only requires CUPS, whereas printing to or from a Windows machine also requires Samba to be enabled.

OK, let's choose Samba file-sharing:

image

Samba setup is easy, just click the "Samba Setup" button, which will launch the SambaSetup application. Note that this was originally created by Michael Amadio (01micko on the Puppy Forum), and I have heavily modified it to work with EasyShare. Here it is...

image

...I do need to clarify, the above snapshot is not from a pristine first-bootup situation. In such a case, the Samba daemon would not be running, and the default password, "woofwoof" would be showing in the password boxes (not as X's) with a recommendation to change the password to something else.

If you had booted a pristine system, setting up Samba is a no-brainer. Just click the button to start the Samba daemon. You don't even have to change the password, in fact you could do it later, just click the "Quit" button, and you are done, Samba is setup and running. Then, you will be back at EasyShare, and now the action starts...

Step 4: Printer server

The scenario is that my midi-tower has a Brother laser printer, and I want to be able to print to it from other computers on the network. So, this is what the EasyShare window looks like on my midi-tower:

image

...I clicked the "Share local printer" radiobutton. EasyShare has automatically detected everything, showing the local printers that are now being shared over the network, a local folder that is being shared by Samba, and two remote folders from computers with hostnames "EASYPC23501" and "DESKTOP-U4IHIEA.

It is informing me that "Brother_HL-2040_series" printer is shared over the network, however, I also created "Brother_HL-2040_rawprinter" for printing from a Windows machine -- see notes further down this page.

PC "DESKTOP-U41HIEA" is my Mele mini-pc running Win10, and "EASYPC23501" is my Asus laptop running EasyOS.

As we are on the topic of printing right now, let's see the viewpoint from my Asus laptop...

image

...on the Asus, I ticked the "Network printer" radiobutton, and the Brother printer is automatically discovered. There is nothing else to do, From any app in the Asus laptop, when I choose to print, the Brother printer will be offered.

Technical note
To understand how CUPS prints to a remote computer, look at file /etc/cups/client.conf. You will see that it contains one line, like this "ServerName 192.168.0.2", where "192.168.0.2" is the IP-address of the computer that has the printer.
A problem with this is that IP-addresses on a local network can change, if served by a DHCP server. EasyOS fixes this automatically by a script /etc/init.d/z-cups-network-fix, that runs at every bootup.

EasyShare makes network printing dead-simple. I can print from my Asus laptop to the Brother printer attached to my midi-tower, just as though it is a local printer.

OF course, one thing assumed above is that EasyOS on my midi-tower has been setup to use the local printer, plugged into a USB socket. This is done via the menu "Setup -> CUPS Printer Wizard", which runs the CUPS web-interface. Early in 2018 I wrote a blog report on configuring CUPS:

http://bkhome.org/news/201801/easy-network-printing-with-cups.html

...however, note that EasyShare will pre-configure the radiobuttons for you, to setup the printer as private or shared.

Technical note
If you have used the CUPS Printer Wizard to setup a local printer, EasyShare will take care of configuring it as private or shared. The web-interface does have some checkboxes for this, however, EasyShare will set or clear them automatically, depending on whether you have chosen "Private local printer" or "Share local printer" (see above snapshot). The way it does this is by grabbing a pre-configured configuration file from /usr/local/EasyShare and copying it to /etc/cups/cupsd.conf (and restarting the cupsd daemon).

Now onto file sharing...

Step 5: file sharing: Linux-to-Linux

My midi-tower has hostname "EASYPC26528" and my Asus laptop is "EASYPC23501". These names were auto-generated, however, you are welcome to go back to Samba Setup and change it to something more meaningful, such as "ASUSLAPTOP" and "MIDITOWER" -- I recommend capitals, for maximum Windows compatibility.

Anyway, look at the next-up snapshot, my midi-tower EASYPC26528 has automatically recognised that my Asus laptop has a folder that it wants to share. Just click the "Mount" button...

image

...voila, a folder-icon has appeared immediately below "EASYPC23501_1", and an "Unmount" button underneath. Just click the folder-icon, and we are now sharing files with the Asus laptop.

That's all there is to it, dead-simple. With Samba though, there are some gotchas, mostly due to Samba being designed for sharing with Windows machines.

Samba is OK to share files between Linux machines, as I have enabled "Unix extensions" This ensures that file permissions are preserved. To avoid serious conflicts of permissions, EasyShare mounts folders read-only -- for example, in the above snapshot, the folder in "EASYPC23501_1" (my Asus laptop), is mounted read-only on the midi-tower.

On the surface, this might seem like a troublesome limitation, however, in practice it is OK. The shared folder exported by my midi-tower can be mounted on the Asus laptop for file transfers the other way.

Might as well throw in more info about limitations... User and Group ownerships are not preserved. On the read-only end, they will all show as root:root, as EasyOS runs as root (that is another story!). Oh, and symbolic links and hard links are not preserved either, they show on the read-only end as the files that they point to.

If you are aware of these limitations, you can live with them. If you really need to preserve ownership and links, put the files in a tarball.

Samba was originally designed for sharing between Unix/Linux and Windows machines, hence sometimes seems a bit uncomfortable with Linux-to-Linux sharing. Oh well, that's the way it is. Sharing with Windows...

Step 6: File sharing, Linux-Windows

I need to write a tutorial for this. For now, if you have setup Win10 to share over the local network, it will automatically discover what is there...

image

...see, Win10 has discovered "EASYPC5290" which is my midi-tower. If I now open "puppyshare"...

image

We are in business! Win10 has mounted the folder read-write, so we have two-way transfers. Do note though, that Windows does not know about file permissions and ownership, So any file or folder that you create on the Windows end, will have odd permissions on the Linux end.

We can also print. In my case the printer is on a Linux machine, and I am able to print to it from my Win10 machine...

Step 7: printing, Linux-Windows

On my midi-tower, I created a "raw" printer interface, as per instructions by Puppy Forum member 'shinobar' here:

http://www.murga-linux.com/puppy/viewtopic.php?p=468516#468516

Well, can put some snapshots here too. I already have CUPS setup for my "Brother_HL-2040_series" printer, so I added another one and changed the name slightly, to "Brother_HL-2040_rawprinter"...

image

In the next window, instead of selecting the driver for my Brother printer, I clicked "Select Another Make/Manufacturer" button...

image

And then I chose "Raw"...

image

Then on the next window, just click "Add Printer" button...

image

Then you are in business. Over in Win10, if you click on the printer icon, it will ask you to select a driver, and will download the (in my case) Brother HL-2040 driver for Win10 -- so you must have an Internet connection.

Look around, there is a "Print Test Page" button.

As mentioned above, Samba has limitations with sharing files with Unix or Linux. For that reason, I added an alternative to EasyShare, SSHFS...

Step 5B: Linux-to-Linux with SSHFS

SSHFS is built on top of SSH, which provides encrypted login to a remote computer. SSHFS adds a virtual filesystem, so you can browse a remote folder just like any normal filesystem.

So, tick the "SSHFS" radiobutton, then run "SSHFS Setup":

image

...turn on the daemon, click the "OK" button (if you want to, leave the default password "woofwoof" as-is for now), and you are in business...

image

SSHFS is highly recommended for Linux-to-Linux file sharing, as it is developed primarily for Unix and Linux systems. Note that there are applications available for Windows to share with SSHFS, but you won't get printing.

Notice in the "SSHFS Setup" snapshot, I have gone overboard with security. The home folder of user "rover", inside a chroot, is mounted. That is specific to EasyOS.

However, there is automatic detection if not running EasyOS and instead user "rover" is created at /home/rover and that is shared. So not a chroot. This is preparing EasyShare to run on other Linux distros, such as Quirky.



That's it!

What I wanted for myself is file and printer sharing that can be setup with just a few clicks. Although there is a lot of explanation above, essentially it does resolve down to "just a few clicks".

I can plug a computer into the network, boot a pristine EasyOS or Quirky, click the "share" icon, and after quite literally a few clicks have sharing of files and printer. Awesome!

Furthermore, settings are remembered for future bootups. Awesome again!

Regards,
Barry Kauler
February 8, 2018
(c) Copyright Barry Kauler, Feb. 2018, all reproduction rights reserved. 


Notes

Miscellaneous extra notes here.

This is a very early version of EasyShare, and there are some "peculiarities". As at February 8, 2018, EasyShare is version 0.3.

Tags: easyshare