[SOLVED] Mount a smb/cifs share - Nexus 5 Q&A, Help & Troubleshooting

Thank you in advance if you can help with this, unfortunately I'm not going to be able to follow through with this very well at the moment. If this gets no attention I'll bump it when I can follow through.
I want to mount a smb/cifs share from my router to my Nexus 5.
I can successfully mount the share and view it in terminal but none of it shows up in any apps...and that's pretty much my issue.
Here's some unimportant info, and a little info about me, I'm as scatterbrained as they come. The reason I want to do this is to stream my movies on the "NAS" to my Chromecast through Allcast or something.
As of now I'm using an entware mini dlna package on the router to stream everything to Avia. My problem is dlna broadcasts all my media to my entire network...no password required or anything. Also accessing my files through Avia is a pain in the ass, navigating through the folders repetitively gets exhausting.
Here's what I've come up with so far:
I'm using hammerhead-faux123-010m kernel, and SlimRC3.
CIFS DebugData:
Code:
CIFS Version 1.78
Features: posix xattr
Active VFS Requests: 0
Servers:
1) Name: 192.168.1.1 Domain: WORKGROUP Uses: 1 OS: Unix
NOS: Samba 3.0.37 Capability: 0x80e3fd
SMB session status: 1 TCP status: 1
Local Users To Server: 1 SecMode: 0x3 Req On Wire: 0
Shares:
1) \\192.168.1.1\NAS Mounts: 1 Type: NTFS DevInfo: 0x0 Attributes: 0xf
PathComponentMax: 255 Status: 0x1 type: 0
MIDs:
The disk is actually Ext3, not NTFS.
This guy kinda just crushed all my hopes and dreams of the future but I'm trying to use his OneClickMount alpha app.
http://forum.xda-developers.com/showpost.php?p=49651026&postcount=127
app here:
http://forum.xda-developers.com/showpost.php?p=49693815&postcount=129
This is what I have tried, I ended up with the same results:
Code:
[email protected]:/storage/emulated/0/cifs # setenforce Permissive
[email protected]:/storage/emulated/0/cifs # getenforce
Permissive
[email protected]:/storage/emulated/0/cifs # mount -r -o noperm,rw,file_mode=777,dir_mode=777,uid=1023,gid=1023,unc=\\\\192.168.1.1\\NAS,username=***,password=*** -t cifs none /storage/emulated/0/cifs
[email protected]:/storage/emulated/0/cifs # ls
My Music
My Pictures
My Videos
Torrents
Then I tried OneClick Mount app:
https://www.dropbox.com/sh/muabb9vp1i8ubxt/o78FSYMcHo
From what I can tell from the app logcat, the app tries to move the debuggered file, create its own with a chosen command inside, start then stop it, and restart the original.
I might try to do this manually later, as in a month from now at the least. I'm pretty sure a certain someone is pissed off at me for not becoming one with the universe n all that jazz.

I'm gonna leave a couple links here so I can delve into them later, they seem to have crazy amounts of useful information:
[HINT] How Stickmount (and others...) are working with Android 4.2
Debuggered script
Sincerely, Head is spinning

Sorry but as of android 4.4.2 CIFS at a device level (all accounts see the network shares) no longer works and no one has a solution. This includes rooted devices and custom Roms. Of course apps such as ES File Explorer can have network share accesses but not all apps can utilize that access. For example MX player can be invoked from an ES file folder by clicking on a video file but apps like PowerAmp cannot see those folders. Some apps include built in network share features but they have the same restrictions as I previously described.
Things all changed when Android included multiple accounts and security started to get tighter. Initially developers found ways around those measures but too my knowledge, with 4.4.2 no one has found a work around.
Sent from my Nexus 10 using XDA Premium HD app

3DSammy said:
Things all changed when Android included multiple accounts and security started to get tighter. Initially developers found ways around those measures but too my knowledge, with 4.4.2 no one has found a work around.
Sent from my Nexus 10 using XDA Premium HD app
Click to expand...
Click to collapse
One workaround is hijack a system process such as debuggerd (debugger daemon) which runs with higher than su permissions. This method still works but is awkward to exploit manually. Apps such as foldermount use this workaround but not for network mounting, but it shows that it is still possible.

I have a Raspberry Pi running OpenELEC for streaming my locally stored media. I use my Chromecast for streaming Netflix, Google Play media, etc.
I understand what you are trying to do, but a dedicated device works great for me.
That said, you might keep an eye on VLC to see if they start supporting casting to Chromecast. That would likely accomplish what you are asking.

rootSU said:
One workaround is hijack a system process such as debuggerd (debugger daemon) which runs with higher than su permissions. This method still works but is awkward to exploit manually. Apps such as foldermount use this workaround but not for network mounting, but it shows that it is still possible.
Click to expand...
Click to collapse
This is what I'm going to attempt next, from what I read it can be terribly inconsistent if not done through SSH, so that's a bummer. I just need to get more information on how to do it. Debuggered in general confuses me.
embhorn said:
I have a Raspberry Pi running OpenELEC for streaming my locally stored media. I use my Chromecast for streaming Netflix, Google Play media, etc.
I understand what you are trying to do, but a dedicated device works great for me.
That said, you might keep an eye on VLC to see if they start supporting casting to Chromecast. That would likely accomplish what you are asking.
Click to expand...
Click to collapse
This is what I've been wanting to do with my old Galaxy Nexus. I have the HDMI adapter and everything but the screen is broke (the digitizer works), so I plug it into my TV and randomly hit the screen hoping to eventually connect my bluetooth mouse lol. No such luck. I wish I could just boot it into a custom build but that's never gonna happen. Unless OpenELEC works on android devices? Seems unlikely.

debuggerd can be replaced with a shell script with the mount command in it and it will run at boot.
It's really messy. I found I had to put the original debuggerd back or the phone would lock up.
Sent from my Nexus 5 using Tapatalk

WEEEEEOOOOOOO I finally got all my stuff to show in a file manager, now I just need to find a terminal command to trigger media scan on the folder. Right after I eat a bunch of chicken.
Awesome, it works perfectly. And by perfectly I mean it's the messiest thing I've ever done on Android. I'm not really sure how this affects battery and all but thank god this finally works.

For anyone interested:
Follow the directions in this post.
I didn't understand the mount command he used so I used
Code:
/system/xbin/busybox mount -r -o noperm,rw,file_mode=777,dir_mode=777,uid=1023,gid=1023,unc=\\\\192.168.1.1\\NAS,username=***,password=*** -t cifs none /data/media/0/cifs
You also need to use /data/media/0/ otherwise it will only work in already opened apps apparently.
So thanks rootSU...And that should work, I'm going to do it in a way where I don't have to use scriptmanager but that's the gist. All the credit goes to the people in the threads I linked, I have absolutely no idea what I did here and I learned nothing.
Nothing special to see here. :good:

