Sharing a Printer
The easiest way of sharing the printer was to hook it up to the router with its own ethernet cable. Then it was a case of System > Administration > Printing and clicking on New. The networked printer was identified correctly as the first item with the IP address and Port No. The driver had already been added http://p-s.co.nz/wordpress/?p=13 and it was a matter of selecting it. This worked on every computer on the LAN.
From within virtualised Windows XP it was trickier. Start > Control Panel > Printers and Faxes then Add a Printer, Next, then, counterintuitively, do NOT select network printer but select Local printer (leave plug and play unticked). Then it was a matter of creating a new port of the Standard TCP/IP type. The IP address of the printer was added (printing printer settings directly from the printer menu included the current IP address). Once created, this is the port to use. The rest is straight forward.
Sharing a Folder
From Server End ****************************
Need to edit /etc/samba/smb.conf
sudo gedit /etc/samba/smb.conf
Key features (NB rather too much trial and error for my liking – it worked for me but would prefer to have any recommendations arise out of a clear understanding 😉 ) :
[global]
security = share
## Browsing/Identification ###
# Change this to the workgroup/NT-domain name your Samba server will part of
    workgroup = realworkgroupnamehere
———————————-
Find, and ensure it is commented out:
;    map to guest = bad user
———————————-
# Allow users who’ve been granted usershare privileges to create
# public shares, not just authenticated ones
;    usershare allow guests = yes
;    username map = /etc/samba/smbusers
    security = share
;    guest ok = no
guest account = root
At the end:
[sharename]
    path = /path/path/sharename
    public = yes
    locking = no
    writable = yes
    browsable = yes
    guest ok = yes
    guest only = yes
Can check that everything came through with
testparm
then Enter to see dump:
sudo /etc/init.d/samba reload # reload samba so changes in smb.conf take hold.
…
From Client End *****************************
Make folder ready to mount on top off: sudo mkdir /media/sharedfoldername
Then configure mounting in such a way that it is automatic on startup:
sudo gedit /etc/fstab # edit contents of fstab (what you want mounted and how)
Then add something like:
//server_IP/sharedfoldername /media/sharedname cifs auto,owner,rw,username=guest,workgroup=workgroupname,uid=user_id_local_machine,gid=user_id_local_machine 0 0
Find user id from System > Administration > Users and Groups then look at Properties > Advanced tab in User ID:
sudo mount -a # mounts everything in /etc/fstab
You should be able to add and edit documents etc.
Useful Commands
sudo mount -a # mounts everything in /etc/fstab
sudo gedit /etc/fstab # edit contents of fstab (what you want mounted and how)
sudo umount /path/more/sharedfolder # unmount (ready to remount if testing changes to fstab)
NB there is another approach to this presented in http://blogs.pcworld.co.nz/pcworld/tux-love/2008/09/hidden_linux_diy_file_server.html but I was unable to get it to work for reasons which elude me. Perhaps it will work for you 🙂 .
