[HOW TO] 2-way network file sharing on Android

Chris3D

Well-known member
Sep 21, 2010
646
179
0
Visit site
Hi everyone, just thought I'd write up some quick instructions on how to set up file sharing between Android and a PC - both mounting Windows shares on Android, and Android on Windows. I was always frustrated by iOS's inability to do this easily, and it was one of the major reasons I switched to Android. With the following two (free) utilities, you'll almost never need to connect your phone to your PC using the USB cable (to transfer files at least).
(It should be noted that both these utilities require root permissions)

Anyway, here goes:

First, mounting Windows shares on Android.


Step 1: Install CIFS Manager

Download and install CIFS Manager from the Android Market.

Download one of the following two files:
CIFS Module for Android 2.1
CIFS Module for Android 2.2

Unzip whichever one of these you'll be using and place the file(s) on your SD card somewhere, I put them in /sdcard/Stuff/System.


Step 2: Set up file sharing on Windows
(These screengrabs are from Windows 7, but previous versions of Windows should be sufficiently similar to follow along)

win_share.jpg


Go into My Computer and select the drive or folder you want to share. In my case, I'm sharing my entire D Drive. Right click on your drive/folder, select Properties, then the Sharing tab, then click the Advanced Sharing button:

win_advanced_share.jpg


Click the Share this folder checkbox to enable sharing. Type in a name for the share and click OK. At this point, Windows is now sharing your drive/folder.


Step 3: Configure CIFS Manager

cifs_main.jpg


Back on Android, launch CIFS Manager, click the menu button and select Settings:

cifs_settings.jpg


In settings, click the checkboxes for Load cifs module and Load via insmod.

Next, you need to enter the path(s) to the cifs module(s) you placed on your SD card. If you're on Android 2.1, you only have one of these, on Android 2.2, there's two.

On 2.1, using my example of placing the files in folders Stuff/System, you'd enter /sdcard/Stuff/System/cifs_3.ko If you placed the files elsewhere, adjust this path accordingly.

On 2.2, you need to load two files and you do that by entering them both, separated by a colon. So, you enter /sdcard/Stuff/System/slow-work.ko:/sdcard/Stuff/System/cifs.ko (slow-work needs to be first). Back back out to the main CIFS Manager screen.


Step 4: Configure the share

cifs_share.jpg


Click the menu button and then select Add new share. In Share Path, type in the IP address of your PC, followed by the name you gave your share. For me, this is: 192.168.1.42/D Drive

If you don't know your IP address, start a command prompt (Start>run>cmd), and then type ipconfig in the command window. Your IP address will be listed under IPv4 address under Ethernet adapter Local Area Connection.

