Posts tagged with 'linux'

Access to Windows shares from Linux

I've spent a few hours recently investigating Mono for work. The intent is so that we (all right, I) can talk intelligently about what it would take to get DevExpress' controls working with Mono, rather than just say, no dunna work, or something equally as illiterate and uninformative. To make this easy for the likes of me, the Mono team have set up a virtual machine (VM) running SUSE Linux and containing a complete Mono install. Piece of cake you might say, and so it is. It was the matter of a few minutes to download the VM and to run it in VMware Workstation.

No problem, at least until the point when I tried to access some shared Windows folders from Linux. No matter what I tried nothing would work. And this is from a guest Linux OS to the host Windows 7 OS, which you'd imagine would be something really simple. It took me a good 3 hours or so over a couple of days to get it to work. Here's what I did.

Part of the problem, it seems, is LAN Manager from Windows 7. Every time I'd try and mount the share from Linux, this server would give up and post an error to the event log:

The server was unable to allocate from the system nonpaged pool because the server reached the configured limit for nonpaged pool allocations.

Yeah, that makes a lot of sense on a machine with 8GB of RAM. Plus, there's no hint on how to, you know, increase this configured limit. Back to this later.

Event in event viewer

On the Linux side, I started off using the GNOME UI from the desktop to connect to the Windows shares. I'd see the icon for Windows Network, double-click and see the workgroup I use at home. Double click on this, and I'll see the computers. Double click on that and nothing, zip, nada, zilch. No list of shares.

OK, it was time for some command line stuff. First I started up a terminal, and then switched to superuser:

su

I then had to type the password, of course. I did some searching  and found the command online to list the shares using the smbclient tool.

smbclient -L //nameofwindowspc

Nothing. More searching and I found a hint that I had to create a user on my Windows machine that matched my Linux login. Did that, and finally was able to get a list of shares from the tool (still nothing from the UI, by the way).

Onto the next command, to mount a share (I'd flipped over to Windows, and made sure I added my linux user to the share).

mount -t cifs -o username=xxx,password=yyy //nameofwindowspc/nameofshare ./windows

The xxx/yyy stuff is obviously my login details for Linux. The final parameter there is a mount point: you must create this directory first (and the way I ran things is that the superuser was logged into my user's home directory, so this mount point was in that same home directory). Failure: the mount failed with an out-of-memory error (error 12).

Ah ha! The same error — in a very hand-wavy way — as on the Windows side. Time for more searching.

image I found another hint: Windows 7 (and Vista for that matter) comes with an SMB2 server. Apparently this is the problem, and you must stop it from running. Time for regedit: create a new DWORD value called SMB2 in HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\LanmanServer\Parameters, and set it to 0 (the default). This will turn off the SMB2 server and run the SMB1 server instead. Reboot.

After I did this, the mount command worked successfully. I was able to access the files and folders in the share by navigating to the mount point, even on the GNOME desktop (although the desktop seems to think the share is a "Picture CD" for some reason).

And, then, it was back to investigating Mono: the share had a bunch of ASP.NET applications in it and I was able to start "playing" around.

Now playing:
Duran Duran - UMF
(from Duran Duran [The Wedding Album])


Extras

Search

About Me

I'm Julian M Bucknall, the M because it's my middle initial and because I and the other Julian Bucknall (the movie guy) would like to differentiate ourselves.

I'm a programmer by trade, an actor by ambition, and an algorithms guy by osmosis. I write articles for PCPlus in my spare time, not that there's much of that.

Julian M Bucknall Apart from that, an ex-pat Brit, atheist, microbrew enthusiast, Pet Shop Boys fanboy, slide rule and HP calculator collector, amateur photographer, Altoids muncher.

DevExpress

I'm Chief Technology Officer at Developer Express, a software company that writes some great controls and tools for .NET and Delphi. I'm responsible for the technology oversight and vision of the company.

Validation

Validate markup as HTML5 (beta)     Validate CSS

Bottom swirl

Archives

May 2012 (4)
SMTWTFS
« Apr  
12345
6789101112
13141516171819
20212223242526
2728293031

Like this Archive Calendar widget? Download it here.

Social networking

The OUT Campaign

The OUT Campaign

My Tweets

  • Honest Movie Trailer of Phantom Menace http://t.co/sif8y4Ns and then Battleship, er, Transformers http://t.co/sif8y4Ns
  • Damn, Donna Summer and Chuck Brown both gone in the last 24 hours. Different types of music, sure, but enjoyed them both. :(
  • Just saw a company page showing a list of tweets with "Join the conversation" linked to their Twitter a/c. The tweets are 6 months old #fail
Bottom swirl