PDA

View Full Version : SMB/CIFS share support


Moonshine
11-16-2007, 01:18 PM
I have to say, this was a feature I was really looking forward to in OS2008. Here was a chance to finally get rid of my cifs.ka/SMBbrowser/File Manager setup and have something native in File Manager itself. However, without simple username/password support for shares it all but worthless for me. :(

Maybe (hopefully) this is still a work in progress, but I'm still a little amazed that the feature would be added without any authentication support. Does everyone really keep their shares wide open? :eek:

technut
11-16-2007, 02:39 PM
Linux noob here, sorry. But now that the SMB capability is included, can you at least mount them from the Terminal (with authentication), without having to load more software?

File Manager connections aren't 100% solid yet anyway. My shares are open but I'm finding the connection to them is sporadic. Last night I could connect to 3 out of 4 shares, but this morning only 1 of them is connecting, even after a reboot of OS2008. The others show in File Manager but report "(no files/folders)".

jhoff80
11-16-2007, 02:56 PM
I'm pretty sure its not Samba support but its uPnP support, so you can only access media sharing.

Moonshine
11-16-2007, 03:01 PM
Well I gave that a try with the normal "mount -t cifs //server/share mountpoint -o domain=mydomain,user=myuser,password=mypass" and it didn't work. It doesn't look like they are using a cifs kernel module. I'm still digging around to see if there are any SMB/CIFS tools installed with OS2008.

Moonshine
11-16-2007, 03:07 PM
I'm pretty sure its not Samba support but its uPnP support, so you can only access media sharing.

Filemanager actually supports both, but just won't do any authentication for SMB/CIFS/Samba shares. The "help" in OS2008 states:

Shared Folders

File manager also displays the shared content of available folders that have Server Message Block (SMB) support. They are located in the file tree under shared folders. This root folder is visible when there is a network connection and there are shared directories on the network. You cannot delete, move, copy or rename the shared folders root folder or copy files or folders directly under it. You cannot access password protected shared folders.

It's the last sentence that kills me.. :confused:

Moonshine
11-16-2007, 08:31 PM
FWIW, the CIFS kernel modules for OS2007 don't load under OS2008. Looks like they will need to be re-compiled before there is any SMB/CIFS support with authentication.

gemniii42
11-25-2007, 12:17 PM
Filemanager actually supports both, but just won't do any authentication for SMB/CIFS/Samba shares. The "help" in OS2008 states:



It's the last sentence that kills me.. :confused:
Yesterday, while I was responding to another post I looked on my 810 file manager and the "shared folder" showed up. I was able to browse Samba shares on my Linux machine and read .txt files with "note", but could only see shared folders on my Windows machines. Shared media was also there.
I powered down th 810 and powered up,now I can only see Shared media, not Shared folders.
Any idea what happened?

technut
11-25-2007, 03:39 PM
File Manager connections aren't 100% solid yet anyway. My shares are open but I'm finding the connection to them is sporadic. Last night I could connect to 3 out of 4 shares, but this morning only 1 of them is connecting, even after a reboot of OS2008. The others show in File Manager but report "(no files/folders)".Quoting myself... I had the same kind of experience. It seems pretty flakey.

RipTorn
11-29-2007, 12:15 PM
This was a feature I was looking foward to the most in OS2008, I have a heap of movies I share around the house with Samba for me and my 6 year old and was hoping to be able to sit anywhere in the house with all my music/movies/generic media with the samba share.

Hopefully this gets fixed, I was able to view a non-password samba for about 5 min, but couldn't copy any files and the default media player has crap .avi support, soon as I tried again later the 'shared' folder vanished and I haven't seen it since...

Plus the 'busybox' mount program sh*ts me to tears sometimes with its useless error messages... 'faied to mount'

thats my vent for the night! :)


-Rip

fanoush
11-29-2007, 12:29 PM
FWIW, the CIFS kernel modules for OS2007 don't load under OS2008. Looks like they will need to be re-compiled before there is any SMB/CIFS support with authentication.
You can find fs/cifs/cifs.ko inside http://fanoush.wz.cz/maemo/modules-rx-34-2.6.21.0.tar.gz

RipTorn
11-29-2007, 01:13 PM
cheers! thanks works great, I can mount my samba share via command line now, but for the life of me I can't work out how to allow 'user' access the mounted filesystem... is there a command line command to allow regular users read the filesystem ?