For mount point, type /mnt/cifs/D Drive or whatever name you want it mounted at. (I've read conflicting things on this, but it seems safer to mount shares under /mnt as opposed to somewhere on your SD card.)

For Username and Password, enter the username and password of a valid Windows user account. (It seems to require a password to work, so if you don't use a user account password, you'll have to set up a second account with a password)

Save the share settings and return to the main CIFS Manager screen.

cifs_main2.jpg




Step 5: Mount the share

cifs_mounted.jpg


In CIFS Manager, click on the share and it should mount. If it mounts successfully, the little gray dot next to the share will turn green. If not, you'll get some completely useless error message, so let's hope it mounts successfully!

root_explorer.jpg


Now, just launch a root file explorer like Root Explorer and navigate to the share location you set up, in my case, /mnt/cifs/D Drive. You should have full read/write access to the share (assuming you shared it with R/W access).


Next, mounting your SD card on your PC



Step 1: Install Samba server on Android.

Download and install Samba Filesharing from the Android Market.

Step 2: Configure Samba on Android.

samba_main.jpg


Launch Samba Filesharing, click the menu button and select settings.

samba_settings.jpg


For password and username, enter the username and password you'd like to use to access your SD card over the network.

Enter your network workgroup name, this is commonly just "Workgroup" on Windows.

For Netbios name, enter whatever you'd like your phone to appear as to other systems on your network. This is Android by default.

You can check or uncheck Enable Wakelock depending on your preference. If selected, this will keep your phone awake when Samba is sharing your SD card.



Step 3: Starting sharing



samba_enable.jpg


Return to the main Samba Filesharing screen, click the menu button and select Enable

If all goes well, you should get a message that the Samba service will be automatically started and stopped with your WiFi connection, and then you'll return to a screen indicating that sharing is enabled and listing your phone's IP address.

samba_enabled.jpg



Step 4: Access your SD card from your PC.

win_android.jpg


win_sdcard.jpg


win_files.jpg


In windows, open up your network window and you should see a new connection called Android (or whatever you entered in the Netbios setting). Open that, and you should see your shared SD card, and in that, you should have full read/write access to your SD card.


Step 5: Enjoy not having to dig up your USB cable every time you want to get a file on or off of your phone!
 
Last edited:

jackmei2

Well-known member
Sep 23, 2010
719
63
0
Visit site
thanks Chris! I was thinking about trying to figure this out for myself when you had posted about how you were accessing your computer's network share from your phone a month or so ago. this makes it a whole lot easier.
 

Suicide Shift

Well-known member
Feb 25, 2011
258
52
0
Visit site
Very nice indeed. I'll be trying this out for sure. For the amount of times I am copying items between the two I am sick of having to mount / unmount from phone and unmount USB Device from computer each time.

I give this two thumbs up!
 

Ytaay

Well-known member
Oct 29, 2010
247
36
0
Visit site
Totally awesome, totally righteous stuff Chris! I've been so bamboozled and combobulated with ROMs and kernels and themes and animations and recoveries (OH MY!), that I completely forgot about this core-should-have feature.

You are to be commended, sir! ! (commend, commend, commend)

Swyped by my FASN8.EB01.superFRANKNBEANSclean2.9voodoo
 

Suicide Shift

Well-known member
Feb 25, 2011
258
52
0
Visit site
I think your links to the CIFS_2.1 and CIFS_2.2 are the same?

I downloaded 2.2 and extracted only one file. When I go to download either of these from those links they both point to a CIFS_2.1.zip file?

I am using 2.2 so I have this setup but not working. I think it is because I don't have the right CIFS files.

*EDIT*

I just copied the link and changed the cifs_2.1.zip to cifs_2.2.zip and now I am getting the correct file. You need to fix the link for the 2.2 version.

http://www.chris3d.com/Android/networking/cifs_2.2.zip
 

Suicide Shift

Well-known member
Feb 25, 2011
258
52
0
Visit site
Also what Kernels supports cifs? I am running into the issue below where I found an answer from the developer that wrote the app:

2."No such device".
A: Your current kernel or rom lacks the necessary CIFS support. Try to find a matching kernel module (cifs.ko) or use a rom with explicit CIFS support.

I am runing SuperFrankenClean 2.9 Voodoo

Developer: f3d0r

**EDIT**

I think I found the answer. I need to find a module that works with my kernel / rom. I'll see if I can find a match:

-- specify multiple modules in the "Path to cifs.ko" preference by separating them via a colon ( : ).
-- e.g. /system/lib/modules/cifs.ko:/system/lib/modules/nls_utf8.ko

- you can now review the list of loaded kernel modules via the "Modules..." button in the "Info..." dialog
-- if your kernel has cifs support built-in, the cifs will not show up there, this is no problem
 

Chris3D

Well-known member
Sep 21, 2010
646
179
0
Visit site
Totally awesome, totally righteous stuff Chris! I've been so bamboozled and combobulated with ROMs and kernels and themes and animations and recoveries (OH MY!), that I completely forgot about this core-should-have feature.

Thanks, yea, I was thrilled when I discovered I could mount network shares on the phone, and again a few days ago when I found out I could mount the SD card on Windows. At this point, the only thing I need the USB cable for is to charge the phone. For putting files onto the phone or grabbing stuff off it (photos, videos, etc), it's sooooooo much easier to just browse to it on the network and get the stuff directly.

I think your links to the CIFS_2.1 and CIFS_2.2 are the same?

Sorry about that, it's been fixed... that's what I get for posting at 2am... :p

Also what Kernels supports cifs?

**EDIT**

I think I found the answer. I need to find a module that works with my kernel / rom.

I included the necessary kernel modules in the original post. There's different ones for 2.1 and 2.2, so make sure you grab the right one.

With these (set up properly per the instructions), it should work on any kernel. I've used it on both stock and Voodoo kernels and it always works fine once the kernel modules are loaded.
 

Suicide Shift

Well-known member
Feb 25, 2011
258
52
0
Visit site
Thanks, yea, I was thrilled when I discovered I could mount network shares on the phone, and again a few days ago when I found out I could mount the SD card on Windows. At this point, the only thing I need the USB cable for is to charge the phone. For putting files onto the phone or grabbing stuff off it (photos, videos, etc), it's sooooooo much easier to just browse to it on the network and get the stuff directly.



Sorry about that, it's been fixed... that's what I get for posting at 2am... :p



I included the necessary kernel modules in the original post. There's different ones for 2.1 and 2.2, so make sure you grab the right one.

With these (set up properly per the instructions), it should work on any kernel. I've used it on both stock and Voodoo kernels and it always works fine once the kernel modules are loaded.

I just got it working. I used Terminal Emulator and typed:

insmod <path to modules> and got an error that it could not access them. No permission denied or anytihng.

I then created a modules directory under /system/lib

I then placed both .ko files into /system/lib/modules/ and updated the settings. Now it is working.
 

Chris3D

Well-known member
Sep 21, 2010
646
179
0
Visit site
I just got it working. I used Terminal Emulator and typed:

insmod <path to modules> and got an error that it could not access them. No permission denied or anytihng.

I then created a modules directory under /system/lib

I then placed both .ko files into /system/lib/modules/ and updated the settings. Now it is working.

Yup, you can do it that way too. Just remember if you flash a new rom/kernel, you might loose these modules and need to copy them back. That's why I prefer to just keep them on my SD card so they're always there.
 

craigcls

Well-known member
Mar 3, 2011
71
1
0
Visit site
I downloaded the CIFS Mangager from the market, and it said it installed, but when I tried to open it, it says "application not installed on phone". I uninstalled, rebooted, and reinstalled, but same thing.....

Running SC 2.9 nonvoodoo.
 

Suicide Shift

Well-known member
Feb 25, 2011
258
52
0
Visit site
Yup, you can do it that way too. Just remember if you flash a new rom/kernel, you might loose these modules and need to copy them back. That's why I prefer to just keep them on my SD card so they're always there.

Ohh that I did not realize. I keep forgetting about that. I may have to move them back and see if I can get it to work. Hopefully if I cannot somebody here (hint hint) can help me :)

