[SOLVED] Directory sharing on LAN with Windows 7 and 10

All Gurus once were Newbies
Forum rules
There are no such things as "stupid" questions. However if you think your question is a bit stupid, then this is the right place for you to post it. Please stick to easy to-the-point questions that you feel people can answer fast. For long and complicated questions prefer the other forums within the support section.
Before you post please read how to get help
Post Reply
User avatar
bikegremlin
Level 1
Level 1
Posts: 25
Joined: Wed Jul 24, 2019 12:54 pm
Location: Novi Sad, Serbia
Contact:

[SOLVED] Directory sharing on LAN with Windows 7 and 10

Post by bikegremlin » Tue Aug 13, 2019 9:34 am

I've been googling, found some instructions - including some topics on this very forum.
However, going through the "tutorials", I didn't find anything that was simple, nor straight forward enough.
Also, found several different commands and approaches being shown.

So, this is sort of a "spoon feeding" request:
I'm looking for straight forward, idiot friendly tutorial/instructions for enabling a LAN share of a directory.
The directory is on a Linux Mint Cinnamon PC (latest version, 64 bit). Ext4 partition.
Other computers, including some with Windows 7 and Windows 10 should be able to see it (mapping with a username and password, or showing in network hosts lists - whatever is easier).
Full read-write permissions within the LAN for any user/computer would be perfect, but read-only would work too (if read-write is a lot more complicated to setup).
Last edited by bikegremlin on Thu Aug 15, 2019 8:45 am, edited 1 time in total.
Mostly harmless ™
I/O Gremlin

User avatar
AndyMH
Level 8
Level 8
Posts: 2290
Joined: Fri Mar 04, 2016 5:23 pm
Location: Wiltshire

Re: Directory sharing on LAN with Windows 7 and 10

Post by AndyMH » Tue Aug 13, 2019 10:52 am

In your file manager right click on the folder you want to share, click sharing options. If samba needs to be installed it will tell you and install. I think it will work 'out of the box' with win10 - it should see it, might need some fiddling with win7. It's a while since I've had to do this.
Screenshot from 2019-08-13 15-51-22.png
Screenshot from 2019-08-13 15-51-22.png (22.11 KiB) Viewed 289 times
Homebrew i5-8400+GTX1080 Cinnamon 19.0, 3 x Thinkpad T430 Cinnamon 19.0, i7-3632 , i5-3320, i5-3210, Thinkpad T60 19.0 Mate

athi
Level 6
Level 6
Posts: 1006
Joined: Sun Mar 30, 2014 10:15 am
Location: USA

Re: Directory sharing on LAN with Windows 7 and 10

Post by athi » Tue Aug 13, 2019 12:22 pm

These are my tweaks to enable Mate file sharing with Windows, tweaked for Cinnamon:

Open Terminal with ctrl+atl+t hot keys

Run below commands in Terminal to install required packages and create permission for UFW (click SELECT ALL to highlight all text, right click and select Copy from menu, right click in Terminal window and select Paste to paste text, click Enter to execute command):

Code: Select all

sudo apt-get install nemo-share

Code: Select all

sudo apt-get install samba system-config-samba cifs-utils winbind

Code: Select all

sudo ufw allow Samba
Then follow AndyMH instruction on sharing directory/file. If you still have problem with either Win7 or Win10 (forgot which), you may also need to add "client max protocol = NT1" to smb.conf. Please post back for those steps.
Mint Mate 19.1. Main rig is HP 800G2 I5 6500 16GB ram, 120GB boot drive, 2x3TB, 1x4TB data drives. Oldest rig is Mate 18.3 on Dell D620 with 32bits core duo.

User avatar
bikegremlin
Level 1
Level 1
Posts: 25
Joined: Wed Jul 24, 2019 12:54 pm
Location: Novi Sad, Serbia
Contact:

Re: Directory sharing on LAN with Windows 7 and 10

Post by bikegremlin » Tue Aug 13, 2019 1:01 pm

athi wrote:
Tue Aug 13, 2019 12:22 pm
These are my tweaks to enable Mate file sharing with Windows, tweaked for Cinnamon:

Open Terminal with ctrl+atl+t hot keys

