Publishers of technology books, eBooks, and videos for creative people

Home > Articles > Apple > Operating Systems

  • Print
  • + Share This
This chapter is from the book

Using Windows File Service

Mac OS X Server permits you to share files over the SMB protocol. Sometimes referred to as CIFS, this is the primary protocol used by Windows clients to access files on a remote file server. It has some differences from AFP that you will explore. Understanding the fine differences between the two will lead to better integration when sharing folders.

Windows Share Points

As shown in the following figure, when you use Server Admin to configure a share point for use with Windows service (SMB), you can specify:

  • Whether or not to make this share point available over SMB
  • Whether or not to allow guest access to this share point
  • How the SMB service handles file locking
  • How the SMB service assigns permissions for newly created files and folders

SMB File Locking

File locking prevents multiple clients from writing changes to a file simultaneously. The choices you make for file locking depend on what kinds of file-sharing clients you have, and which protocols you use to your share points. In order to make an appropriate decision, you need to understand the significance of oplocks and strict locking:

  • Oplocks are opportunistic locks, a client-side performance enhancement that requires cooperation between a Windows client and the SMB service. If SMB service supports oplocks, the client can request to cache a file locally, in order to perform read and write operations on the cached file rather than directly on the server. This saves network bandwidth and increases performance for the SMB client. If another SMB client requests access to the file, the SMB service notifies the holder of the oplock, and that client should write changes from its cache back to the SMB service. The SMB service does not let another client have access to the file until the first client has finished writing.
  • Strict locking requires the SMB client to request a lock for an entire file, as opposed to only a portion of the file. Without strict locking, two SMB clients can simultaneously edit different portions of the same file, which is a nice feature for certain environments and workflows, but could cause data loss if any other file-sharing protocol is involved. Strict locking causes the SMB service to check for an existing file lock with every read and write request.

What does this mean for you? If your server shares a share point via the SMB protocol only, and you have “well-behaved” SMB clients (which check for file locks appropriately), then for better SMB performance, you may want to enable oplocks and disable strict locking.

However, if you share a share point via SMB and any other file-sharing protocol, then to prevent data corruption, you should probably disable oplocks and enable strict locking.

Default Permissions for New Files and Folders

Recall from the section “Understanding POSIX Permissions with AFP Share Points” that the operating system assigns to new files read and write permissions for the owner, but read only for the group and others. One nice feature of the SMB service is that, for each share point, you have the choice of the following two methods of assigning privileges to newly creates files and folders:

  • Inherit permissions from parent: This option means that the new item will have the same permissions as the folder that contains that item.
  • Assign as follows: The default choice is read and write for the owner, but read only for the group and Others. However, you can use the pop-up menus to specify “Read & Write,” “Read Only,” “Write Only,” or “No Access” for the owner, for the group, and for Others. If you specify “Read & Write” for the group, you can enable all the members of a group to edit files without first changing permissions.

Server Name and Workgroup

The Windows service has a number of configuration options available in Server Admin. Just as Mac computers can browse for servers using Bonjour, Windows clients have their own way to find servers on the network, based on a protocol called Network Basic Input/Output System (NetBIOS). The Computer Name field in the General pane of the Settings pane defines the server’s NetBIOS name. It is set automatically, but it is always best to make sure your server’s Windows NetBIOS name matches the host name and the DNS name for your computers. That way, there is no chance for a client computer to get conflicting information if it tries to get the server name using different protocols.

Workgroups are another feature of NetBIOS. The workgroup name is an arbitrary text string used to group servers together. You often see descriptive workgroups, such as MARKETING, RESEARCH, and so on. Your server’s Windows service will join whatever workgroup you specify. If you type the name of a workgroup that doesn’t exist on your network, your server creates its own workgroup, and Windows computers will see that group.