Here's a way to unmount it so it doesn't explode your apps when you disconnect WiFi:
/system/bin/debuggerd.binnn
Code:
#!/system/bin/sh
/system/bin/umount_movies.sh
exec /system/bin/debuggerd.bin "[email protected]"
/system/bin/umount_movies.sh
Code:
#!/system/bin/sh
/system/xbin/busybox umount /data/media/0/cifs
/system/xbin/busybox umount -r -o noperm,rw,file_mode=777,dir_mode=777,uid=1023,gid=1023,unc=\\\\192.168.1.1\\NAS,username=***,password=*** -t cifs none /data/media/0/cifs
Script_eject.sh
Code:
#!/system/bin/sh
mount -o rw,remount /system
sleep1
/system/xbin/busybox mv /system/bin/debuggerd /system/bin/debuggerd.binn
sleep 1
/system/xbin/busybox mv /system/bin/debuggerd.binnn /system/bin/debuggerd
sleep 1
mypid=$(/system/xbin/busybox ps -o pid,comm | /system/xbin/busybox grep 'debuggerd' | /system/xbin/busybox awk 'NR == 1 {print $1}')
/system/bin/kill $mypid
sleep 1
/system/xbin/busybox mv /system/bin/debuggerd /system/bin/debuggerd.binnn
sleep 1
/system/xbin/busybox mv /system/bin/debuggerd.binn /system/bin/debuggerd
sleep 1
mount -o ro,remount /system
I'm automating all this with Tasker.
Script task: (I have it run at boot)
waits 15 seconds
run shell command to kill debuggerd
wait 5 seconds
media action scan card /
Script_eject task: (I have it run when I disconnect from my SSID)
run shell command with the script_eject.sh code
wait 6 seconds
media scan card /
It has been seamless so far, also lol.

sendan said:
For anyone interested:
Follow the directions in this post....
Click to expand...
Click to collapse
I have yet to try your solution but what Rom and kernel do you have installed? I ask because in the past (Android 4.1) you needed a custom kernel that supported CIFS or you needed to add modules to stock.
I'm using rooted stock, Franco Kernel.
Sent from my Nexus 10 using XDA Premium HD app

3DSammy said:
I have yet to try your solution but what Rom and kernel do you have installed? I ask because in the past (Android 4.1) you needed a custom kernel that supported CIFS or you needed to add modules to stock.
I'm using rooted stock, Franco Kernel.
Sent from my Nexus 10 using XDA Premium HD app
Click to expand...
Click to collapse
I'm on the latest Slim, with latest faux kernel. Faux has cifs modules built in, I'm not sure about Slim or Franco kernel. If you have a cifs folder in /proc/fs I assume that means the kernel has the cifs modules.

Related

[KERNEL] [15/08] CIFS module for HTC's OTA 2.6.32.15 kernel