Run below commands in Terminal to install required packages and create permission for UFW (click SELECT ALL to highlight all text, right click and select Copy from menu, right click in Terminal window and select Paste to paste text, click Enter to execute command):

Code: Select all

sudo apt-get install nemo-share

Code: Select all

sudo apt-get install samba system-config-samba cifs-utils winbind

Code: Select all

sudo ufw allow Samba
Then follow AndyMH instruction on sharing directory/file. If you still have problem with either Win7 or Win10 (forgot which), you may also need to add "client max protocol = NT1" to smb.conf. Please post back for those steps.
OK.

I had installed Samba and tried AndyMH method - but it hadn't helped.

After having followed your instructions, the result is "a bit better" I'd say:

Now both Win 7 and 10 can "see" the shared directory.
However, there are two problems:

1) I need to re-share after restarting the computer (wasn't like that before)
2) Both Wins complain about access rights.

EDIT:
smb.conf is found at /etc/samba

I copied all the files from the dir in case I mess anything up.

Double Commander won't run copy/owerwrite as root, but Kate text editor has that option so I'd be able to copy/paste smb.conf contents back to the original state in case of any problems.
Last edited by bikegremlin on Tue Aug 13, 2019 1:09 pm, edited 1 time in total.
Mostly harmless ™
I/O Gremlin

athi
Level 6
Level 6
Posts: 1006
Joined: Sun Mar 30, 2014 10:15 am
Location: USA

Re: Directory sharing on LAN with Windows 7 and 10

Post by athi » Tue Aug 13, 2019 1:07 pm

bikegremlin wrote:
Tue Aug 13, 2019 1:01 pm

Now both Win 7 and 10 can "see" the shared directory.
However, there are two problems:

1) I need to re-share after restarting the computer (wasn't like that before)
2) Both Wins complain about access rights.
What is the workgroup name for Win7 and Win10? Some versions of Windows uses Homegroup which will cause problems. Also, can you get a screen shot of the Windows error messages?
Mint Mate 19.1. Main rig is HP 800G2 I5 6500 16GB ram, 120GB boot drive, 2x3TB, 1x4TB data drives. Oldest rig is Mate 18.3 on Dell D620 with 32bits core duo.

User avatar
bikegremlin
Level 1
Level 1
Posts: 25
Joined: Wed Jul 24, 2019 12:54 pm
Location: Novi Sad, Serbia
Contact:

Re: Directory sharing on LAN with Windows 7 and 10

Post by bikegremlin » Tue Aug 13, 2019 1:14 pm

athi wrote:
Tue Aug 13, 2019 1:07 pm
bikegremlin wrote:
Tue Aug 13, 2019 1:01 pm

Now both Win 7 and 10 can "see" the shared directory.
However, there are two problems:

1) I need to re-share after restarting the computer (wasn't like that before)
2) Both Wins complain about access rights.
What is the workgroup name for Win7 and Win10? Some versions of Windows uses Homegroup which will cause problems. Also, can you get a screen shot of the Windows error messages?
Workgroup is called "WORKGROUP" - should I rename it to something specific?

If this is not good enough, I can also add a screenshot, but this is all that it shows:

Code: Select all

Network Error
Windows cannot access \\IPV4.linux.computer.address\Catpics 
Contact your network administrator to request access.

For more information about permissions, see Winows Help and Support
Mostly harmless ™
I/O Gremlin

athi
Level 6
Level 6
Posts: 1006
Joined: Sun Mar 30, 2014 10:15 am
Location: USA

Re: Directory sharing on LAN with Windows 7 and 10

Post by athi » Tue Aug 13, 2019 1:30 pm

bikegremlin wrote:
Tue Aug 13, 2019 1:14 pm
athi wrote:
Tue Aug 13, 2019 1:07 pm
bikegremlin wrote:
Tue Aug 13, 2019 1:01 pm

Now both Win 7 and 10 can "see" the shared directory.
However, there are two problems:

1) I need to re-share after restarting the computer (wasn't like that before)
2) Both Wins complain about access rights.
What is the workgroup name for Win7 and Win10? Some versions of Windows uses Homegroup which will cause problems. Also, can you get a screen shot of the Windows error messages?
Workgroup is called "WORKGROUP" - should I rename it to something specific?