This is also the location where you choose the role of your Windows service on the server. A standalone server provides file service, but does not provide any Windows authentication services. Configuring the server as a domain member will provide file service by authenticating the user against an external domain controller. You can configure an Open Directory master to take the role of a primary domain controller (PDC); you can configure an Open Directory replica as a backup domain controller (BDC). If your server is a domain controller, not only can you provide file service, but Windows clients can also authenticate directly against your server.

Advanced Windows Services

The Advanced pane of the Settings pane lets you set other Windows configuration options:

  • The Code Page pop-up menu refers to the character set supported by Windows service on this server. The default setting (Latin US) is correct for U.S. English. Other language settings can be chosen from the list.
  • The Workgroup Master Browser option means your server can become a local master browser. It doesn’t mean the server necessarily will be the local master browser, just that it will participate in the election process to determine who will serve as the local master browser.
  • The Domain Master Browser option is similar to the Workgroup Master Browser option, but selecting its checkbox will now result in a possible election between your domain master browser and the Windows domain master browser.

    Browsing is a key element of a Windows network. Users can find shared resources on the network by using Network Neighborhood, a Windows utility. A Windows network maintains a list of all the computers connected to it by using central repositories known as workgroup master browsers (or simply master browsers) and domain master browsers.

    How do you know whether to select the browser options? You should consult with your Windows administrator. Generally speaking, if you are in a workgroup with a Windows server acting as a domain controller, you should not make Mac OS X Server the domain master browser. In that case, the Windows server is the domain master browser, and adding another domain master browser will result in an election process that the Windows administrator may not want to happen. When computers capable of acting as master browsers come online, they automatically elect a computer to be the master browser for a given network. Some Windows administrators may not feel comfortable with a non-Windows computer acting in such a role.

  • Windows Internet Name Service (WINS) is Microsoft’s implementation of NetBIOS Name Service (NBNS). WINS resolves NetBIOS names to IP addresses. You can distribute this information using the DHCP service in Mac OS X Server.

    How do you know if WINS needs to be configured? Again, you should consult the administrator who is responsible for your Windows computers. Selecting “Enable WINS server” makes your Mac OS X Server a WINS server. Selecting “Register with WINS server” allows you to become the client of an existing WINS server by specifying its IP address or name.

  • Finally, if you want to host home folders for Windows users on your Mac OS X Server, make sure that the “Enable virtual share points” option is selected.

Browsing from a Windows Client

Once you configure your name, your workgroup, and—if necessary—the Advanced settings, Mac OS X Server can be browsed just like any other Windows server on the network. The following figure depicts Mac OS X Server showing up on a small network with no WINS service. A Windows server is creating the Example workgroup, and Mac OS X Server is creating the workgroup named Workgroup.

From a Windows computer, once you have chosen the Mac OS X Server as a share point, the Windows service in Mac OS X Server provides support for authentication via the protocols LAN Manager, NT LAN Manager (NTLM), and NTLMv2 and Kerberos (the last two being one option simultaneously).

SMB Activity Monitoring

Windows service logs are configurable in Server Admin; however, configuration is not quite as flexible as with AFP. Server Admin lets you configure three levels of detail—low, medium, or high—but you can choose a much more verbose level of logging by editing the SMB configuration file directly. Unless you are debugging a particular problem with Windows file sharing, you’ll probably want to choose Medium from the Log Detail pop-up menu in the Logging pane. The lower the Log Detail setting, the better you preserve the server’s resources.

As with the AFP service, Server Admin contains an easy-to-use graph feature that will show how many users are connected for any period of time. To access the SMB graphs, do the following:

  1. Open Server Admin and connect to your server.
  2. Select the SMB service on the left side of the window.
  3. Click the Graphs button in the toolbar.
  4. Change the time period, if desired, using the menu at the bottom of the window.

This exercise demonstrates some of the more useful features of Windows file service on Mac OS X Server. After creating a Windows share point, you will explore the Windows browsing features and browse to your Windows services using the Connect to Server command in Mac OS X.

  • + Share This
  • 🔖 Save To Your Account