How i got it working..
You may've seen me nagging around the forums for a sense-ui 2.2 rom with the cifs module in it. It looked like only the non-HTC roms have this module currently, that is, roms with a non-HTC custom compiled kernel.
This got me curious as to why, since people have compiled ext4 and tun modules for it just fine, they're in plenty of HTC kernel based roms.
So i got a cross-compile toolkit last night, and went looking for the closest kernel source i could find, and that turned out to be the msm branch of 2.6.32.9. I haven't even compiled a linux kernel in about 2 years, the last time i worked on kernel code was about 4 years ago, and i've never tried to make a module for a kernel that i don't have the source for. Meaning i got caught out with magic differences due to localversion appends etc, but eventually i built a cifs.ko that'd insmod.
I imagine that's how people made their ext4 and tuns (vpn) modules for the HTC built 2.6.32.15 too. So why no cifs module floating around for it already? Inserting the module fails with missing symbol errors for slow_work functions.
A patch was added after 2.6.31 called slow_work, that essentially stops certain filesystem activities blocking excessively. If you enable cifs in 2.6.32, even as a module, it requires slow_work to be enabled on your kernel. Likewise if you don't enable CIFS then slow_work isn't built into your kernel. Curiously the only two filesystems are cifs and gfs2 that require a slow_work enabled kernel.
HTC made the kernel, they didn't include cifs, it doesn't have slow_work enabled, so you can't fudge a module for it. Well, unless you edit out the slow_work code from the cifs filesystem in 2.6.32. As luck would have it, slow_work provided additional functionality, but didn't replace any.
So i edited out the slow_work code from the cifs headers and source files. Get the module for HTC's 2.6.32.15 below.
Edit: Changed the source from android git 2.6.32.9 to HTC's 2.6.32.15. Updated to remove debug symbols and tidied up the oplock code just in case anyone is writing many files to heavy traffic shared drives. UTF8 module included now also for non-ASCII filenames. Full credit to snq- for the tip on debug symbol stripping, the idea of including unicode support, and making me consider people might use this for writes on busy shares.
http://rapidshare.com/files/413103029/cifs.zip
For anyone interested i cross-compiled this using Sourcery G++ Lite 2010q1-188 for ARM EABI on ubuntu x86 installed to a virtualbox VM, with the 2.6.32.15 kernel source from the HTC incredible.
What's so good about CIFS anyway?
Support for CIFS lets you log into windows network shares from a linux OS and mount them as part of the linux filesystem. How's that any different to the SMB aware file managers like Astro or estrong file explorer? Transparent file streaming.
With a software client you can list and copy files from your windows share to your phone. If you instead mount the windows share into your filesystem, you can use files that're on the server as if they're already on the phone.
For example i'm connected to my home network right now over wifi and just opened a 700MB avi file instantly, as if it were already on my sdcard, instead of waiting 5-10 minutes for it to copy over usb, or half the movie's actual duration for it to copy over wifi.
Combine it with VPN and that's like having your entire movie/music collection on your phone anywhere you can get a broadband connection. No copying, no waiting, no ugly transcoding or streaming media servers, just use the files as if you already put them on the SD card.
The only real limiting factor is when the file's encoded bitrate exceeds your connection bitrate, eg. playing a 320kbit mp3 on a 200kbit EDGE connection.
How do i use this CIFS module?
You need a rooted phone with the official OTA 2.6.32.15 kernel, and possibly busybox too (for a mount binary with cifs support).
Quick and ugly instructions are to download the file above, copy it somewhere on your phone, eg. /sdcard/cifs.ko, and do the following as su in a terminal...
Code:
mkdir /sdcard/share
insmod /sdcard/cifs.ko
busybox mount -t cifs //192.168.0.1/sharedfolder /sdcard/share -o username=user,password=pass
Replace //192.168.0.1/sharedfolder with your windows share server name or ip and the folder you wish to access. Replace user and pass with your username and password, naturally.
For more detailed instructions on automating the mount and umount etc, there's an excellent thread here...
http://forum.xda-developers.com/showthread.php?t=733490
and also..
http://forum.xda-developers.com/showthread.php?t=740695
Note to ROM authors
Any rom authors using 2.6.32.15 who would like to include this module in their rom, you're quite welcome to. You don't need to credit me either, although it would be nice.
Nice work buddy, I will test this out when I get back home.
Nice! Thanks for the module!
FYI: HTC just released the HTC EVO 4G - MR release - 2.6.32 kernel source and
Droid Incredible by HTC (Verizon) - MR release - 2.6.32 kernel source code.
It's working flawlessly!! Thanks you very much for this. And as you looks skilled, now pls try to find a way, how to connect bluetooth keyboard in Sense ROM and you are definitely my hero
insmod /sdcard/cifs.ko -> exec format error
busybox insmod /sdcard/cifs.ko ->invalid module format...
Why is that? Using nextsense with 2.6.32.15 kernel
Thanks
Sent from my HTC Desire using XDA App
maslinar said:
insmod /sdcard/cifs.ko -> exec format error
busybox insmod /sdcard/cifs.ko ->invalid module format...
Why is that? Using nextsense with 2.6.32.15 kernel
Thanks
Sent from my HTC Desire using XDA App
Click to expand...
Click to collapse
Go to software information on the phone, is your kernel listed as Linux-2.6.32.15-gf9c0527? This module is built for the specific HTC OTA build of the 2.6.32.15 kernel only.
ranwej said:
It's working flawlessly!! Thanks you very much for this. And as you looks skilled, now pls try to find a way, how to connect bluetooth keyboard in Sense ROM and you are definitely my hero
Click to expand...
Click to collapse
It's pretty much impossible to get bluetooth keyboards working on the HTC kernel without it's source code, since it'd require a full kernel recompile to enable it. Although the current HTC kernel has bluetooth HID support enabled, it doesn't have keyboard support enabled in the input devices section. Keyboard support can't be built as a module, only built into a kernel. Sorry!
If anyone is using gscript to automate their cifs mount/umount, i made up a little script to toggle the mount, for use as a gscript homescreen shortcut.
Code:
if test -f /sdcard/sharefolder/mounted.txt
then
busybox umount /sdcard/sharefolder
else
insmod /path/to/cifs.ko
busybox mount -t cifs //192.168.0.2/sharename /sdcard/sharefolder -o username=user,password=pass
fi
busybox df -h
Create a file called mounted.txt in the root of your shared drive, this is used to detect if the share is currently mounted.
replace /sdcard/sharefolder with the name of the directory you're mounting the share on.
replace /path/to/cifs.ko with your path to the cifs.ko module.
replace //192.168.0.2/sharename with your server ip and share name.
replace user and pass with your username and password.
Lastly the df -h is there for visual confirmation whether the share is mounted or not, it'll always be the last line of df -h when it's mounted, the bottom of the gscript window.
Thanks Myshkinbob,
It works
Just one problem.
I add my music as a share, I can play all songs but just a song at a time cannot have a playlist.
Is a way to do this with the default music player? or do I need another player?
Once more thanks Myshkinbob for this.
JoseF
Found solution using Astroplayer
excellent worked great for me
After loading the module and typing this:
Code:
busybox mount -t cifs //192.168.1.5/Shows /sdcard/share/shows -o username=XXX,password=XXX
I'm getting this error:
Code:
mount: mounting //192.168.1.5/Shows on /sdcard/share/shows failed: Cannot allocate memory
Any thoughts?
Demp said:
After loading the module and typing this:
Code:
busybox mount -t cifs //192.168.1.5/Shows /sdcard/share/shows -o username=XXX,password=XXX
I'm getting this error:
Code:
mount: mounting //192.168.1.5/Shows on /sdcard/share/shows failed: Cannot allocate memory
Any thoughts?
Click to expand...
Click to collapse
I had the same error connecting to one computer, if you try to connect using estrongs file manager (free version), that will fail also? Switch estrongs to LAN, hit menu, click new, click scan, then select the PC you're trying to get cifs to connect to. I wouldn't use Astro SMB, it seems a little buggy in 2.2, for me at least.
Just to elaborate, i did all my testing on my desktop pc, windows 7 ultimate x64, and that connected fine. When it came to connecting to my media center pc, windows 7 ultimate x86, i got the same memory allocation error you're seeing.
Estrongs file manager failed to connect also, so i knew it wasn't a cifs module bug. Both machines are on the same network, same firewall settings, it was a real puzzle why the desktop was reachable, and the media pc wasn't.
Does your computer have a long name by any chance? It's a bit bizarre, but my desktop has a very short name, bob-pc, and my mediacenter had a long name, mediacenter-pc. I changed the mediacenter-pc name to media-pc which then required a reboot, and restarted my desire to clear the DNS cache. When i tried now, estrongs file manager could connect, and my cifs mount no longer gave a memory allocation error.
So i'd try pinging 192.168.1.5 from your phone first, then check sharing settings on the pc and that your firewall considers the phone trusted or in a trusted ip range, then if that's all good, try giving the computer a shorter name if it has a long one, and rebooting everything.
I'd recommend you do the connectivity testing with estrongs file manager's LAN - menu - New - Scan, since it rules out any serious user error such as typos in the mount command or mounting to a non-existent directory.
Myshkinbob said:
I had the same error connecting to one computer, if you try to connect using estrongs file manager (free version), that will fail also? Switch estrongs to LAN, hit menu, click new, click scan, then select the PC you're trying to get cifs to connect to. I wouldn't use Astro SMB, it seems a little buggy in 2.2, for me at least.
Just to elaborate, i did all my testing on my desktop pc, windows 7 ultimate x64, and that connected fine. When it came to connecting to my media center pc, windows 7 ultimate x86, i got the same memory allocation error you're seeing.
Estrongs file manager failed to connect also, so i knew it wasn't a cifs module bug. Both machines are on the same network, same firewall settings, it was a real puzzle why the desktop was reachable, and the media pc wasn't.
Does your computer have a long name by any chance? It's a bit bizarre, but my desktop has a very short name, bob-pc, and my mediacenter had a long name, mediacenter-pc. I changed the mediacenter-pc name to media-pc which then required a reboot, and restarted my desire to clear the DNS cache. When i tried now, estrongs file manager could connect, and my cifs mount no longer gave a memory allocation error.
So i'd try pinging 192.168.1.5 from your phone first, then check sharing settings on the pc and that your firewall considers the phone trusted or in a trusted ip range, then if that's all good, try giving the computer a shorter name if it has a long one, and rebooting everything.
I'd recommend you do the connectivity testing with estrongs file manager's LAN - menu - New - Scan, since it rules out any serious user error such as typos in the mount command or mounting to a non-existent directory.
Click to expand...
Click to collapse
I tried connecting to my other PC last night, and it worked fine, so its a problem with my PC.. I fiddled with my sharing settings so many times that I must have screwed up something in the process sometime.
I'm at work now so I'll do those tests when I get home, but I'm positive it'll work
Great work, really useful for streaming music and video. Maybe I'll create an application to make it easier to mount and unmount during the weekend. It would be really nice to see this module implemented on ROMs, and custom kernels.
Btw, any point in unloading the module? (to conserve battery or any other reason?).
unloading the module i don't think so....but i think that unmounting the share is going to save resources....not sure though
Oh one thing i can think of, disabling media sharing might fix it too. My media center has several accounts on it, all providing an individual share for the accounts media, i got rid of those at some point.
I'm not sure that using modprobe -r to remove the module would make any difference to battery usage, since unless you're actively browsing a cifs mount, the module isn't doing any work. It's probably best to unmount when you're done with your share tho, since i'm not sure how well cifs behaves when the network connection isn't available to a mounted share. It might just keep re-enabling wifi to get access to it.
I've since come across a nasty issue btw, video streaming is fine since it keeps the screen alive, but music streaming has a huge problem; when the screen turns off, the phone drops into sleep mode, and the wifi chipset drops down to keep-alive low power mode.
This destroys wifi bandwidth, a typical VBR 160kbps mp3 stutters like mad, so i'm guessing it leaves wifi at around 60kbps, certainly sub-100kbps.
There are 3 solutions i know of...
1) leave the usb cable plugged into either the charger or the computer, the trickle charge from a usb connection allows the wifi chipset to stay out of low power mode when the screen is in standby.
2) an app called WiFi Fixer, that was made for the nexus one. It was made to prevent wifi dropping completely during sleep mode, which isn't my problem exactly. However, in the options menu there's an advanced option called standby fix 2, or words to that effect, and it's meant to prevent the wifi chipset going to sleep. It's kind of buggy, and so far as i can tell it works by disabling/re-enabling wifi once the phone is in standby, to wake the wifi chipset out of low power mode. Like i said tho, it's far from perfect, and if you're using something like msn talk at the same time, you'll lose your connection to it while it switches wifi on and off.
3) Tinker with the broadcom wifi kernel driver. I -think- this is a module so it might be possible to remove low-power mode from it with the HTC kernel. Certainly this fix is used in some of the custom built kernels available.
I went with option 3, just hacked up the bcm4329 wifi kernel module to prevent it entering full standby mode.
mp3 streaming seems to work okay with the screen turned off now, just going to find some 320kbit to test it properly, or dare i say, some FLAC encodings.
Edit:
Just used http://www.appbrain.com/app/net.avs234 to test and even the mighty FLAC plays cleanly in standby over wifi now. Result!
kernel module posted - http://forum.xda-developers.com/showthread.php?p=7638714#post7638714
Myshkinbob said:
How i got it working..
You may've seen me nagging around the forums for a sense-ui 2.2 rom with the cifs module in it. It looked like only the non-HTC roms have this module currently, that is, roms with a non-HTC custom compiled kernel.
This got me curious as to why, since people have compiled ext4 and tun modules for it just fine, they're in plenty of HTC kernel based roms.
So i got a cross-compile toolkit last night, and went looking for the closest kernel source i could find, and that turned out to be the msm branch of 2.6.32.9. I haven't even compiled a linux kernel in about 2 years, the last time i worked on kernel code was about 4 years ago, and i've never tried to make a module for a kernel that i don't have the source for. Meaning i got caught out with magic differences due to localversion appends etc, but eventually i built a cifs.ko that'd insmod.
I imagine that's how people made their ext4 and tuns (vpn) modules for the HTC built 2.6.32.15 too. So why no cifs module floating around for it already? Inserting the module fails with missing symbol errors for slow_work functions.
A patch was added after 2.6.31 called slow_work, that essentially stops certain filesystem activities blocking excessively. If you enable cifs in 2.6.32, even as a module, it requires slow_work to be enabled on your kernel. Likewise if you don't enable CIFS then slow_work isn't built into your kernel. Curiously the only two filesystems are cifs and gfs2 that require a slow_work enabled kernel.
HTC made the kernel, they didn't include cifs, it doesn't have slow_work enabled, so you can't fudge a module for it. Well, unless you edit out the slow_work code from the cifs filesystem in 2.6.32. As luck would have it, slow_work provided additional functionality, but didn't replace any.
So i edited out the slow_work code from the cifs headers and source files. Get the module for HTC's 2.6.32.15 below.
http://rapidshare.com/files/412285213/cifs.zip
For anyone interested i cross-compiled this using Sourcery G++ Lite 2010q1-188 for ARM EABI on ubuntu x86 installed to a virtualbox VM, with the kernel source taken from the android kernel git.
What's so good about CIFS anyway?
Support for CIFS lets you log into windows network shares from a linux OS and mount them as part of the linux filesystem. How's that any different to the SMB aware file managers like Astro or estrong file explorer? Transparent file streaming.
With a software client you can list and copy files from your windows share to your phone. If you instead mount the windows share into your filesystem, you can use files that're on the server as if they're already on the phone.
For example i'm connected to my home network right now over wifi and just opened a 700MB avi file instantly, as if it were already on my sdcard, instead of waiting 5-10 minutes for it to copy over usb, or half the movie's actual duration for it to copy over wifi.
Combine it with VPN and that's like having your entire movie/music collection on your phone anywhere you can get a broadband connection. No copying, no waiting, no ugly transcoding or streaming media servers, just use the files as if you already put them on the SD card.
The only real limiting factor is when the file's encoded bitrate exceeds your connection bitrate, eg. playing a 320kbit mp3 on a 200kbit EDGE connection.
How do i use this CIFS module?
You need a rooted phone with the official OTA 2.6.32.15 kernel, and possibly busybox too (for a mount binary with cifs support).
Quick and ugly instructions are to download the file above, copy it somewhere on your phone, eg. /sdcard/cifs.ko, and do the following as su in a terminal...
Code:
mkdir /sdcard/share
insmod /sdcard/cifs.ko
busybox mount -t cifs //192.168.0.1/sharedfolder /sdcard/share -o username=user,password=pass
Replace //192.168.0.1/sharedfolder with your windows share server name or ip and the folder you wish to access. Replace user and pass with your username and password, naturally.
For more detailed instructions on automating the mount and umount etc, there's an excellent thread here...
http://forum.xda-developers.com/showthread.php?t=733490
and also..
http://forum.xda-developers.com/showthread.php?t=740695
Note to ROM authors
Any rom authors using 2.6.32.15 who would like to include this module in their rom, you're quite welcome to. You don't need to credit me either, although it would be nice.
Click to expand...
Click to collapse
Combine it with VPN and that's like having your entire movie/music collection on your phone anywhere you can get a broadband connection. No copying, no waiting, no ugly transcoding or streaming media servers, just use the files as if you already put them on the SD card
Please could you please explaine how to do that?
Regards
JoseF
Hi! i got the share mounted but its not unmounting now, i have tried to force unmount also but its not working, i am getting operation not permitted. initially i was getting resource busy. Any ideas?
lept0n said:
Hi! i got the share mounted but its not unmounting now, i have tried to force unmount also but its not working, i am getting operation not permitted. initially i was getting resource busy. Any ideas?
Click to expand...
Click to collapse
I get this occasionally, usually it's some background task that was using the share, such as a file explorer, music or movie player. Even though they weren't currently in the shared directory, they still prevented me unmounting. Killing all media/file explorer apps should let you unmount.
you seem to have compiled your module with debugging options, that's why it's size is about 3MB
you might want to strip debugging symbols and sections (just them) with arm-eabi-strip --strip-debug (or arm-none-eabi-stip in your case)
Myshkinbob said:
As luck would have it, slow_work provided additional functionality, but didn't replace any.
Click to expand...
Click to collapse
except for the whole oplock break handling
i took a slightly different approach (patch provided):
h**p://forum.xda-developers.com/showthread.php?t=754793
(sorry, beeing a new user i am not yet permitted to post links)
tried this last night and works great
Found the stock movie player lags a bit but rockplayer works fine.
How do you set up an VPN SSL conection in Windows 7?
I've tryed but didn't works