If this is not good enough, I can also add a screenshot, but this is all that it shows:

Code: Select all

Network Error
Windows cannot access \\IPV4.linux.computer.address\Catpics 
Contact your network administrator to request access.

For more information about permissions, see Winows Help and Support
WORKGROUP is what it should be, just want to make sure that Windows is not using the HOMEGROUP abomination. Also, create shares on the Win7 and Win8 PC and see if you can access from Mint PC. I remembered this could caused sharing problems with Windows and may still apply.

You may need to change permissions in the shared directories, these instructions are for Mate but should be similar in Cinnamon:
1) Right click on the shared directory and select Properties from menu.
2) Check that Owner is current user and not Root
3) Click on Owner Folder access pull down menu and select the access right you want to grant.
4) Click on Owner File access pull down menu and select the access right you want to grant.
5) Repeat steps 3 and 4 for Group and Others.
6) Check or uncheck Execute box per your requirements.
7) Click Apply Permissions to Enclosed Files icon to apply changes.
8. Click Close to close Properties window.

Now see if you can access the shares from both Windows and Mint.
Mint Mate 19.1. Main rig is HP 800G2 I5 6500 16GB ram, 120GB boot drive, 2x3TB, 1x4TB data drives. Oldest rig is Mate 18.3 on Dell D620 with 32bits core duo.

User avatar
bikegremlin
Level 1
Level 1
Posts: 25
Joined: Wed Jul 24, 2019 12:54 pm
Location: Novi Sad, Serbia
Contact:

Re: Directory sharing on LAN with Windows 7 and 10

Post by bikegremlin » Tue Aug 13, 2019 1:47 pm

athi wrote:
Tue Aug 13, 2019 1:30 pm
WORKGROUP is what it should be, just want to make sure that Windows is not using the HOMEGROUP abomination. Also, create shares on the Win7 and Win8 PC and see if you can access from Mint PC. I remembered this could caused sharing problems with Windows and may still apply.

You may need to change permissions in the shared directories, these instructions are for Mate but should be similar in Cinnamon:
1) Right click on the shared directory and select Properties from menu.
2) Check that Owner is current user and not Root
3) Click on Owner Folder access pull down menu and select the access right you want to grant.
4) Click on Owner File access pull down menu and select the access right you want to grant.
5) Repeat steps 3 and 4 for Group and Others.
6) Check or uncheck Execute box per your requirements.
7) Click Apply Permissions to Enclosed Files icon to apply changes.
8. Click Close to close Properties window.

Now see if you can access the shares from both Windows and Mint.
Thanks - that was as detailed as it gets. But it didn't help. :(

I did try restarting the computers.
I also made sure the sharing computer IP isn't changed (it's set to be fixed).

Also - I noticed that the share gets lost whenever I restart the Linux computer.
However, I double checked and saw the share gets "lost" also as soon as I close the Nemo browser - using which I had set those options!
Didn't notice that from the start, should have double checked before.

Until I close the Nemo, I can see the directory's icon become changed ("share" mark?).
But after I close it and re-open it, that gets lost.
Same goes when right-clicking the shared directory. I can see the share options remaining "memorized" only until I close Nemo.

As for the Win computers - when I type the Linux sharing computer IP, they "see" the shared directory (as shared - that icon is shown) - but they still can't access it. Not even while the Nemo is open. Not even after they (the Win computers) get restarted.
Mostly harmless ™
I/O Gremlin

athi
Level 6
Level 6
Posts: 1006
Joined: Sun Mar 30, 2014 10:15 am
Location: USA

Re: Directory sharing on LAN with Windows 7 and 10

Post by athi » Tue Aug 13, 2019 2:02 pm

bikegremlin wrote:
Tue Aug 13, 2019 1:47 pm
Thanks - that was as detailed as it gets. But it didn't help. :(

I did try restarting the computers.
I also made sure the sharing computer IP isn't changed (it's set to be fixed).

Also - I noticed that the share gets lost whenever I restart the Linux computer.
However, I double checked and saw the share gets "lost" also as soon as I close the Nemo browser - using which I had set those options!
Didn't notice that from the start, should have double checked before.