qole
12-21-2007, 02:24 AM
I had cifs working under OS2007, and I swear I had it working under OS2008 yesterday, but now it doesn't work. Filemanager's implementation of CIFS is, as stated above, useless for passworded shares. So I grabbed fanoush's cifs.ko and did insmod with it, but no luck.

my mounting syntax:

mount -t cifs //192.168.0.9/myshare /home/user/MyDocs/lan/myshare -o user=SERVERNAME\\User,password=password1

I just get a cryptic "mounting //192.168.0.9/myshare on /home/user/MyDocs/lan/myshare failed."

What's going on? The share and the mountpoint both exist (file manager can even see the share). Like I said, it worked before... Did I break something? Could it have something to do with using USB in host mode? Argh!

lorelei
12-21-2007, 05:30 AM
cheers! thanks works great, I can mount my samba share via command line now, but for the life of me I can't work out how to allow 'user' access the mounted filesystem... is there a command line command to allow regular users read the filesystem ?

I don't have the possibility to check, but I think that you can add the following option to make it readable by the user "user":

-ouid=user

Anyways...I agree that it is rather limiting not being able to put username/password in the filemamanger to access SMB shares...it makes it kinda useless :(

krbvroc1
12-21-2007, 01:47 PM
I just solved my own issue with cifs causing a
mount failed. Maybe it will help others. My server share does NOT have a password.

Rather than my old method of passing user=pcguest to the mount command, I passed the option guest instead which worked!


This failed:
mount -t cifs //192.168.2.100/podcast /media/mmc2/mnt -o noperm,sec=none,uid=user,user=guest

This worked:
mount -t cifs //192.168.2.100/podcast /media/mmc2/mnt -o noperm,sec=none,uid=user,guest

Stevie P
12-30-2007, 10:38 AM
Plus the 'busybox' mount program sh*ts me to tears sometimes with its useless error messages... 'faied to mount'

-Rip

Note that although mount doesn't print anything useful to the terminal, it does log a bit more useful diagnostic information that can be retrieved with dmesg. Not particularly friendly, but better than nothing.

qole
01-06-2008, 06:25 PM
Note that although mount doesn't print anything useful to the terminal, it does log a bit more useful diagnostic information that can be retrieved with dmesg. Not particularly friendly, but better than nothing.

I checked dmesg after trying to mount a known-working share and having it fail with the mysterious "mount: mounting ... on ... failed" error. There was nothing at all. No new messages. Argh... :mad:

qole
01-06-2008, 07:51 PM
OK. I'm down on my knees. Begging.

Please, someone compile/package smbfs (and/or smbclient and/or samba) for OS2008! I want some more useful samba tools. I found "mount.cifs" to be extremely helpful in tracking down problems, because I could set a verbosity level that would control the error messages. The samba tools that come included in OS2008 are worse than useless. They're very nearly useless but they're useful enough for many people so they stop progress of really useful tools.

qole
01-09-2008, 07:52 PM
I notice that the source for the entire samba package for maemo 4.0 is in the source repository (http://repository.maemo.org/pool/maemo4.0/free/source/s/samba/). Can anyone compile it for me (us) and put it in a repository? Please?

I especially want tools like mount.cifs, smbfs and/or smbclient to help me debug my problems mounting samba shares.

didjit86
01-10-2008, 09:04 PM
smbclient/smbmnt and smbfs are here. http://www.gronmayer.com/it/index.php?lang=en&system=maemo4&sort=hits&show_pck=121#121

But I installed and still cannot mount my linux shares. I can see them, with smbtree. Let me know if you have better luck then I.

Didjnit

qole
01-12-2008, 02:05 AM
Didjnit:

Don't play such cruel tricks on a fella! You got my hopes up, only to have them dashed by the sharp stones of reality.

The repo that contains the samba packages is the Maemo Hackers repo for the "mistral" OS, which really shouldn't be listed as an OS2008 repo, but there are a few command-line programs that still work in OS2008 so someone stuck it in. When I try to apt-get install smbfs, I get:

The following packages have unmet dependencies:
smbfs: Depends: samba-common (= 3.0.22-3) but 3.0.23c-1osso6 is to be installed

Moonshine
01-12-2008, 02:44 AM
Penguinbait's KDE package has fully functional SMB support included. If you're desperate you could look at extracting it from the tarball.

qole
01-13-2008, 07:05 PM
Good news, everyone.

I managed to get my passworded CIFS shares to mount under OS2008! They are visible in File Manager and other apps, too!

The solution is pretty straightforward. I needed to get two files.

The first one is the cifs.ko from fanoush's module archive (http://fanoush.wz.cz/maemo/modules-2.2007.50-2-custom.tar.gz), getting it out of the archive and onto your tablet requires some know-how (ie ask someone else ;) ) I recommend making the proper module directory and putting the cifs.ko into that dir. The correct module dir name for OS2008 is:

/lib/modules/2.6.21-omap1/


The second one is mount.cifs from the Debian Sid armel smbfs package (http://packages.debian.org/sid/armel/smbfs/download). Download it into a directory on your tablet, then, as root, use

dpkg-deb -x smbfs_3.2.4-1_armel.deb smbfs

to extract the contents to a folder, then do:

cp smbfs/sbin/mount.cifs /sbin/mount.cifs
chmod a+x mount.cifs

So, to get my share to mount, I did the following as root (this can be put in a script):
insmod /lib/modules/2.6.21-omap1/cifs.ko
(Note that this may fail with a "file exists" error, that's OK, it means your system already has it loaded)
mount.cifs //SERVER/share /home/user/MyDocs/lan/share -o user=SERVER\\myname,pass=passwd1
...replacing the proper things in the proper places, of course...

It just works. To see if I was doing this for nothing, I unmounted the share and tried
mount -t cifs //SERVER/share /home/user/MyDocs/lan/share -o user=SERVER\\myname,pass=passwd1
only to get the familiar "Mount: .... failed" error.

Hopefully that helps someone else who is having the same problems.

PS: I first tried to install the whole Samba package from the Debian Sid armel repository. It depended on all sorts of stuff, and by the time I was done, I had replaced libc6 and other core system libraries. That totally toasted my system, and I had to reflash. Thankfully, I backed up before I began that adventure, so I was back up and ready to try again the next day.

turan
01-15-2008, 06:09 AM
Good news, everyone.
I managed to get my passworded CIFS shares to mount under OS2008! They are visible in File Manager and other apps, too!


Thanks for the instructions! I got this working, but after I was done I noticed my File manager doesn't find the shared folder anymore. Did I screw up something? Any idea why this could be?

BTW I myself am new with Linux, but luckily my friend helped me to get the files needed for this. There's probably more people like me so here's the files I used if someone needs them:

http://www.tehas.org/n800/cifs.ko
http://www.tehas.org/n800/mount.cifs
http://www.tehas.org/n800/umount.cifs

qole
01-15-2008, 02:04 PM
If you want File Manager to show your mounted directory, you have to mount it to a folder under /home/user/MyDocs/ (or mount it as a dir on one of the SD cards), so for me, I have a folder called /home/user/MyDocs/lan that has a subfolder for each of my SMB mounts.

If you could get to the shared folder via the file manager before, you probably don't need my instructions. They are only for people who couldn't access the share before due to a password or other problems.

I also found that the standard umount works fine, I didn't need umount.cifs.

FGol
01-15-2008, 05:28 PM
I like using EmelFM2 (http://maemo.org/downloads/product/OS2008/emelfm2/) as a file manager. It or maybe GPE Filemanager ought to be able to see anything outside of /home/user.
Frank

turan
01-15-2008, 05:47 PM
If you could get to the shared folder via the file manager before, you probably don't need my instructions. They are only for people who couldn't access the share before due to a password or other problems.


Yes I could get to the shared folders via File manager, but I couldn't get to them from xmms file manager so that I could've added music to the playlist. Maybe there would have been an easier way to achieve this?

Now everything works as intended! Today the File manager can also access the shared folders even though I did nothing about it.

qole
01-15-2008, 07:49 PM
Now everything works as intended! Today the File manager can also access the shared folders even though I did nothing about it.

Did you reboot in the meantime? Sometimes a reboot fixes things ;)

turan
01-16-2008, 05:34 AM
Did you reboot in the meantime? Sometimes a reboot fixes things ;)

Sure I tried that a number of times. :)

frasej
01-17-2008, 11:45 AM
Thanks all. I haven't tried it yet, but that should work for my original question.

shenson
01-23-2008, 01:34 PM
I got this working by just insmodding cifs.ko and using the standard mount command. The -o option should come first before the "device" and mount point for example:

mount -t cifs -o user=SERVER\\myname,pass=passwd1 //SERVER/share /home/user/MyDocs/lan/share

youbecha
01-25-2008, 12:30 AM
I am assuming this isn't an auto-mount like I have gotten used to in Ubuntu?

Will this mod change how File-manager sees the non-password protected shares?

sashabe
03-04-2008, 05:57 PM
Is there a way to symlink Windows-shared network folders on tablet? I tried these variants:
ln -s \\Wl500g.premium\part0\folder\
or
ln -s smb://guest@192.168.0.1/
...but they don't work.

sckmcck
03-04-2008, 05:57 PM
I think you have to mount it to a fold, then you can symlink the folder.

qole
03-04-2008, 06:56 PM
I am assuming this isn't an auto-mount like I have gotten used to in Ubuntu?

That's right. The N8x0 doesn't connect to the network upon boot like most Linux distributions, so you can't mount network shares on boot. Theoretically, you should be able to put your mount statements into /etc/fstab as "no auto" and then mount them once you connect to the network, but I can't test that since "regular" mount doesn't work for me.

Will this mod change how File-manager sees the non-password protected shares?

No, the File Manager does its own thing. The mounted shares, if placed in folders that the File Manager can see, will show as regular folders in the File Manager, but everything else should function as before.

Is there a way to symlink Windows-shared network folders on tablet? I tried these variants:
ln -s \\Wl500g.premium\part0\folder\
or
ln -s smb://guest@192.168.0.1/
...but they don't work.

Mounting a network share to a folder is already kind of like a symlink, in that it is a remote share appearing as a local folder. In your examples, it looks like you are trying to use "ln -s" as a kind of mount command.

arunchowdhary
03-05-2008, 02:40 PM
I have recently got my N800 and I have installed OS2008 on it. Its working fine. I was trying to access my Laptop (windows XP Media center edition) shared files from N800, to do so I have opened File manager and found few other network machines/folder but not mine laptop. I have turned off my Norton Internet Security Firewall (windows firewall is already tured off by default, since its using Norton firewall), then tried it again but could not see my sahred files/folder from laptop. However I can see the same shared folders from other Laptop/Machine (windows XP) and even from my Archos 604wifi.

My laptop is listed in "workgroup" (not in domain), I have full privilges on my user ID on laptop.

Could somebody help me to get the network shared files from my laptop on N800. I don't know why its not listing my sahred folders in "file manager".

I also wanted to reverse, I mean if I could access my N800 from my Laptop, is it possible? I appreciate your help.

Thanks.
Arun.

qole
03-07-2008, 04:17 AM
I would recommend installing ssh on your tablet and WinSCP on your laptop, if you want access to the tablet's files on your laptop. If your laptop has bluetooth, you can use that, too.

Unless your laptop's shared folders have no passwords on them (anyone can get full access), you're going to have to mount them using the command line methods discussed in this thread.

JELaVallee
03-18-2008, 08:32 PM
... Theoretically, you should be able to put your mount statements into /etc/fstab as "no auto" and then mount them once you connect to the network, but I can't test that since "regular" mount doesn't work for me.
...


You may want to try this:

Create a bash script with the mount commands for your various smb shares that you want to mount.
Copy the script to /etc/network/if-up.d/


In theory (and all appropriate disclaimers to such), this should attempt to establish your mounts every time your network successfully connects. I'm still working out how you could make this sensitive to executing only for particular connections (e.g. only mount home computer shares when your connection SSID is your home wireless router, etc.)

I'll play with it tonight and let you know the results.

Qole: Have you tried using vanilla mount with the object credentials PRE-ceding the mount point details in your command line argument list? I think I saw that as a possible solution either in this thread or elsewhere in the forums.

Cheers,
Etienne

qole
03-19-2008, 01:43 PM
In theory (and all appropriate disclaimers to such), this should attempt to establish your mounts every time your network successfully connects. I'm still working out how you could make this sensitive to executing only for particular connections (e.g. only mount home computer shares when your connection SSID is your home wireless router, etc.)

At the moment, I have a couple of scripts, one for when I'm at home, and one for when I'm on the road. When I'm on the road, I use ukki's sshfs (http://www.internettablettalk.com/forums/showthread.php?t=17811) to mount my drives over an encrypted tunnel.

I've discovered that mounting network shares can be a bad thing; the media file crawler thingy (metalayer-crawler) can wander off onto your network folders and really bog your system down.


Qole: Have you tried using vanilla mount with the object credentials PRE-ceding the mount point details in your command line argument list? I think I saw that as a possible solution either in this thread or elsewhere in the forums.

Yeah. I tried everything. But mount.cifs does the job, so I'm OK.

sunmercury
11-20-2008, 03:49 AM
Does anyone know if Qole's instruction here works for Diablo ? If not, is there another way to access CIFS shares in Diablo ? I tried Wizard Mounter but it does not work in Diablo.

qole
11-20-2008, 11:07 PM
Do your shares show up in file manager under "Shared Folders"? Most Windows shares will just automatically show up there. If they are passworded or otherwise secured, you'll probably still have to get the cifs stuff from fanoush and Debian as per my previous instructions (or use Easy Debian ;) )

EDIT: See my next post for updated Diablo stuff.

qole
11-20-2008, 11:33 PM
Ok, here are the files you'll need. Just tested with Diablo, they work great.


Download the attached file to your tablet (let's just say /media/mmc2/install/diablo-cifs.tar.gz for the sake of the how-to)
Gain root (I'd post a link to the maemo wiki but it is offline at the moment),
Enter the following:

cd /
tar xzvf /media/mmc2/install/diablo-cifs.tar.gz .



That should give you the files you need to use the mount.cifs command:

Gain root then:

insmod /lib/modules/2.6.21-omap1/cifs.ko
mount.cifs //SERVER/share /home/user/MyDocs/lan/share -o user=SERVER\\myname,pass=passwd1

sunmercury
11-21-2008, 02:21 AM
To answer your earlier question, qole, I do not see any of my unprotected share folder (read/write permission to everyone). I have a PC and an NSLU2, and they can see each other folders. The NSLU2 also runs a media sharing software (similar to Tversity). I only see a "Shared media" folder in my Diablo N800 file manager, in which only the share media folder can be seen, NOT any other public folder.

Thanks to your instruction, however, I can now mount any folder I want to, even those remotely connected vs VPN !!!

Thanks again :-)

CypherBit
12-26-2008, 07:44 AM
qole or anyone else, would you be so kind to help me out.

I downloaded, extracted the tar and completed insmod.

If I cd to /media/mmc2/install/sbin and execute:mount.cifs //SERVER/share /home/user/MyDocs/lan/share -o user=SERVER\user,pass=password
I get:
/bin/sh: mount.cifs: not found.

So I included the entire path to mount.cifs like this:
/media/mmc2/install/sbin/mount.cifs //SERVER/share /home/user/MyDocs/lan/share -o user=SERVER\user,pass=password

I replaced SERVER with my machine name.
I replaced all instances of share with my share name.
I replaced all instances of user with my machine username.
I created the folder /home/user/MyDocs/lan/share.
I tried all variations of caps for my SERVER, user, share.
To be on the safe side I disabled my AV, FW.

And I still get:
/bin/sh: /media/mmc2/install/sbin/mount.cifs: Permission denied

Why is that? I have the correct password, username and machine name of that I'm certain since I connect to that machine with half a dozen other devices. I can also access my media through Media Player.

Any assistance would be greatly appreciated.

EDIT: I'm on a N810 with 5.2008.43-7.

qwerty12
12-26-2008, 07:46 AM
qole or anyone else, would you be so kind to help me out.

I downloaded, extracted the tar and completed insmod.

If I cd to /media/mmc2/install/sbin and execute:mount.cifs //SERVER/share /home/user/MyDocs/lan/share -o user=SERVER\user,pass=password
I get:
/bin/sh: mount.cifs: not found.

So I included the entire path to mount.cifs like this:
/media/mmc2/install/sbin/mount.cifs //SERVER/share /home/user/MyDocs/lan/share -o user=SERVER\user,pass=password

I replaced SERVER with my machine name.
I replaced all instances of share with my share name.
I replaced all instances of user with my machine username.
I created the folder /home/user/MyDocs/lan/share.
I tried all variations of caps for my SERVER, user, share.
To be on the safe side I disabled my AV, FW.

And I still get:
/bin/sh: /media/mmc2/install/sbin/mount.cifs: Permission denied

Why is that? I have the correct password, username and machine name of that I'm certain since I connect to that machine with half a dozen other devices. I can also access my media through Media Player.

Any assistance would be greatly appreciated.

Move it to somewhere like /home/user or /usr/bin and 'chmod +x' it. You cannot execute files of the memory card.

CypherBit
12-26-2008, 08:03 AM
qwerty12 that did it, thank you very much. I'm very new to NIT and Linux in general and had no idea I couldn't execute it from the memory card.

polossatik
12-26-2008, 10:10 AM
you have also http://maemo.org/downloads/product/OS2008/wizard-mounter/
dependency's: https://garage.maemo.org/frs/download.php/2527/README_FIRST

not tested... just mentioning.