site  news  contact

EasyShare, super easy network file and printer sharing

August 15, 2018 — BarryK

UPDATE 20180813: Support for Android phone USB connection. 

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.

EasyShare can be found in EasyOS version 0.7.1 or greater, or Quirky Linux 8.4 or greater, however, EasyShare underwent a major rewrite for EasyOS 0.9.6 and greater. Note that versions of EasyOS prior to 0.7.1 have an earlier effort called QuickSamba, now retired.

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

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 Aspire laptop, running EasyOS. The third PC, that I am typing this tutorial on, is my midi-tower, also running EasyOS. The Asus laptop 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...

image

...that's it, nothing to configure, network shares automatically discovered!

A couple of important points about the above snapshot: the firewall defaults to enabled, and the checkbox to discover network shares defaults to ticked.

My Mele mini-PC is running Windows, and has a share, named "DESKTOP-U4IHIEA", and as you can see, it has been automatically discovered. If I click on the "Mount" button, the username and password will be asked for, and we are in business.

My Asus laptop has a printer connected, and EasyShare is configured on the laptop share the printer. To access the printer from my midi-tower, all that I have to do is click the "Network printer" radiobutton...

image

...that's it, printer ready for use. Network printers are automatically discovered and available from apps just like any local printer.

There is really no need for a detailed tutorial, EasyShare is so "easy peasy". However, for someone reading this page online, not yet able to get their hands on EasyShare, the tutorial continues...

Firewall

EasyShare in EasyOS prior to version 0.9.6 required manual configuration of the firewall. There is a firewall GUI, in the menu at bottom-left of screen, "Setup -> Firewall Setup Wizard", which can be run at any time to turn specific ports on and off. However, this is not needed, as EasyShare does it automatically.

A technical detail is that the firewall configuration can be found at ~/.config/firewall/fw.conf, and you can look at this file to see exactly what ports are open or blocked. EasyShare writes to this file and regenerates the firewall whenever there is a change, such as one of the radiobuttons or checkbox selected.

You can turn off the firewall if you wish, however, it is recommended to be on for security reasons. All ports other than those absolutely needed, will be blocked.

Printer sharing

The way that I setup a printer to be shared, is first configured a local printer on my Asus laptop. This is done via the menu at bottom-left of screen, "Setup -> CUPS Printer Wizard". This is straightforward, as long as there is a driver for the printer.

To make this printer available over the network, for other computers to print-to, is very simple. The above snapshot shows the printer showing up in my midi-tower PC. On my laptop, I exported the printer by clicking this radiobutton...

image

...that's it, done. No manual configuration required.

File sharing

Just as easy. Let's say, on the laptop, I want to share a folder, that can be read-from and written-to by other computers. Click on the "SSHFS" radiobutton...

image

...as you can see, the SSH daemon has to be started, so click the "SSHFS Setup" button...

image

...I already clicked on that "SSHD ON" green button prior to taking the snapshot. Change the password if you want more security, or it can be done anytime later. That's it, the "rover" folder is now shared...

image

Back over at my midi-tower, if I click the remote-scan refresh button, there it is...

image

Now, if I click on the "EASYPC8092" "Mount" button, the password will be asked for...

image

Then we are in business...

image

The EasyShare window shows the folder as mounted, and we can click on the "Unmount" button when finished...

image

...very simple.

Android phone

EasyShare is evolving, and and support for Android phones connected via USB cable has been added on August 13, 2018. Here is a snapshot:

image

An Android phone can connect over a wifi network, however, the "old" way with a USB cable is very simple, secure, and requires no password.

As you can see in the above snapshot, there is a Help button, however, it is very simple. Developer mode must be turned-on on the phone, and USB-debugging enabled (which is explained in the help window).

Technical notes:
EasyShare uses adbfs, which is a filesystem for the Android Debug Bridge. The latter is provided by the adb utility. The end result for the user is simplicity: click the "Mount" button and you will get a ROX-Filer window and can read/write the folders and files on the phone. Afterwards, close down with the "Unmount" button.

That's it, as I stated, easy-peasy. For sharing with Windows PCs though, is another story! Windows-sharing is a work-in-progress, and more will be added to this tutorial. What is below is the "old" tutorial, which will be updated,,,

Regards,
Barry Kauler, August 13, 2018


Parts of "Old" tutorial...



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: easyapps