Until I close the Nemo, I can see the directory's icon become changed ("share" mark?).
But after I close it and re-open it, that gets lost.
Same goes when right-clicking the shared directory. I can see the share options remaining "memorized" only until I close Nemo.

As for the Win computers - when I type the Linux sharing computer IP, they "see" the shared directory (as shared - that icon is shown) - but they still can't access it. Not even while the Nemo is open. Not even after they (the Win computers) get restarted.
Not really sure why samba share is disappearing after Nemo windows is closed. Try running samba restart in Terminal after making the changes, see if the shares are still disappearing.
Mint Mate 19.1. Main rig is HP 800G2 I5 6500 16GB ram, 120GB boot drive, 2x3TB, 1x4TB data drives. Oldest rig is Mate 18.3 on Dell D620 with 32bits core duo.

User avatar
bikegremlin
Level 1
Level 1
Posts: 25
Joined: Wed Jul 24, 2019 12:54 pm
Location: Novi Sad, Serbia
Contact:

Re: Directory sharing on LAN with Windows 7 and 10

Post by bikegremlin » Tue Aug 13, 2019 2:53 pm

athi wrote:
Tue Aug 13, 2019 2:02 pm
Not really sure why samba share is disappearing after Nemo windows is closed. Try running samba restart in Terminal after making the changes, see if the shares are still disappearing.
Run that command. Now the file stays shared after closing Nemo. :)
Mostly harmless ™
I/O Gremlin

athi
Level 6
Level 6
Posts: 1006
Joined: Sun Mar 30, 2014 10:15 am
Location: USA

Re: Directory sharing on LAN with Windows 7 and 10

Post by athi » Tue Aug 13, 2019 3:05 pm

Can you access shares from Mint and Windows PC?
Mint Mate 19.1. Main rig is HP 800G2 I5 6500 16GB ram, 120GB boot drive, 2x3TB, 1x4TB data drives. Oldest rig is Mate 18.3 on Dell D620 with 32bits core duo.

User avatar
bikegremlin
Level 1
Level 1
Posts: 25
Joined: Wed Jul 24, 2019 12:54 pm
Location: Novi Sad, Serbia
Contact:

Re: Directory sharing on LAN with Windows 7 and 10

Post by bikegremlin » Tue Aug 13, 2019 4:25 pm

athi wrote:
Tue Aug 13, 2019 3:05 pm
Can you access shares from Mint and Windows PC?
Not from Windows.

And can't say about Mint, since the sharing computer is the only one with Linux within the LAN (for now), while I'm not sure how to access the shared directory using "the share" from Linux.
Mostly harmless ™
I/O Gremlin

altair4
Level 19
Level 19
Posts: 9628
Joined: Tue Feb 03, 2009 10:27 am

Re: Directory sharing on LAN with Windows 7 and 10

Post by altair4 » Tue Aug 13, 2019 4:45 pm

Just a suggestion but what's missing from this topic is how you are set up, what you are sharing, and where the shared folder is located. If you post the output of the following commands I think it would help:

Code: Select all

testparm -s

Code: Select all

net usershare info --long
Please add a [SOLVED] at the end of your original subject header if your question has been answered and solved.

User avatar
bikegremlin
Level 1
Level 1
Posts: 25
Joined: Wed Jul 24, 2019 12:54 pm
Location: Novi Sad, Serbia
Contact:

Re: Directory sharing on LAN with Windows 7 and 10

Post by bikegremlin » Wed Aug 14, 2019 12:03 am

altair4 wrote:
Tue Aug 13, 2019 4:45 pm
Just a suggestion but what's missing from this topic is how you are set up, what you are sharing, and where the shared folder is located. If you post the output of the following commands I think it would help:

Code: Select all

testparm -s

Code: Select all

net usershare info --long
Here it is, testparm -s result:

Code: Select all

Load smb config files from /etc/samba/smb.conf
rlimit_max: increasing rlimit_max (1024) to minimum Windows limit (16384)
WARNING: The "syslog" option is deprecated
Processing section "[printers]"
Processing section "[print$]"
Processing section "[Catpics]"
Loaded services file OK.
Server role: ROLE_STANDALONE