Oh and I got it working from PC > Android too very nice.
 

Suicide Shift

Well-known member
Feb 25, 2011
258
52
0
Visit site
I downloaded the CIFS Mangager from the market, and it said it installed, but when I tried to open it, it says "application not installed on phone". I uninstalled, rebooted, and reinstalled, but same thing.....

Running SC 2.9 nonvoodoo.

So how did you go about uninstalling if it was not on the phone?

Did you go back to market search for app click on it and there was an uninstall option?

OR

Did you go into Settings > Applications > Manage Applications and uninstall it from here?

Reason I ask is that the first time I downloaded it from the market it did not even show up in my Apps drawer even though my status bar showed that it downloaded and "successfully" installed it.

I then searched market again and clicked on it. It showed up with a FREE button as if I never installed it. So I clicked it and installed it again. Now it showed up in my app drawer.
 

Suicide Shift

Well-known member
Feb 25, 2011
258
52
0
Visit site
I found something much easier.

ES File Explorer on the Market. It allows you to add your local PC and provide the same functionality. The user interface IMO so far is also much better than Root Explorer.

The reverse Samba however is great.
 

craigcls

Well-known member
Mar 3, 2011
71
1
0
Visit site
I tried it both ways. The app is in my app drawer and it shows up with an uninstall option when I go into manage applications. When I go back into the market, it shows as already being installed and there is an uninstall option there as well. But when I try to open the app, it says "this application is not installed on phone". I have uninstalled it both ways now and reinstalled from the market. I have tried rebooting after uninstall, and then again after reinstall. 3rd time now and same thing.
 

Suicide Shift

Well-known member
Feb 25, 2011
258
52
0
Visit site
In my forum travels I have not seen that reported nor have I seen it happen myself. That is odd.

The only thought off the top of my head is if you are rooted without issues. You just went to SC2.9 which includes root so I would think your root access is OK.

You could try ES File Manager from the market. I found that while playing with this posted setup. You can go into the ES File Manager and set your IP / user / password to your PC and it works as well. It also has a nicer User Interface in my opinion.
 

Chris3D

Well-known member
Sep 21, 2010
646
179
0
Visit site
I tried it both ways. The app is in my app drawer and it shows up with an uninstall option when I go into manage applications. When I go back into the market, it shows as already being installed and there is an uninstall option there as well. But when I try to open the app, it says "this application is not installed on phone". I have uninstalled it both ways now and reinstalled from the market. I have tried rebooting after uninstall, and then again after reinstall. 3rd time now and same thing.

That's really strange, definitely some sort of market or installer bug.

When it says it's installed, use a root file manager and look in /data/app. Does it show up there? It should be called ws.plattner.cifsmanager-1.apk
 

Members online

Forum statistics

Threads
943,166
Messages
6,917,622
Members
3,158,858
Latest member
AmeliaRodriguez