Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

[Samba] Compile Samba for Windows Use - SMBClient.exe mainly

827 views
Skip to first unread message

Allan P. Dynes

unread,
May 12, 2016, 12:10:04 PM5/12/16
to
I have an odd use case where I need to get the Samba Client (SMBClient.exe) compiled for use on a Windows 2012 server to access another Windows 2012 Server through SMB. I have scoured the internet, posted to forums, and even emailed authors that have compiled older version of Samba with no luck. For example Lee Peckham complied just the client and posted it here: https://www.leepa.io/lpackham/smbclient/ but it's v3.0.7 . Ross Smith compiled all of Samba here: https://smithii.com/samba but that's 3.0.23c. I am looking to compile the latest version of either 3.* or 4.* and I have had no luck using CygWin to do so. Not having too much experience with things I may be doing something wrong but I can't get past the configure stage on either 3.* or 4.* nor can I compile just the client by itself which is the only part I need.

Are there any resources anywhere that would help get this done or any suggestions anyone can make? Or is there anyone that has experience in this that is willing to give me instructions? Or does anyone already have newer version of the client compiled? I believe the issue I'm having is the older SMBClient.exe I'm using from the above links has trouble with the new 2012 R2 servers. .I can read from server shares using it and get files but cannot create files (put), they result in 0 byte files instead of what they should be.

-Allan


--
To unsubscribe from this list go to the following URL and read the
instructions: https://lists.samba.org/mailman/options/samba

Andrew Bartlett

unread,
May 13, 2016, 6:40:04 AM5/13/16
to
The best way forward might be to use the new Linux subsystem coming to
windows 2016 ('ubuntu for windows'). I don't expect compiling modern
versions of Samba on windows will be particularly practical,
particularly with the new waf build system.

Andrew Bartlett

--
Andrew Bartlett http://samba.org/~abartlet/
Authentication Developer, Samba Team http://samba.org
Samba Developer, Catalyst IT http://catalyst.net.nz/services/samba

Allan P. Dynes

unread,
May 13, 2016, 2:40:03 PM5/13/16
to
Unfortunately that’s not going to be an option. I'm using a cloud sharing software package called Pydio and it was originally written for *nix platforms. I got it running amazingly well on a 2012 R2 server with IIS 8.5 but there is no built in way to access another server share from the platform other than FTP over SSH or Samba. Again it was written for *nix so those options make sense. However I'm on Server 2012 trying to access another Server 2012.

From reading more about this the WAF build system was implemented for a 4.* series of Samba. Since others I linked to have compiled different version of 3.* it stands to reason I can possible compile 3.6.25 on Windows? Should my question be targeted more twords a Cygwin newsgroup/forum then the Samba group or would someone have experience with building Samba on Windows have any ideas. Again I only need the client, I really don't need to build all of Samba.

Andrew Bartlett

unread,
May 13, 2016, 5:10:04 PM5/13/16
to
On Fri, 2016-05-13 at 18:28 +0000, Allan P. Dynes wrote:
> Unfortunately that’s not going to be an option.

I'm not sure there are many good options then.

> I'm using a cloud sharing software package called Pydio and it was
> originally written for *nix platforms. I got it running amazingly
> well on a 2012 R2 server with IIS 8.5 but there is no built in way to
> access another server share from the platform other than FTP over SSH
> or Samba. Again it was written for *nix so those options make sense.
> However I'm on Server 2012 trying to access another Server 2012.

I'm of course assuming you can't just use the system redirector for
some reason?

> From reading more about this the WAF build system was implemented for
> a 4.* series of Samba. Since others I linked to have compiled
> different version of 3.* it stands to reason I can possible compile
> 3.6.25 on Windows? Should my question be targeted more twords a
> Cygwin newsgroup/forum then the Samba group or would someone have
> experience with building Samba on Windows have any ideas. Again I
> only need the client, I really don't need to build all of Samba.

You are asking in the right place, or samba-technical, but this is
essentially uncharted territory.

I don't know if it would help, but so as not to just leave you at a
dead end, perhaps you might get more luck with jcifs? (but you would
have to build the smbclient replacement)

BTW, out of total curiosity, what happens when you do try and run our
build system on Windows, or on cygwin?

(try running the buildtools/bin/waf directly if the make wrapper is in
the way).

Rowland penny