# Global parameters
[global]
	dns proxy = No
	log file = /var/log/samba/log.%m
	map to guest = Bad User
	max log size = 1000
	obey pam restrictions = Yes
	pam password change = Yes
	panic action = /usr/share/samba/panic-action %d
	passwd chat = *Enter\snew\s*\spassword:* %n\n *Retype\snew\s*\spassword:* %n\n *password\supdated\ssuccessfully* .
	passwd program = /usr/bin/passwd %u
	security = USER
	server role = standalone server
	server string = %h server (Samba, Ubuntu)
	syslog = 0
	unix password sync = Yes
	username map = /etc/samba/smbusers
	usershare allow guests = Yes
	idmap config * : backend = tdb


[printers]
	browseable = No
	comment = All Printers
	create mask = 0700
	path = /var/spool/samba
	printable = Yes


[print$]
	comment = Printer Drivers
	path = /var/lib/samba/printers


[Catpics]
	comment = Cat-pictures
	guest ok = Yes
	path = /mnt/linmag/Catpics
And net usershare info --long results:

Code: Select all

i[Catpics]
path=/mnt/linmag/Catpics
comment=
usershare_acl=Everyone:F,
guest_ok=y
Mostly harmless ™
I/O Gremlin

altair4
Level 19
Level 19
Posts: 9628
Joined: Tue Feb 03, 2009 10:27 am

Re: Directory sharing on LAN with Windows 7 and 10

Post by altair4 » Wed Aug 14, 2019 6:51 am

3 more questions:

What is your hostname on the Linux box- run the following:

Code: Select all

hostname
And what are the permissions of the target folder and the path to it:

Code: Select all

ls -al /mnt/linmag
And how are you mounting the target folder - if this is another partition:

Code: Select all

cat /etc/fstab
Please add a [SOLVED] at the end of your original subject header if your question has been answered and solved.

User avatar
bikegremlin
Level 1
Level 1
Posts: 25
Joined: Wed Jul 24, 2019 12:54 pm
Location: Novi Sad, Serbia
Contact:

Re: Directory sharing on LAN with Windows 7 and 10

Post by bikegremlin » Wed Aug 14, 2019 2:20 pm

altair4 wrote:
Wed Aug 14, 2019 6:51 am
3 more questions:

What is your hostname on the Linux box- run the following:

Code: Select all

hostname
And what are the permissions of the target folder and the path to it:

Code: Select all

ls -al /mnt/linmag
And how are you mounting the target folder - if this is another partition:

Code: Select all

cat /etc/fstab
Hostname:

Code: Select all

C3P0

Paths and permissions:

Code: Select all

ls -al /mnt/linmag/Catpics
total 8
drwxrwxrwx 2 relja relja 4096 Aug 14 05:43 .
drwx------ 9 relja relja 4096 Aug 14 05:43 ..
Mounting:

Code: Select all

# /etc/fstab: static file system information.
#
# <file system> <mount point>   <type>  <options>       <dump>  <pass>

#Entry for /dev/sda5 :
UUID=8e6c58a1-0eed-43d3-91b0-e834747a5235	/	ext4	errors=remount-ro	0	1
#Entry for /dev/sda2 :
UUID=941C-FA7C	/boot/efi	vfat	umask=0077	0	1
#Entry for /dev/sda6 :
UUID=e3b728bb-294b-4aa1-bdd1-65a2f5a8b9fd	/home	ext4	defaults	02
#Entry for /dev/sdb2 :
UUID=01D38567972275A0	/mnt/data	ntfs-3g	defaults,nosuid,nodev,locale=en_US.UTF-8	0	0
#Entry for /dev/sdb3 :
LABEL=linmag	/mnt/linmag	auto	nosuid,nodev,nofail,x-gvfs-show	0	0
#Entry for /dev/sdc2 :
UUID=C262710862710309	/mnt/magacin	ntfs-3g	defaults,nosuid,nodev,locale=en_US.UTF-8	0	0
#Entry for /dev/sda4 :
UUID=B8C03279C0323E46	/mnt/win10sys	auto	nosuid,nodev,nofail,x-gvfs-show00
#Entry for /dev/sda7 :
UUID=456412bf-34c9-4915-a2f7-39cac9a7cabc	none	swap	sw	0	0
/dev/disk/by-uuid/1f8ae9b5-964d-410e-8d31-c9409dd3b4ae	/mnt/1f8ae9b5-964d-410e-8d31-c9409dd3b4ae	auto	nosuid,nodev,nofail,x-gvfs-show,x-gvfs-name=LinMag,x-gvfs-icon=LinMag,x-gvfs-symbolic-icon=LinMag	0	0
Mostly harmless ™
I/O Gremlin

