DeutschEspañolFrançaisItalianoNederlandsPortuguêsΕλληνικάРусскийالعربية中文(简体)中文(繁體)日本語한국어
 
Donate Bitcoins
Google
 
www smithii.com
 

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
11/07/2006 

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 samba-3.0.23c-ross.zip:

   wget http://smithii.com/files/samba-3.0.23c-ross.zip

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

   unzip -o -d "C:\Progra~1" samba-3.0.23c-ross.zip

3. Add the following to your system path:

   C:\Progra~1\samba\bin;C:\Progra~1\samba\sbin

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:
   
   smbsetup.cmd

   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:

   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
    start_daemons.cmd

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 * \\1.2.3.4\tmp /user:guest password
    
    Substitute your hostname or ip address for 1.2.3.4.
    You should see:

Drive Z: is now connected to \\1.2.3.4\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
    mkpasswds.cmd

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:
   C:\Progra~1\samba\bin;C:\Progra~1\samba\sbin

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:

   netstart.cmd
   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

http://www.computerhope.com/nethlp.htm mentions the

net logon

command, so try this:

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

anelka9,

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

via:

mkdir c:\Progra~1

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

c:\Progra~1\samba

?

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?

-Ross

Reply

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. z_samba.zip 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 http://smithii.com/?q=node/view/36 and include a detailed error report if you have any issues.

Good luck,
Ross

Installing Cygwin is required

swatfa,

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 http://smithii.com/?q=node/view/36 do not apply.

Good luck,

Ross

Please post your results

swatfa,

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,

Ross

Works for me, with Firefox, and wget

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

$ wget -S http://www.smithii.com/files/plugins/z_samba.zip
--16:14:42--  http://www.smithii.com/files/plugins/z_samba.zip
           => `z_samba.zip'
Resolving www.smithii.com... 216.22.8.123
Connecting to www.smithii.com|216.22.8.123|: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) - `z_samba.zip' 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.
DeutschEspañolFrançaisItalianoNederlandsPortuguêsΕλληνικάРусскийالعربية中文(简体)中文(繁體)日本語한국어
 
Donate Bitcoins
Google
 
www smithii.com
 
Special thanks to Riester Rente Online for a generous donation!