unread,
May 14, 2016, 4:00:03 AM5/14/16
to
On 13/05/16 19:28, Allan P. Dynes wrote:
> Unfortunately that’s not going to be an option. I'm using a cloud sharing software package called Pydio and it was originally written for *nix platforms. I got it running amazingly well on a 2012 R2 server with IIS 8.5 but there is no built in way to access another server share from the platform other than FTP over SSH or Samba. Again it was written for *nix so those options make sense. However I'm on Server 2012 trying to access another Server 2012.

Have you tried 'putty' ? this provides FTP over SSH

Rowland

Andrew Bartlett

unread,
May 16, 2016, 3:50:02 AM5/16/16
to
On Sat, 2016-05-14 at 16:03 -0600, Jeff Sadowski wrote:
> When I saw this thread the other day I had to try myself just to see
> what would happen. I installed cygwin with all the build tools I'd
> think I needed gcc g++ make autoconfig.
>
> I ran "./configure --without-ad-dc" as it complained when I left out
> that argument.
> the first couple times configure complained about xxx missing and I
> installed xxx then
> configure just aborted after running a while without listing what was
> missing.
> It just said error
>
> I was going to look what packages where recommended to compile samba
> but couldn't find a good page myself.

https://wiki.samba.org/index.php/Operating_system_requirements/Dependen
cies_-_Libraries_and_programs

Jeff Sadowski

unread,
May 16, 2016, 3:50:04 AM5/16/16
to
When I saw this thread the other day I had to try myself just to see what
would happen. I installed cygwin with all the build tools I'd think I
needed gcc g++ make autoconfig.

I ran "./configure --without-ad-dc" as it complained when I left out that
argument.
the first couple times configure complained about xxx missing and I
installed xxx then
configure just aborted after running a while without listing what was
missing.
It just said error

I was going to look what packages where recommended to compile samba but
couldn't find a good page myself.

Allan P. Dynes

unread,
May 16, 2016, 11:30:02 AM5/16/16
to
The couple people that did successfully compile it it seems were on Windows XP. I'm going to start up a 32-bit XP machine virtual machine and install only cygwin and what I believe are the dependencies and see how far I can get. I'm currently out of town so I'll try it either later in the week or next week.



Sent from my Verizon, Samsung Galaxy smartphone


-------- Original message --------
From: Jeff Sadowski <jeff.s...@gmail.com>
Date: 5/16/16 10:52 AM (GMT-05:00)
To: Andrew Bartlett <abar...@samba.org>
Cc: "Allan P. Dynes" <ADy...@WHGardiner.com>, sa...@lists.samba.org
Subject: Re: [Samba] Compile Samba for Windows Use - SMBClient.exe mainly


On Sun, May 15, 2016 at 12:52 AM, Andrew Bartlett <abar...@samba.org<mailto:abar...@samba.org>> wrote:
On Sat, 2016-05-14 at 16:03 -0600, Jeff Sadowski wrote:
> When I saw this thread the other day I had to try myself just to see
> what would happen. I installed cygwin with all the build tools I'd
> think I needed gcc g++ make autoconfig.
>
> I ran "./configure --without-ad-dc" as it complained when I left out
> that argument.
> the first couple times configure complained about xxx missing and I
> installed xxx then
> configure just aborted after running a while without listing what was
> missing.
> It just said error
>
> I was going to look what packages where recommended to compile samba
> but couldn't find a good page myself.

https://wiki.samba.org/index.php/Operating_system_requirements/Dependen
cies_-_Libraries_and_programs

I have most of that installed accept the obvious
Can't install acl, xattr, pam, cups

blkid: I have libblkid1 and libblkid-devel installed
I could not find bsd or setproctitle

I tryed configure as follows
./configure --without-ad-dc --without-pam > configure-2016-05-16.log 2>&1

and attached the configure-2016-05-16.log file nothing really jumps out at me why it is failing.

Checking for openpty : ok
Checking for header linux/sockios.h : no
Checking for header linux/ethtool.h : no
Checking linker accepts -Wl,-no-undefined : yes
Checking linker accepts ['-undefined', 'dynamic_lookup'] : no
Checking linker accepts -Wl,--as-needed : yes
Checking for -lc not needed : ok
Checking configure summary : not found
configure summary failed

Or is that how it is suppose to end?

Jeremy Allison

unread,
May 16, 2016, 12:40:03 PM5/16/16
to
On Mon, May 16, 2016 at 03:20:26PM +0000, Allan P. Dynes wrote:
> The couple people that did successfully compile it it seems were on Windows XP. I'm going to start up a 32-bit XP machine virtual machine and install only cygwin and what I believe are the dependencies and see how far I can get. I'm currently out of town so I'll try it either later in the week or next week.

