[HOW TO] 2-way network file sharing on Android
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 ManagerDownload 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)Step 3: Configure CIFS Manager
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:
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.
Back on Android, launch CIFS Manager, click the menu button and select Settings:
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
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.
Step 5: Mount the share
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!
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.
Launch Samba Filesharing, click the menu button and select settings.
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
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.
Step 4: Access your SD card from your PC.
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!
- 03-10-2011, 03:10 AM #2
- 03-10-2011, 09:53 AM #3
- 03-10-2011, 09:59 AM #4
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.
- 03-10-2011, 10:05 AM #5
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!
- 03-10-2011, 10:20 AM #6
- 248 Posts
- 0 Post(s)
- 0 Thread(s)
- VGNex:4.1; ATP:Stock
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
- 03-10-2011, 10:27 AM #7
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.
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.
- 03-10-2011, 10:41 AM #8
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
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
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.
- 03-10-2011, 11:20 AM #10
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.
- 03-10-2011, 11:28 AM #12
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.
- 03-10-2011, 11:41 AM #13
- 03-10-2011, 11:55 AM #14
Did you go back to market search for app click on it and there was an uninstall option?
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.
- 03-10-2011, 12:30 PM #15
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.
- 03-10-2011, 12:36 PM #16
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.
- 03-10-2011, 12:42 PM #17
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.
- 03-10-2011, 02:29 PM #18
- 03-10-2011, 03:47 PM #19
- 03-10-2011, 09:17 PM #21
- 03-11-2011, 12:20 PM #22
- 03-11-2011, 12:35 PM #23
- 03-22-2011, 07:52 PM #24
- 10-01-2011, 06:50 PM #25
- 2 Posts
- 0 Post(s)
- 0 Thread(s)
Re: [HOW TO] 2-way network file sharing on Android
I was wondering if you still have the cifs_2.2.zip file? The links in this thread lead to a 404 page not found. I've been trying to get a copy of cifs.ko that works with the kernel (188.8.131.52) for T-Mobile's LG G2X running froyo (2.2.2) but have been unsuccessful. I've found several that say they work with this kernel but when I try to insmod the cifs.ko file as superuser in adb it returns "exec format error".
Any help you can provide would be great.