Automatic wireless folder sync app needed

Hi,
I have looked around and cant seem to find an application quite fitting.
All I want is an app that will wirelessly sync just a folder automatically when I have my WiFi turned on, is there an app that can do this?
i.e. Come home from work, turn on wifi and it just syncs.
Many thanks
To any developers about: How hard would something like this be to make?
I think dropbox does that?
Dropbox syncs a folder on multiple devices with a folder on dropbox server.
There is also an app called PCFileSync that syncs a folder over wifi between the phone and a samba share. I am turning it on with Tasker once it connects to my home ssid. Works great!
Sent from my Desire HD using XDA App
samba share? hm........
rsync and ssh would be a much better choice and cleaner, just a script to run.
synflex said:
samba share? hm........
rsync and ssh would be a much better choice and cleaner, just a script to run.
Click to expand...
Click to collapse
http://a-more-common-hades.blogspot.com/2010/07/backup-photos-with-rsync.html
Tasker+Rsync, and combine it with a ssh key and you can automate it easy.
BTW, I decided to do this today.. I have one which backs up /sdcard/DCIM, and another which backs up the entire sdcard, both over wifi to my Fedora Linux workstation. I'll have to figure out how I want to execute these, but I can do it from GScript Lite, Tasker, whatever floats my boat.
Here's the notes I took, just in case I have to do it again in the future, hope it's useful to some folks..
# Get dropbear/dropbearkey from http://www.elkins.org/dropbear.tar.gz
# Get ssh off device and follow instructions (references at the end) to fix it, name fixed file "sshfxed"
# Remount /system rw
~/AndroidSDK/tools/adb shell
su
mount -o rw,remount device /system
#exit back to Linux shell
Click to expand...
Click to collapse
# Install dropbear and sshfixed from adb push
~/AndroidSDK/tools/adb push sshfixed /system/xbin/sshfixed
~/AndroidSDK/tools/adb push dropbear /system/xbin/dropbear
~/AndroidSDK/tools/adb push dropbearkey /system/xbin/dropbearkey
Click to expand...
Click to collapse
# Now get into adb shell and execute in Android..
mkdir /system/etc/dropbear
chmod 4755 /system/bin/dropbear
chmod 4755 /system/bin/dropbearkey
Click to expand...
Click to collapse
# Create keys
dropbearkey -t rsa -f /system/etc/dropbear/dropbear_rsa_host_key
dropbearkey -t dss -f /system/etc/dropbear/dropbear_dss_host_key
Click to expand...
Click to collapse
# Copy and paste the public DSS key the dss command above outputs and put it in ~/.ssh/authorized_keys on intended host. If you need to know more here, google for how to use ssh keys on Linux hosts. Basically if you're going to [email protected], on machine1 under user account "user" you create a file named authorized_keys in the .ssh directory with the output of the previous command, it tells you it's the 'public key', which is what you want to copy. It has to be all one line.
# Now actually use it all and rsync sdcard to your host For debugging, I suggest trying the "sshfixed -l USER -y -i /system/etc/dropbear/dropbear_dss_host_key" part just by itself and make sure you can ssh to your machine WITHOUT any prompting, password, etc.
~/AndroidSDK/tools/adb shell
# the following is all one line..
rsync -rltDv --chmod=u=rwX,g=rX,o=rX -e "sshfixed -l USER -y -i /system/etc/dropbear/dropbear_dss_host_key" /mnt/sdcard [email protected]:/your/path
Click to expand...
Click to collapse
-- References
Get dropbear - http://forum.xda-developers.com/showthread.php?p=8220181
Set up dropbear - http://forum.xda-developers.com/showthread.php?t=442754
Fix ssh client to use urandom - https://www.heiher.info/1592.html
Use it all to rsync over wifi - http://a-more-common-hades.blogspot.com/2010/07/backup-photos-with-rsync.html
Another vote for Dropbox, it works great! Look for referral codes in the comments on Market for some additional free storage. I use it all the time for pictures and vids for the family.
Sent from my HTC Desire using the XDA App
I use S&K sync.
Horrible user interface but once things are set up you need only to start the client on your phone and press the "Start Sync" button.
Supports multiple configuration sets (local/remote directory pairs, ip address, etc), each can be started separately.
Google: "SK sync android"
khaytsus said:
http://a-more-common-hades.blogspot.com/2010/07/backup-photos-with-rsync.html
Tasker+Rsync, and combine it with a ssh key and you can automate it easy.
Click to expand...
Click to collapse
I'm actually syncing to 2 android phones, with dropbox, rsync and dropbear.
Dropbox is good for documents and such, with small filesize and possiblity of sharing with others.
Using rsync for large files like movies and music folders, also some pictures, notes, keepass, and stuffs I like having around, things that's only going around between my laptop and phone.
Running a crontab that scans for my phone in adb devices, if found, pull a "last sync status" file, if interval > 1 hour or changes made locally, do a local notify-send till rsync is done, then execute dropbear on phone, rsync remote and local, kills dropbear, then push last sync file.
This way, no resources is wasted on the phone, all scanning and verification of device, system, and files were done on laptop.
At the same time I'm monitoring my development phone with frequent ssh rsync when it's in range, push updates, kernels and such across in proper folder structure.
This will ensure changes or new kernels were pushed to phone ready for testing.
Could use the same script for both phone, be it adb+ssh+rsync or pure ssh+rsync, but I personally don't like having sshd running in background when I'm connected to wifi hotspot.
Cleaner this way, less resources wasted on phone, and I can have full control over what, where, and when to sync.
I do realise that there isn't much choice for syncronization in the wild, thus you may like yo try something along the same idea, and you may get your own perfect combo to sync.
P.S. backing up, restoring or syncing bookmarks from browser.db and such could be done this way.