As Windows provides binary compatibility you
might just be able to get a 32-bit WindowsXP
binary to run on the Windows server you're
targetting.

Allan P. Dynes

unread,
May 16, 2016, 5:40:02 PM5/16/16
to
That's what I'm hoping for since I've been unable to compile on Windows 7 x64. I am getting the same errors as Jeff, just a general compiler summary error with no real indication of what caused the issue. I may also try compiling the older version using the makefile and patch Ross did at https://smithii.com/samba on XP first to make sure I can at least recreate the wheel and then move up to higher versions from there. If I can't reproduce something someone already did then there is little chance I can compile a new one anyway and I'll have to look further into either tricking the Pydio software to remotely access a share or writing my own plugin to do it for me, both things I don't know if I'm capable of but I'm willing to try.

-----Original Message-----
From: Jeremy Allison [mailto:j...@samba.org]
Sent: Monday, May 16, 2016 12:34 PM
To: Allan P. Dynes
Cc: Jeff Sadowski; Andrew Bartlett; sa...@lists.samba.org
Subject: Re: [Samba] Compile Samba for Windows Use - SMBClient.exe mainly

Chris Weiss

unread,
May 16, 2016, 6:40:04 PM5/16/16
to
does Pydio not accept UNC paths in place of a local path? this has worked
for me in other php things, as long as IIS is running under an account with
network share permissions.



On Mon, May 16, 2016 at 4:39 PM Allan P. Dynes <ADy...@whgardiner.com>
wrote:

Allan P. Dynes

unread,
May 16, 2016, 8:50:02 PM5/16/16
to
The user for the site, and conversely php, is running as a application pool in IIS specifically for the site and as such only exists on that box. The nice thing about using the samba client, if I can get it to work, is you can pass through the user credentials of the logged-in user. So security-wise it's a lot easier to maintain as users would have access to the same things they already do on the remote file server. If they didn't have access before then they still wont.


Sent from my Verizon, Samsung Galaxy smartphone


-------- Original message --------
From: Chris Weiss <cwe...@gmail.com>
Date: 5/16/16 6:04 PM (GMT-05:00)
To: "Allan P. Dynes" <ADy...@WHGardiner.com>
Cc: sa...@lists.samba.org
Subject: Re: [Samba] Compile Samba for Windows Use - SMBClient.exe mainly

does Pydio not accept UNC paths in place of a local path? this has worked for me in other php things, as long as IIS is running under an account with network share permissions.



Allan P. Dynes

unread,
May 23, 2016, 3:10:03 PM5/23/16
to
I just wanted to give everyone a update. I was able to compile the smbclient.exe file successfully using Samba 3.6.25. Compiling the entire suite fails but all I was after was the client. I referenced back to an old post here https://lists.samba.org/archive/samba-technical/2007-September/055557.html that had instructions on compiling on Windows. Used it as a rough guide. Long story short:

Installed Windows XP SP3 32-bit on a virtual machine (VirtualBox)
Installed CygWin 32-bit with the Devel files
Extracted Samba 3.6.25
Went into the Source3 directory
Ran (per the post from 2007):

./configure --prefix=/usr/local/samba
make pch
make

The make failed trying to create the net.exe file:

utils/net.o:net.c:(.text+0x10e1): undefined reference to `libintl_setlocale'
collect2: error: ld returned 1 exit status
Makefile:1816: recipe for target 'bin/net.exe' failed
make: *** [bin/net.exe] Error 1

But it had previously in its routine already built the SMBClient.exe file that I needed. I then tested it within Pydio and sure enough the issues I was having with the older SMBClient (3.0.23 and 3.0.7) and gone....I can successfully write a file to a new Server 2012 R2 file share with the newly compiled client that I couldn't with the older ones. I also verified the version was updated:

C:\temp>smbclient -V
Version 3.6.25

I'm sure no one will ever care about this knowledge or the file but it fixed my issue and now Pydio is "complete" as a cloud file sharing solution for me.

-Allan

Allan P. Dynes

unread,
May 24, 2016, 1:40:03 PM5/24/16
to
One last update. The issue was with Cygwin 64-bit, I was able to compile 3.6.25, well at least the smbclient, on my Windows 7 Pro x64 machine using Cygwin 32-bit using the standard ./configure then make pch then make just like I was able to using Windows XP. Same issue, it fails at net.exe, but by then it already created the smbclient.exe which is all I needed.

I could not get any part of Samba 4 to compile using Cygwin. Configure fails with no descriptive error message as Jeff confirmed. But 3.6.25 seems fine for my use.

-Allan
0 new messages