Donate Bitcoins

Running Samba 3.0.23c Under Windows

Using this makefile, and this patch, I successfully compiled Samba under Windows.

Here are the steps to run Samba 3.0.23c under Windows XP Pro SP2. This should also work (but I haven't tested) for any version of Windows, including Windows XP Home, 2000, or 2003:

Samba 3.0.23 on Windows
Ross Smith

Please note in order to get Samba to compile under Cygwin, I had
to remove a build check that reports:

ERROR: No locking available. Running Samba would be unsafe

So please do not assume Samba will actually work under Windows.
Assume it won't.

Instructions to remove Samba are at the end of this file.

To install Samba 3.0.23 in Windows, perform the following steps:

1. Download


2. Unzip to "C:\Progra~1". For example:

   unzip -o -d "C:\Progra~1"

3. Add the following to your system path:


4. Open a Command Prompt window:

   Start / Run / CMD [Enter]

5. Change to the samba directory:

   cd /d C:\Progra~1\samba

6. If Cygwin is installed, skip to step 7. Otherwise, run:

   Go to step 9.
7. If c:\cygwin\bin is in your path, you will need to delete the
   Cygwin dll files in C:\Progra~1\samba\bin, by typing:
   del bin\cyg*.dll
8  Run cygsetup.cmd:


9. Reboot computer:

   shutdown -r -t 0 -c "Let's samba!"

   After rebooting...

10. Open a Command Prompt window:

    Start / Run / CMD [Enter]

11. Run daemons:

    cd /d C:\Progra~1\samba

12. Test Samba locally:

    smbclient -L localhost -U guest%password
    You should see: 
Domain=[hostname] OS=[Unix] Server=[Samba 3.0.23]

        Sharename       Type      Comment
        ---------       ----      -------
        tmp             Disk      /cygdrive/c/windows/temp
        IPC$            IPC       IPC Service (Samba Server)
        Guest           Disk      Home Directories
Domain=[hostname] OS=[Unix] Server=[Samba 3.0.23]

        Server               Comment
        ---------            -------

        Workgroup            Master
        ---------            -------

13. Test Samba from another Windows computer:

    net use * \\\tmp /user:guest password
    Substitute your hostname or ip address for
    You should see:

Drive Z: is now connected to \\\tmp.

14. Change the default passwords:

    smbpasswd guest
    smbpasswd administrator

15. If you add or remove users, you should run the mkpasswds.cmd command:

    cd /d C:\Progra~1\samba

To remove Samba, do the following:

1. Kill the smbd and nmbd processes (by rebooting if you want)

2. Remove the following from your system PATH:

3. Open a Command Prompt window:

   Start / Run / CMD [Enter]

4. Change to the samba directory:

   cd /d C:\Progra~1\samba

5. Run the following:

   regedit /s enablenetbios.reg
   cd ..
   rmdir /s /q samba

   shutdown -r -t 0 -c "No more samba :("

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

Try the NET LOGON command mentions the

net logon

command, so try this:

net logon user password
net use Z: \\host\share


My guess is that one could approach native Windows performance, by hacking the samba code to use native Windows API calls, instead of the emulated *nix functions.

Also, you could do the same with the missing "locking" code, so this could be used in a production environment.

I'm happy to help if I can, but I can't take on any new clients at this time, but thank you for the request. Perhaps in the future.

I *had* to hard code something

as Samba requires it. Perhaps you can change the short file name of your %ProgramFiles% by using SetSFN. Please let me know if that works for you or not.

Why don't you just create a directory named c:\Progra~1


mkdir c:\Progra~1

Then unzip into this folder, so you end up with a directory named:



Try netstat

Type this:

netstat -an

and see if anything is listening locally on ports 445 and 139.

If not, then the installation was not successful.

Do you have any sort of firewall running?



1. Good question. Never tried. Did you try to use the "net use" command?

2.1 You can safely delete.

2.2. For this port, yes. Those drives are hard coded in the samba binaries, as I couldn't figure out how to specify relative directories.

3. You could try using Cygwin's kill command to send a signal to those processes. See the Samba documentation for details.

4. Yes, I'm sure that's possible, but I would try Cygwin's cygrunsrv first, as it works well with other ported *nix daemon's, such as cron, exim, inet-d, rsync, ssh, etc.

Good luck, and please report back on your progress.

Tested and works for me under XP SP2

Re your post:

1: I couldn't get net use to work either. If you figure out how, please let me know.

1.2: I could start up the Workstation and Server services, but net use still didn't work.

1.3: That's certainly a possibility. I'm not sure why you want to do this though. Can't you just run subst to achieve the same effect?

2.2: Done.

3 and 4: Again, certainly doable.

5: The zip file contains the required Cygwin files, so you don't need to have Cygwin installed, as before.

Good luck!

Not sure if this will help you....

1. No. That was just an example, to point out that the file downloads fine.

2. OpenLDAP is only needed if you want that functionality. Samba doesn't require LDAP.

3. No. Not sure why you are doing this. Instead, add the bin directory to your PATH.

4. contains z_samba/files/ramdrv/samba/smb.conf, which has already been configured to work with Windows.

5. Not all programs may work. If something doesn't work, try the Windows equivalent, and see if it works.

6. Need specfic details, sorry.

7. I have successfully used Windows Explorer to "see" a share served by Samba running under Windows.

8. From within the Cygwin setup program.

Are you installing Samba under BartPE, or Windows? Which version of Windows, specifically? If BartPE, it should work out of the box. If not, please include a detailed error report, including the output of the B:\cygwin\var\log\smbd.log files (I think that's what they are named).

If Windows, then please follow the instructions at and include a detailed error report if you have any issues.

Good luck,

Installing Cygwin is required


You need to actually install Cygwin on the box you are creating your BartPE disk on. Then, follow the instructions in each of the .html files that accompanies each plugin. This is true of all BartPE plugins.

If you are installing Samba in BartPE, then the instructions at do not apply.

Good luck,


Please post your results


I can't answer your questions as I haven't used Samba in the way you are attempting to use it.

If you are able to use it as a domain controller, please post your results here. I, and others, would appreciate it.

Good luck,


Works for me, with Firefox, and wget

Not sure what the problem is, as it's working fine for me:

$ wget -S
           => `'
Connecting to||:80... connected.
HTTP request sent, awaiting response...
  HTTP/1.1 200 OK
  Date: Sat, 11 Feb 2006 00:14:44 GMT
  Server: Apache
  Last-Modified: Wed, 13 Jul 2005 03:44:40 GMT
  ETag: "6e0349-6deac0-42d48e28"
  Accept-Ranges: bytes
  Content-Length: 7203520
  Keep-Alive: timeout=15, max=100
  Connection: Keep-Alive
  Content-Type: application/zip
Length: 7,203,520 (6.9M) [application/zip]

100%[====================================>] 7,203,520    683.95K/s    ETA 00:00

16:14:53 (655.44 KB/s) - `' saved [7203520/7203520]

Fixed, sorry for the inconvenience

My new 'one click' compile/sign/publish script had rsync changing the permissions. I've fixed the script so this shouldn't happen. Sorry for the inconvenience.

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
Donate Bitcoins
Special thanks to Riester Rente Online for a generous donation!