Simple SAMBA on Solaris 10

Having built a simple NFS file server off of a SUN SunFire V100 server with Solaris 10 Update 4 (8/7) my next task is to share the same directory via Microsoft’s CIFS (aka Server Message Block or SMB) protocol. In order to do this we will need the open source software package SAMBA. This is a very simple how-to and does not begin to cover the complexities of configuring SAMBA beyond a minimal single share configuration. SAMBA is an extremely powerful package with many features including, in the latest version from SUN in Update 4, the ability to integrate with Microsoft’s Active Directory or AD.

We will begin by installing the SUN SAMBA packages which are available on the Solaris 10 8/7 CD #2. These are installed by default with many of the installation options but are not installed with the “Core” option which is what I normally use to build Solaris servers. So we have to do the install separately. If you have the second installation CD inserted into the drive and mounted, as I do, as /mnt/cdrom then the following command should work for you exactly – just copy and paste. If your CDROM device is mounted elsewhere the you will need to change the command accordingly.

# pkgadd -d /mnt/cdrom/Solaris_10/Product/ *smb* SUNWlibpopt

This command installs the SUNWsmbac, SUNWsmbar, SUNWsmbau and SUNWlibpopt packages. If you install the three SAMBA and WINS packages without installing SUNWlibpopt you can expect to get this error in your /var/svc/log/network-samba:default.log:

Executing start method ("/usr/sfw/sbin/smbd -D") ] smbd: fatal: open failed: No such file or directory

You can check the version of SAMBA that has been installed easily using the smbd -V command. Solaris 10 Update 4 includes the SAMBA 3.0.25a package.

# /usr/sfw/sbin/smbd -V
Version 3.0.25a

Once you have the correct packages all installed you can proceed to configure your SAMBA service. Do not get ahead of yourself and attempt to enable them at this stage as the /etc/sfw/smb.conf file is missing and you will get an error until it exists. We will need to create this file now and enter a basic configuration. Here is the configuration that I created:

workgroup = DEMO-SMBFS
server string = Sol10u4 CIFS Server
log file = /var/adm/samba_log.%m
security = SHARE
comment = backupdata
path = /data
force user = samiller
force group = other
read only = No
guest ok = Yes

Once you have entered your configuration parameters into the smb.conf file you may want to test them using the testparm program included with SAMBA to be sure that the syntax of the file is correct. This program will automatically check to see that the file is in the correct location and that it appears to be a valid configuration file. This quick check is highly recommended.

# /usr/sfw/bin/testparm

As long as your configuration file has passed its check we can continue on our way and enable our SAMBA and WINS services. First reboot your server. I am sure that there is a simpler way to make these services available to us but rebooting is always easy and clean. When your server has restarted you can enable your services. The svcadm command should run silently. In order to check that the services have started correctly you will need to verify them with the svcs command.

# svcadm enable samba wins
# svcs samba wins

If both of your samba related services, samba and wins, return as “online” then you are up and running. If they fail to start you can gain additional information about them by using the -xv option to the svcs command.

# svcs -xv samba wins

At this point your CIFS/SMB file server should be functioning. If you want to attempt to access it from a Windows computer you can using the CIFS syntax such as \\samba_server_hostname\backupdata\.

Join the Conversation


  1. Hi, Just like to tell you that this piece of info is one quick to the point, no nonsense, workable and effective way to have directories shared in Linux as fast as possible. It worked for me and thank you for the effort. Keep up the good work.

  2. I have installed Samba version 3.4.2 on a Solaris 10 Sun-Fire 480R. I did everything from creating the smb.conf to perform ing to smf commands. I can’t get samba out of the maintenance state. Any ideas?

Leave a comment