altair4
Level 19
Level 19
Posts: 9628
Joined: Tue Feb 03, 2009 10:27 am

Re: Directory sharing on LAN with Windows 7 and 10

Post by altair4 » Wed Aug 14, 2019 2:51 pm

ls -al /mnt/linmag/Catpics
total 8
drwxrwxrwx 2 relja relja 4096 Aug 14 05:43 .
drwx------ 9 relja relja 4096 Aug 14 05:43 ..
Edit /etc/samba/smb.conf and right under the workgroup = WORKGROUP line add this one:

Code: Select all

force user = relja
Save the file then restart smbd:

Code: Select all

sudo service smbd restart
Reason: Catpics has the correct permissions for write access to guests. But the permissions on /mnt/linmag only allows user relja to get to the Catpics folder. force user = relja will make so the guest user appears to be that user - at least for your samba shares.

WIn7 and Win10 being able to discover your Linux machine under Network in Explorer is another matter.

The two Windows machine operate differently. Windows 10 disables network browsing for netbios hosts so if you have kept your WIn10 up to date it will never see your machine. I recommend opening explorer and accessing the machine by it's mDNS name: \\C3P0.local or by it's ip address \\192.168.0.100 - or whatever.

The Win7 machine represents the old way with all the old rules and frustrations. Wrote a HowTo on the subject a few millennia ago: Samba Browsing Problems Checklist
Last edited by altair4 on Wed Aug 14, 2019 3:15 pm, edited 1 time in total.
Please add a [SOLVED] at the end of your original subject header if your question has been answered and solved.

User avatar
bikegremlin
Level 1
Level 1
Posts: 25
Joined: Wed Jul 24, 2019 12:54 pm
Location: Novi Sad, Serbia
Contact:

Re: Directory sharing on LAN with Windows 7 and 10

Post by bikegremlin » Wed Aug 14, 2019 3:06 pm

altair4 wrote:
Wed Aug 14, 2019 2:51 pm
ls -al /mnt/linmag/Catpics
total 8
drwxrwxrwx 2 relja relja 4096 Aug 14 05:43 .
drwx------ 9 relja relja 4096 Aug 14 05:43 ..
Edit /etc/samba/smb.conf and right under the workgroup = WORKGROUP line add this one:

Code: Select all

force user = relja
Save the file then restart smbd:

Code: Select all

sudo service smbd restart
Reason: Catpics has the correct permissions for write access to guests. But the permissions on /mnt/linmag only allows user relja to get to the Catpics folder. force user = relja will make so the guest user appears to be that user - at least for your samba shares.

WIn7 and Win10 being able to discover your Linux chine under Network in Explorer is another matter.

The two Windows machine operate differently. Windows 10 disables network browsing for netbios hosts so if you have kept your WIn10 up to date it will never see your machine. I recommend opening explorer and accessing the machine by it's mDNS name: \\CP30.local or by it's ip address \\192.168.0.100 - or whatever.

The Win7 machine represents the old way with all the old rules and frustrations. Wrote a HowTo on the subject a few millennia ago: Samba Browsing Problems Checklist
Thank you very much. That did the trick. :)
I also find the explanation you provided invaluable - since I know almost nothing now.
Really appreciated.

I did (have to) use the IP to find the shared directory. That's no problem - I set that up once, use a shortcut and it's fine.
The problem was not having been able to open the shared "target" directory.

Now it works from Windows10 and 7 in "read only" mode - which is fine for my needs. Perhaps even better.

Though Win7 will most probably "become" Linux Mint relatively quickly. :)
Mostly harmless ™
I/O Gremlin

Post Reply

Return to “Newbie Questions”