Author Topic: Offline Files with Samba (Windows 7 Prof Clients)  (Read 8431 times)

pout

  • Zen Apprentice
  • *
  • Posts: 16
  • Karma: +0/-0
    • View Profile
Offline Files with Samba (Windows 7 Prof Clients)
« on: January 10, 2012, 01:55:42 pm »
Hello,

does anybody know how and where to change the smb.cnf to make it possible to have the files of samba-shares offline available in Windows 7?

I have to put in
Code: [Select]
oplocks = yes
level2 oplocks = yes
kernel oplocks = no
map archive = yes
map system = yes
map hidden = yes
somewhere.

Thank you
Roman

pete83

  • Zen Apprentice
  • *
  • Posts: 31
  • Karma: +0/-0
    • View Profile
Re: Offline Files with Samba (Windows 7 Prof Clients)
« Reply #1 on: January 31, 2012, 11:42:15 am »
Roman,

I'm also struggling with getting this to work but I'm afraid that we have to wait for Zentyal 3.0 which contains Samba4. I've searched the net for a solution but can't find one that works for me. Maybe someone here has a solution.......

Or else we have to wait and take the nagging by my users about this missing feature for granted. I've read somewhere that Samba4 will solve the problem.



Running: Zentyal 2.0.23

Remon

  • Zen Monk
  • **
  • Posts: 77
  • Karma: +4/-0
  • Luctor et emergo
    • View Profile
Re: Offline Files with Samba (Windows 7 Prof Clients)
« Reply #2 on: February 01, 2012, 11:36:57 pm »
Can you not add the options to a post service hook that will append these items in the config file?

pete83

  • Zen Apprentice
  • *
  • Posts: 31
  • Karma: +0/-0
    • View Profile
Re: Offline Files with Samba (Windows 7 Prof Clients)
« Reply #3 on: February 02, 2012, 10:07:13 am »
Of course you can edit the smb.conf.mas file which is located in this directory on my system: /usr/share/ebox/stubs/samba/smb.conf.mas. 

Look for the part with "% foreach my $share (@shares)" and add the options as seen below and restart samba afterwards. This way the options will always stay in /etc/samba/smb.conf:
Code: [Select]
% foreach my $share (@shares) {
[<% $share->{share} %>]
 comment = <% $share->{comment} %>
 path = <% $share->{path} %>
% if ($share->{guest}) {
 guest only = yes
 guest ok = yes
% } else {
 valid users = <% $share->{validUsers} %>
 read list = <% $share->{readOnly} %>
 write list = <% $share->{readWrite} %>
 admin users = <% $share->{administrators} %>
% }
 read only = No
 browseable = Yes
 force create mode = 0777
 force directory mode = 0777
 oplocks = yes
 level2 oplocks = yes
 kernel oplocks = no
 create mask = 777
 map archive = yes
 map system = yes
 map hidden = yes

It didn't work for my users, the problem is that when they are editing offline MS office documents and come back online again there are always several conflicts with the files.


Running: Zentyal 2.0.23

pete83

  • Zen Apprentice
  • *
  • Posts: 31
  • Karma: +0/-0
    • View Profile
Running: Zentyal 2.0.23

ian

  • Community Council Member
  • Zen Samurai
  • *****
  • Posts: 294
  • Karma: +10/-1
    • View Profile
    • Familie site
Re: Offline Files with Samba (Windows 7 Prof Clients)
« Reply #5 on: February 02, 2012, 10:28:41 am »
Hello,

To work with off line maps and files, you have to define it on the windows client computer.

In the windows explorer , in de top tab bar select extra > offline files , and activate it .
On the maps itself activate de selection working with off line files.
It is not that difficult , follow the instructions in de several menu's.
Every time the client computer is connected with the netwerk, there is automaticly a synchronisation with the local files on your laptop and the files on the server.

Nothing has to be set on the Zentyal file server, all the definitions must be executed on the Windows client.

Best regards,
Ian

pete83

  • Zen Apprentice
  • *
  • Posts: 31
  • Karma: +0/-0
    • View Profile
Re: Offline Files with Samba (Windows 7 Prof Clients)
« Reply #6 on: February 02, 2012, 11:10:01 am »
Ian,

I know in windows 7 it is quite easy to set up network drives for offline files and it seems to work indeed without any changes to the zentyal server but when my users start to edit ms office files offline and come back online again there are always a lot of conflicts. And I think it has something to do with the way Office saves his files while working on them. There are always problems with TMP files.

In the samba client logs I find this error when trying to usae offline files:

Code: [Select]
call_nt_transact_ioctl(0x901af): Currently not implemented.
With Windows XP offline files are working fine without any changes to zentyal indeed.

Running: Zentyal 2.0.23

pete83

  • Zen Apprentice
  • *
  • Posts: 31
  • Karma: +0/-0
    • View Profile
Offline Files with Samba (Windows 7 Prof Clients)
« Reply #7 on: February 22, 2012, 03:09:24 pm »
I seem to have offline files running without conflicts on zentyal 2.1. I've added the following to the smb.conf.mas file in the "foreach my $share (@shares)" section:

 
Code: [Select]
oplocks = Yes
 level2 oplocks = Yes
 kernel oplocks = No
 create mask = 777
 

And changed some registry entries on the windows 7 client side:

Code: [Select]
Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\NetCache]
"RoundUpWriteTimeOnSync"=dword:00000001
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\mrxsmb]
"OplocksDisabled"=dword:00000000
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\LanmanServer\Parameters]
"EnableOplocks"=dword:00000001
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\LanmanWorkstation\Parameters]
"EnableOplocks"=dword:00000001

I found this solution here http://www.readynas.com/forum/viewtopic.php?f=21&t=47091&p=329869 and it seems to work for now.

The only thing is when I add the "map hidden = Yes" to smb.conf most of the files are not visible for my users. And most of the files have the "Archive" flag enabled on the client side. Does someone know why this is?
« Last Edit: February 22, 2012, 03:51:01 pm by pete83 »
Running: Zentyal 2.0.23

pete83

  • Zen Apprentice
  • *
  • Posts: 31
  • Karma: +0/-0
    • View Profile
Re: Offline Files with Samba (Windows 7 Prof Clients)
« Reply #8 on: February 23, 2012, 04:05:35 pm »
Offline files doesn't work any more  >:( because of a workaround for another issue:  http://forum.zentyal.org/index.php/topic,9723
Running: Zentyal 2.0.23

sarraceno

  • Zen Apprentice
  • *
  • Posts: 17
  • Karma: +2/-0
    • View Profile
Re: Offline Files with Samba (Windows 7 Prof Clients)
« Reply #9 on: May 30, 2013, 04:17:45 pm »
Disable Roaming Profiles or also redirect folders... probably will come back working