Auto Mount SMB shares when connected to WiFi with Tasker + Execute + scripts

So I've really grown to like having my local SMB shares from my media server mounted to my Xoom so that I can stream video and/or music or whatever on the fly. I don't like the mountpoints getting all messed up when I leave the network though, and I had less than stellar experiences with both Mount Manager and CIFSManager.
CIFSManager worked, but didn't integrate with Tasker, so I couldn't automate it. Mount Manager (the paid version anyway) came with a Tasker plugin, but I don't think it was fully compatible with the Honeycomb OS and I had a lot of issues with it (called the developer and left a message a few hours after buying it, hopefully I can get a refund for my $2.99).
Then I found the (free!) Locale Execute plugin and decided to just script the behavior I wanted myself. If you have Tasker and local SMB shares as well this could be a good solution for you. Just install the Locale Execute plugin from the market and follow these instructions. I'll post them here because I can't post to the dev section yet, and I'm not really sure if this is dev worthy anyway.
First I setup a profile for my home WiFi network (WiFi Connected > SSID [my home WiFi SSID]. Then I added an Enter action with the Execute plugin:
Code:
@!sh /[path]/[to]/[chk_and_mnt_script]/cifs_chk_and_mnt.sh
But I needed to make sure the mount points are cleaned if I disconnect for any reason so I added an Exit action with the Execute plugin as well:
Code:
@!sh /[path]/[to]/[umnt_script]/cifs_umount.sh
In Execute the "@" symbol is used to keep the program from echoing commands to "toasts" (the little black notification boxes you get sometimes, like when an app is "granted SuperUser permissions") and the "!" symbol is used to grant the line of Execute code root access.
I removed the toasts but I still wanted some notification as to what was going on and a quick google revealed this xda post: http://forum.xda-developers.com/showthread.php?t=773232
In that post I found a little .apk that would allow me to call a toast from a bash script. I've attached it to this post.
In the mount script I run a little check to find out if the "cifs.ko" kernel module is already loaded. If it is I skip that block, but if not I go ahead and load it. This way I always know that the kernel module is available before I try to mount the SMB shares.
Here's the Enter bash script I wrote called "cifs_chk_and_mnt.sh":
Code:
#!/bin/bash
lsmod | grep -q 'cifs' #check if cifs module is loaded
if [[ $? -eq 1 ]] #if not
then
am start -a android.intent.action.MAIN -e message 'cifs.ko kernel module not yet loaded. Loading now...' -n com.rja.utility/.ShowToast #displays toast
insmod /system/lib/modules/cifs.ko #loads kernel module
fi
am start -a android.intent.action.MAIN -e message 'Mounting local SMB network shares...' -n com.rja.utility/.ShowToast #displays toast
mount -o username=[windows login],password=[your password] -t cifs //[host ip]/[share] /[path]/[to]/[mount]/[point] #actually mounts share
#replace "[]" info with your own with NO "[]" and copy and paste line for as many shares as you want to mount
And here's the Exit script called "cifs_umount.sh":
Code:
#!/bin/bash
am start -a android.intent.action.MAIN -e message 'Home network lost. Clearing local SMB share mount points...' -n com.rja.utility/.ShowToast #displays toast
umount /[path]/[to]/[mount]/[point]
#replace "[]" info with your own with NO "[]" and copy and paste line for as many shares as you have mounted in the Enter script
Now, like I said, I used the linked (and attached) .apk to display toasts from the BASH scripts, but if you don't want it or care enough to use it then feel free to delete the toast lines or throw a "#" in front of them. If you do want the toasts displayed then you'll have to download it and install it. It won't show in your app drawer.
Anyway, here are the files (I had to add a ".txt" extension to the .sh files to comply with xda's attachment rules, but you can just rename them):
Thanks for this, looks great! I literally just paid for one of the premium smb apps only to find it didn't do quite what I wanted. I'm sure this will be what I'm looking for, cheers.
Edit:
Something for users to note: The umount script wasn't working for me, after some investigation it turns out that though when mounting, '/sdcard/dir' is acceptable, though the mount command actually considers my sdcard to actually be at '/mnt/sdcard' , so *that* was the dir I had to use when unmounting afterwards. This may be true for others too. I am using CM7 on a Desire.
Looking into this, I found that on my CM7 Desire, mounting the shares worked even if "lsmod | grep cifs" returns nothing, and the file is not in the place mentioned in your script either. To streamline the whole process, I just removed all the complicated stuff from the script and ran the mount command directly, saving time. Just a heads up for others, try it and see if it works for you.
Thanks so much for this!
Unfortunately, I have a couple of problems... When the share mounts, it is not in utf-8 format, so folders with odd characters do not show, even though I have that preference set in Mount Manager!
In addition, the unmount script does not work for some reason. When disabling wifi, I recieve a toast that Tasker got the message and executed my exit task, but there is no toast for the unmount script. I've triple checked for grammatical or directory errors, but there are none. Any idea why the unmount script isn't working?
cavemandaveman said:
Thanks so much for this!
Unfortunately, I have a couple of problems... When the share mounts, it is not in utf-8 format, so folders with odd characters do not show, even though I have that preference set in Mount Manager!
In addition, the unmount script does not work for some reason. When disabling wifi, I recieve a toast that Tasker got the message and executed my exit task, but there is no toast for the unmount script. I've triple checked for grammatical or directory errors, but there are none. Any idea why the unmount script isn't working?
Click to expand...
Click to collapse
To be honest, I completely forgot I ever wrote this. Still, the unmount issue could be due to your busybox version. Have you tried executing the relevant commands at a root enabled terminal? Do they work there?
Moreover, you should understand that I apparently wrote this to be completely independent of "Mount Manager" or any related app and these scripts are dependent only on: busybox, Tasker, and the Execute plugin.
-Mike
mikeserv said:
To be honest, I completely forgot I ever wrote this. Still, the unmount issue could be due to your busybox version. Have you tried executing the relevant commands at a root enabled terminal? Do they work there?
Moreover, you should understand that I apparently wrote this to be completely independent of "Mount Manager" or any related app and these scripts are dependent only on: busybox, Tasker, and the Execute plugin.
-Mike
Click to expand...
Click to collapse
I tried executing from terminal and the mount script works fine, but the unmount does not work. It gives me a "no closing quote" error. I'm pretty noobish when it comes to scripts, but it doesn't look like there are errors in the script itself...
Also, if it is independent of Mount Manager, is there a way to include utf-8 formatting in the script?
Sent from my Galaxy Nexus
mikeserv said:
So I've really grown to like having my local SMB shares from my media server mounted to my Xoom so that I can stream video and/or music or whatever on the fly. I don't like the mountpoints getting all messed up when I leave the network though, and I had less than stellar experiences with both Mount Manager and CIFSManager.
CIFSManager worked, but didn't integrate with Tasker, so I couldn't automate it. Mount Manager (the paid version anyway) came with a Tasker plugin, but I don't think it was fully compatible with the Honeycomb OS and I had a lot of issues with it (called the developer and left a message a few hours after buying it, hopefully I can get a refund for my $2.99).
Then I found the (free!) Locale Execute plugin and decided to just script the behavior I wanted myself. If you have Tasker and local SMB shares as well this could be a good solution for you. Just install the Locale Execute plugin from the market and follow these instructions. I'll post them here because I can't post to the dev section yet, and I'm not really sure if this is dev worthy anyway.
snip...
Click to expand...
Click to collapse
I dont care this post is 5 years old, i dont care that i'm bumping this thread...this little gold brick of information was FINALLY what i needed to figure out how to mount cifs without that "never-gonna-be-updated-ever-ever-again-cifsmanager" apk. I just threw the same basic code into tasker and finally got a mount. thank you! if i was more secure in my manhood, i just might embarrass myself.
the real reason for the bump, instead of mere word wasting, is to help anyone anyone searching for the cifs manager apk, or getting the error "no such device" when trying to mount. The issue is connected to the both the "mount name space separation" in SUPERSU, the old android sdcard permissions and who knows what else.
heres' the code I put into tasker:
su --mount-master -c busybox mount -o username=[USERNAME],password=[PASSWORD],rw,file_mode=0777,dir_mode=0777,iocharset=utf8,context=ubject_r:rootfs:s0 -t cifs //192.168.xxx.xxx/cifsync /sdcard/cifsync
no brackets of course.
that popped it right online, no issues but my kernel provides cifs.io support through synapse settings app. so it was easy to load the module at startup
loogielv said:
I dont care this post is 5 years old, i dont care that i'm bumping this thread...this little gold brick of information was FINALLY what i needed to figure out how to mount cifs without that "never-gonna-be-updated-ever-ever-again-cifsmanager" apk. I just threw the same basic code into tasker and finally got a mount. thank you! if i was more secure in my manhood, i just might embarrass myself.
the real reason for the bump, instead of mere word wasting, is to help anyone anyone searching for the cifs manager apk, or getting the error "no such device" when trying to mount. The issue is connected to the both the "mount name space separation" in SUPERSU, the old android sdcard permissions and who knows what else.
heres' the code I put into tasker:
su --mount-master -c busybox mount -o username=[USERNAME],password=[PASSWORD],rw,file_mode=0777,dir_mode=0777,iocharset=utf8,context=ubject_r:rootfs:s0 -t cifs //192.168.xxx.xxx/cifsync /sdcard/cifsync
no brackets of course.
that popped it right online, no issues but my kernel provides cifs.io support through synapse settings app. so it was easy to load the module at startup
Click to expand...
Click to collapse
in code format so there will be no syntax issues -
Code:
su --mount-master -c busybox mount -o username=[USERNAME],password=[PASSWORD],rw,file_mode=0777,dir_mode=0777,iocharset=utf8,context=u:object_r:rootfs:s0 -t cifs //192.168.xxx.xxx/cifsync /sdcard/cifsync

Wishnu: Debian on android one-click launcher and more (now with TV!)

*YO! New version can connect to a TV via HDMI. If you have a USB-host, you can also connect a keyboard and a mouse!*
Hi. I want to introduce you Wishnu. The essence of our project is the launch of computer OS Linux Debian inside an Android mobile device. Then this device connects to a computer by means of the USB-cable. Actually that allows transforming any Android device into a real computer. You can connect the phone to different computers at home, at work and on a visit and use the phone’s own screen and input equipment on the journey.
We have taken "running chrooted debian/ubuntu on android" idea as the base and created something interesting with it.
First, we have created Android application which starts Debian on android mobile device with one click (no need to type any commands in the terminal etc).
Second, we have written desktop client application which shows Debian desktop running on mobile phone on the PC or laptop with wide screen, mouse and keyboard, so this actually turns the solution to the docking station like Motorola Lapdock or devices such as Pocket Desktop, but much better, cause you don't need to buy additional docking station device and you will immediately receive tons of common desktop applications available from Debian MIPS/ARM repositories (even pdf document viewers, image editors, office with spreadsheets and presentations editors etc).
Also device SD card available inside chrooted system in /media/sharedSD dir.
Watch the video in action
And this one (sorry for the quality, I used my matreshka as a camera).
Screenshots
Currently Wishnu uses Debian 5.0 ARM image taken from this thread. We are planning to add more customized and fresh Debian and Ubuntu OS images.
System requirements
PC client
- OS Windows XP, Vista, 7 (x86) or Linux (x86, x64)
- Java Runtime Environment must be pre-installed.
- Device ADB driver on Windows (on linux no adb driver needed, but adb server should be started as root in most cases)
Android device
- MIPS or ARM
- Mobile processor 500 MHz, 256 mb RAM (Recommended: processor 1 GHz and >512 mb RAM)
- Android OS 1.5 or higher.
- The device must be rooted.
Download and install instructions
Or download on Android Market
This one is much easier to start with than existing LinuxInstaller - no need to type any commands in terminal or adb shell - just download image file and press start. Also desktop client is great idea.
Needs more options for system control though and also Ubuntu image for desktop instead of old debian.
yo, we need some response, please download our awesome application! or at least tell us why you won't do it (maybe Wishnu is useless or smb is better). Thank you!
How does it do with running heavier weight applications such as thunderbird?
agoodm said:
How does it do with running heavier weight applications such as thunderbird?
Click to expand...
Click to collapse
Actually it depends on your phone's performance. We use Sony Ericsson Xperia arc for testing and have no problems running such applications. You better try it and inform us about results)
Are you using the armel or armhf Debian distribution?
nicktastique said:
Are you using the armel or armhf Debian distribution?
Click to expand...
Click to collapse
Currently we have images of debian squeezy for armel and mipsel.
A bit busy with the holidays and all, but I will give it a look. I definitely recommend checking out armhf. I've been testing it on my Droid 3 and cursory benchmarks show it to be something like 850% faster than armel. armel is basically useless in comparison.
Debian's armhf Icweasel 9.0 was actually faster than the native Firefox Mobile 9.0 app on the SunSpider benchmark (by 80ms, but still).
Thanks for your work, looking forward to checking it out.
lokosokol said:
Currently we have images of debian squeezy for armel and mipsel.
Click to expand...
Click to collapse
Very interesting idea, and I'd love to give it a go. Unfortunately, it doesn't work for me. I get an error, "Can't connect to OS image".
The checks run okay, so everything appears to be okay.
I'm using a Samsung GS2, on 2.3.5 (stock ROM), so hardware and OS are more than adequate.
Edit: Okay, so it was the stock ROM that was the problem. I assume it doesn't support loop devices (whatever that actually means!) I've got a custom ROM on there now and it gets a lot further, but I still have an issue.
It gets to the "Starting System" stage and I get the error message "OS start failed (bad program identificator)".
So, any advice?
Thank you for your advice, guys!
nicktastique said:
A bit busy with the holidays and all, but I will give it a look. I definitely recommend checking out armhf. I've been testing it on my Droid 3 and cursory benchmarks show it to be something like 850% faster than armel. armel is basically useless in comparison.
Debian's armhf Icweasel 9.0 was actually faster than the native Firefox Mobile 9.0 app on the SunSpider benchmark (by 80ms, but still).
Thanks for your work, looking forward to checking it out.
Click to expand...
Click to collapse
Thank you very much for this hint — we are working on preparing better system images and will definitely give this option a try.
Archer said:
Very interesting idea, and I'd love to give it a go. Unfortunately, it doesn't work for me. I get an error, "Can't connect to OS image".
The checks run okay, so everything appears to be okay.
I'm using a Samsung GS2, on 2.3.5 (stock ROM), so hardware and OS are more than adequate.
Edit: Okay, so it was the stock ROM that was the problem. I assume it doesn't support loop devices (whatever that actually means!) I've got a custom ROM on there now and it gets a lot further, but I still have an issue.
It gets to the "Starting System" stage and I get the error message "OS start failed (bad program identificator)".
So, any advice?
Click to expand...
Click to collapse
Could you give us a log file of that failed launch? It should be in "/path_to_application_data/log" folder.
I tried it out and I get "Error:OS start failed (timeout expired)
Here is the log:
Code:
############Preparing Base System############
############Preparing Base System Check############
***Checking Ext2 exists/not exists***
true
***Checking system loop device file '/dev/block/wishnuloop' exists***
true
############Preparing Base System Check Finishes############
############Preparing Base System Ends############
############Mounting System Image############
############Mounting System Check############
**Checking /dev/block/wishnuloop mounted/not mounted**
#busybox losetup /dev/block/wishnuloop
/dev/block/wishnuloop: 0 /mnt/sdcard/wishnu/system.img
Return code: 0
**Check /data/data/edu.phystech.wishnu/system mounted/not mounted**
#busybox mountpoint /data/data/edu.phystech.wishnu/system
Return code: 0
############All Correct############
############Mounting System Image Ends############
############Preparing System############
############Preparing System Check############
**Check /data/data/edu.phystech.wishnu/system/dev/pts mounted/not mounted**
#busybox mountpoint /data/data/edu.phystech.wishnu/system/dev/pts
Return code: 0
**Check /data/data/edu.phystech.wishnu/system/proc mounted/not mounted**
#busybox mountpoint /data/data/edu.phystech.wishnu/system/proc
Return code: 0
**Check /data/data/edu.phystech.wishnu/system/sys mounted/not mounted**
#busybox mountpoint /data/data/edu.phystech.wishnu/system/sys
Return code: 0
**Check /data/data/edu.phystech.wishnu/system/media/sharedSD mounted/not mounted**
#busybox mountpoint /data/data/edu.phystech.wishnu/system/media/sharedSD
Return code: 0
############All Correct############
############Preparing System Ends############
############Starting System############
############Starting System Check############
############start from ip_forward############
#busybox sysctl -w net.ipv4.ip_forward=1
net.ipv4.ip_forward = 1
Return code: 0
#busybox chroot /data/data/edu.phystech.wishnu/system /bin/bash -l
su: applet not found
#busybox fuser -k /data/data/edu.phystech.wishnu/system
Return code: 1
#rm /data/data/edu.phystech.wishnu/system/root/.vnc/localhost:1.pid
rm failed for /data/data/edu.phystech.wishnu/system/root/.vnc/localhost:1.pid, No such file or directory
Return code: 255
############Start Failed############
According to the log your busybox is a bit "incomplete" - it doesn't include a chroot applet (which is really strange). I think reinstalling it should solve the problem (in this case busybox installer or BusyBox from android market should help).
I have tried several versions of busybox (1.19.3, 1.18.4, etc) and they all give the same error. It seems that it tries to run "busybox su" when it does not exist..
Ok, this means that we also have some problems with log printing.
Using "busybox su" seemed to be a bit safe command (it worked on all devices we have for testing). Now it turned out that it doesn't work on every device.
By the way I think I should introduce myself - I'm one of the Wishnu developers, so with any problems you can write to me.
The website claims the app on android can run by itself without using a computer. Does this mean the Debian environment is self-contained and can be run as such? The app seems to start linux, but a computer is then required to view the desktop, correct? How does one view the linux desktop from the phone itself?
The app runs fine on my phone. The image file needs to be place on the internal memory, rather than the SD card itself for it to run properly.
Droid 3 running Steel Droid 3 with root.
GoTeamScotch said:
The app seems to start linux, but a computer is then required to view the desktop, correct? How does one view the linux desktop from the phone itself?
Click to expand...
Click to collapse
You can use any VNC client from the android market to get the picture from the linux desktop on your phone.
There connection address is "localhost", port 5901 and password is "android".
You can check gallery on our site to see how it works (photo with phone connected to the TV).
e334 said:
It seems that it tries to run "busybox su" when it does not exist..
Click to expand...
Click to collapse
Checked the source code of the app - version that should be on the android market and the site shouldn't run any "busybox su" command (however it is always possible that we made a mistake).
So first of all I want to make sure that your busybox has chroot applet.
Please, could you perform "busybox chroot " command from the adb shell (or in the terminal emulator in your phone) and post here a result of this command?
If it works I'll attach the launching script (nearly the same we have in the app) and I hope we will find out what's wrong with the launching procedure.
Awesome, thank you very much for the tip! I downloaded a free VNC viewer app from the market and entered the info you gave and it worked! The desktop is a little sluggish but that's sort of to be expected, even with a dual-core phone.
This is very cool software! I didn't realize running Linux on a Droid 3 was possible as of yet because of loopback support. I've been looking into ways of installing Linux since I got the phone, but couldn't find a way around my kernel's lack of loopback. How does your software overcome this obstacle? Are there any plans of improving speed in future releases?
By the way, if your group would like a graphics designer for UI elements or website images I am available! I work for a company in Olympia, Washington making graphics (in-store signs, exterior posters, skins, icons, etc...). This seems like a cool project and I'd be willing to help out for a cup of coffee or something.
Great project.
Do you have more info on building Debian for Android? Also, how much of the "native" Debian UI apps are transferable (and usable) from the phone?

[Q] SSHFS... almost got it working...

I have SSHFS working from a Debian chroot. I have a SGS2 (SGH-i777) with CyanogenMod 9 (2012-06-12 nightly), and everything is working as the root user. I can read the SSHFS mount and the files it contains. My problem is that a normal, non root user cannot read the SSHFS mount. The UID/GID of the mount is 1000/1000, which is the UID/GID of the user that owns the source of the mount (my primary workstation user).
I'm trying to use KeePassDroid to read my KeePass database in place, so any changes I make get immediately reflected in my master file, no need to replicate the file. If I could grant KeePassDroid sudo privileges, I think that would be good enough for me. But I'm stuck. I don't know enough about how users are managed on Android, and I don't know how to give superuser privileges to an arbitrary application (it doesn't appear that the Superuser app that shipped with my root ROM allows for that). Any ideas?
SSHFS... almost got it working... a little closer now....
I've finally gotten a chance to look at this further. It looks like sshfs (the mount utility) has the capability of using an arbitrary UID for the owner of the mount. So, I looked in /data/system/packages.list to determine the UID of the KeePassDroid application. Seems the UID for that app is 10079 on my system. But that doesn't work, because if I log into a shell as that user ("su - 10079"), the keepass directory doesn't even show up in an ls directory listing. I've also tried 10080, which is apparently the UID of the OpenIntents file browser used by KeePassDroid to select the KeePass database. It obviously didn't work.
My next try will be to set the entire chroot to be owned by the 10079 user. I'll post back here if I find success.
[SOLVED]SSFS... got it working...
I finally got it to work, had to pass the -o allow_other option to sshfs, and now my KeePassDroid app can read my database. Next task is to have it load the chroot and sundry stuff automatically, so I have access to my KeePass database wherever I'm at.
Hopefully this information will be useful to the next schmo who tries this. I can already see that this thread shows up on Google.

Categories

Resources