*

Welcome, Guest. Please login or register.

Get your own OLPC - Buy an XO laptop on eBay!
Pages: [1]
Print
Author Topic: Connecting to Home Network Share  (Read 8427 times)

Connecting to Home Network Share

XOIOWA
Senior Contributor
**
Posts: 119



September 21, 2009, 07:03:30 PM

I'm trying to learn a bit about home networking.  And, I've spent many, many hours now trying to connect to my home network shared folders with the XO, and I'm just having no luck.  Any help would be appreciated.

First, the scenario: 
A desktop computer running Ubuntu 8.04, which has a shared folder /shareme
An XO running teapot's Intrepid
A WinXP laptop (for checking things)

I have created the share, on the destop computer, and I know it works, because I can access it with the WinXP computer.

I've been trying to get the XO to also access the share.  I started with the instructions here:
http://www.olpcnews.com/forum/index.php?topic=4053.msg30052;topicseen#new
But there is definitely some missing info in that post.  For instance, I wasn't able to "sudo users-admin".  I think that's a debian-only command.  I couldn't find it in Synaptic.  I've searched a lot of other websites for help on Xfce, and Fuse, but I don't know enough about it to apply the concepts to my XO.

I would appreciate any help at all on doing this.  For the curious, I consider my self a Linux "fan".  I'm comfortable at the command line (for the commands I know) and I've tinkered with many distros over the years.  But there are definitely large gaps in my knowledge.  I'm not afraid to try, search for answers, and learn.  But right now I'm pretty well stuck.  Thanks.
Logged

#1 Re: Connecting to Home Network Share

markhadman
Senior Contributor
**
Posts: 112


September 22, 2009, 01:50:13 AM

This:

Code:
sudo apt-get install gnome-system-tools

should get you the users-admin proglet installed. However, it is possible to set up users and groups directly from the command line using adduser, addgroup etc.


One more thing - use the -s switch with fusesmb, i.e.

Code:
fusesmb -s ~/smb

this tells FUSE to use a single processor thread, otherwise it tends to crash with 'Transport endpoint not connected' after a while. I will also update the other message thread to reflect this discovery.
Logged

#2 Re: Connecting to Home Network Share

XOIOWA
Senior Contributor
**
Posts: 119



September 22, 2009, 05:20:17 AM

Okay,

I installed the gnome-system-tools package, and now can launch the users-admin program.  But, I can't "unlock" it.  If I try to launch it from the menu, I get a permission denied message.  So, I tried all of the below from a terminal:
users-admin
sudo users-admin
gksudo users-admin
gksu users-admin

In all cases, I can't unlock the utility.  But... that's a secondary problem.  I did discover by reading the /etc/group file, and by issuing "groups olpc" that I did already manage to create a fuse group, and add user olpc to that group.  So, as far as that goes, I should be all set.  (Unless those are not set up correctly)

So, now I issue the following command:
fusesmb -s ~/smb

And the result:
fuse: failed to open /dev/fuse: Permission denied

Any hints?  It seems like no matter what I do I'm running into permissions issues that I don't understand.  I guess that's why I'm going through this exercise... to learn how to make this work.

Thanks in advance.
Logged

#3 Re: Connecting to Home Network Share

markhadman
Senior Contributor
**
Posts: 112


September 22, 2009, 10:08:57 AM

Okay,

I installed the gnome-system-tools package, and now can launch the users-admin program.  But, I can't "unlock" it.  If I try to launch it from the menu, I get a permission denied message.  So, I tried all of the below from a terminal:
users-admin
sudo users-admin
gksudo users-admin
gksu users-admin

In all cases, I can't unlock the utility. 

Code:
sudo su
users-admin

But... that's a secondary problem.  I did discover by reading the /etc/group file, and by issuing "groups olpc" that I did already manage to create a fuse group, and add user olpc to that group.  So, as far as that goes, I should be all set.  (Unless those are not set up correctly)

So, now I issue the following command:
fusesmb -s ~/smb

And the result:
fuse: failed to open /dev/fuse: Permission denied

Any hints?  It seems like no matter what I do I'm running into permissions issues that I don't understand.  I guess that's why I'm going through this exercise... to learn how to make this work.

Thanks in advance.

Code:
ls -l /dev | grep fuse
will show the owner and group of /dev/fuse. If it isn't owned by a group that you are a member of, I suggest
Code:
man chgrp
and take it from there.
Logged

#4 Re: Connecting to Home Network Share

XOIOWA
Senior Contributor
**
Posts: 119



September 24, 2009, 04:55:54 AM

Woo Hoo!  It works, it works, it works!

It did take me some extra work to figure this all out.  First, the users-admin utility does not display the olpc user account, only a root account.  Some searching in the Ubuntu forums led me to understand that this is a bug in Ubuntu Intrepid resulting from manually editing the /etc/passwd and /etc/group files.

Next, I accidentally did "usermod -a -g fuse" instead of "usermod -a -G fuse" one time.  It's very easy to do on the XO with a flakey shift key.   I noticed my mistake immediately, and thought I corrected it.  In all these attempts nothing seemed to change, though.  That's when I realized I needed to reboot to apply the changes.   Upon rebooting, I discovered that my mistake actually removed me from all groups, except "daemon" and "olpc".  So, now I was really stuck, since I had no access to a root account, and was not part of the sudoers group.  Sigh.

Fortunately, though, I was doing all of this on a USB drive install of the OS.  I booted my XO from the SD card, which also contained an install of Ubuntu, mounted the USB drive, and copied the /etc/group from the SD card.

From there I was able to reboot from the USB drive, add user olpc to the fuse group, and successfully mount and browse the shared folders using "fusesmb -s ~/smb"

I was able to see files from my desktop computer, and to place new files onto it. 

Thank you for your help.  I definitely achieved my goal of learning something in this whole endeavor.
Logged

#5 Re: Connecting to Home Network Share

markhadman
Senior Contributor
**
Posts: 112


September 24, 2009, 06:13:10 AM

It's quite exhilarating isn't it?

Fusesmb seems to be a really quite stable and persistent little tool with the -s switch (which really should be the default). I have a music player (moc) open all the time on my XO and reading from a samba share on my Debian server, and it's so far never failed to work, even if I've sent the XO to sleep, turned wi-fi off and on again or spent time out of range since I last used it.


In all these attempts nothing seemed to change, though.  That's when I realized I needed to reboot to apply the changes.  
Actually, you probably just needed to log out & in.

Upon rebooting, I discovered that my mistake actually removed me from all groups, except "daemon" and "olpc".  So, now I was really stuck, since I had no access to a root account, and was not part of the sudoers group.  Sigh.
Which is why I decided to set a root password before I started messing Smiley

Glad you got there in the end. Perhaps you could write a howto ?



Logged

#6 HowTo: Connect to Home Network Shared Folders

XOIOWA
Senior Contributor
**
Posts: 119



September 25, 2009, 05:02:44 AM

How To:  Connect to Home Network Shared Folders

I think this is the first time I've attempted to write a How To for anything Linux related.  After many false starts, misunderstandings, and mistakes, and with a lot of help from others, I've finally been able to set up my XO to see shared folders on my home network.  Here is the basic outline of what to do (though I didn't do it this cleanly).

For my situation, my desktop computer is running Ubuntu 8.04 LTS, and I shared some folders on it using the shares-admin utility.  The Ubuntu Intreprid build does not have the modules built in to do samba or cifs file sharing, so here we're using FUSE (Filesystem in USErspace) to mount the shared network folders to a directory in the user's home directory.  The steps below assume you've already set up the shared folders on your home network, so everything below is done on the XO to enable it to see those shares.

Launch the Synaptic Package Manager
  Install fuse-utils, and fusesmb (along with whatever dependencies they require)

Now, from the Terminal:

Make a new group called fuse
  
Quote
sudo groupadd fuse

Add your user to the fuse group
  
Quote
sudo usermod -a -G fuse username
 Replace username with 'olpc' or whatever user you'd like to use
  Also, be sure to use -G and not -g... they mean very different things
  Check the manual page to see the difference  
Quote
man usermod

Make a directory where you will mount the shared folders
  
Quote
mkdir ~/shares
 Of course, you can name it anything you like.  I just chose 'shares' for this example

Fuse must be assigned to the group fuse so that members of the group can use it
  
Quote
sudo chgrp fuse /dev/fuse

Finally, issue the command to mount the shares
  
Quote
fusesmb -s ~/shares

For me, the shares didn't show up right away.  It was almost as though it took a little time for them to be found and mounted.  But, in a little while I was able to launch the Thunar file manager and read the files that were on my desktop computer from my XO!

I'm still learning a lot about how to handle this, and the file permissions needed for read/write access of the folders.  I'm also uncertain about how to set up the firewall on my desktop computer.  For this setup, I simply disabled the firewall so that it would allow the XO to see the shares without that added complication.  

Logged

#7 Re: Connecting to Home Network Share

markhadman
Senior Contributor
**
Posts: 112


September 25, 2009, 05:47:44 AM

Nice one, it's good that you've put it all together in one place. Maybe it's one for wiki.laptop.org ?
Logged

#8 Re: Connecting to Home Network Share

jm
New

Posts: 3


October 29, 2009, 09:39:52 AM

Hi:
The guide is great, but I think I'm still missing something. I'm pretty sure I got all the steps right, but nothing shows up in the shares directory. Is there a step where I'm supposed to give the location of the file server, ie., the source of the share? I have a USB attached to a router running Tomato. I can see the shared directories on my windows XP boxes. I can ftp to then in firefox on the XO.

Thanks in advance,
Jonathan
Logged

#9 Re: Connecting to Home Network Share

XOIOWA
Senior Contributor
**
Posts: 119



October 31, 2009, 07:49:53 AM

Um, well... the answer at this time is "I don't know."

I barely made it through the above steps with lots of help from others on the forum, and to be honest I don't really understand all that's going on there.  For me it was an exercise in learning how to network -anything- since I had never really done that before.

Just one thought:  Did you reboot after doing the above steps?  My permissions didn't work until I rebooted.  Or, as markhadman pointed out, only a logout/login was necessary.  From what I understand, once fuse is started as a service, and you issue the fusesmb -s ~/shares command, whatever shares are on the LAN become available.  I don't know for sure, though.

Maybe someone else has a hint?
Logged

#10 Re: Connecting to Home Network Share

jm
New

Posts: 3


November 06, 2009, 09:35:01 AM

Looking at your reply, I'm wondering if fuse IS started as a service on my XO. How would I figure out if it's running? Which is the step in your guide that starts it?

Thanks for your help,
Jonathan
Logged

#11 Re: Connecting to Home Network Share

XOIOWA
Senior Contributor
**
Posts: 119



November 08, 2009, 02:25:09 PM

I'm not sure this is much help, but here goes:

I shut off the firewall on my desktop computer (the one with the shares) and started with my XO powered off.  I don't know how to get the firewall to let fuse through, so I have to shut it off for the time being, until I figure that out.

So, I booted the XO, and went to the Xfce4 Taskmanager from the Application Menu | System menu.  I scanned through the list of running things there, and watched my cpu meter move around.  There was no sign of fuse.

Next, I launched a terminal window, and issued the command "fusesmb -s ~/shares".  I then looked again at the Taskmanager.  Still no fuse.  I waited a little while (probably only a minute) and sorted the tasks by the column header to see if it would "refresh" the list.  But, nothing.  So, from the terminal, I did a "cd shares", then "ls" and saw "WORKGROUP".  Then I did a cd "WORKGROUP" and saw my desktop computer, and subsequently saw the shared folders on it.   So, it was working at this point.

Finally, I went back to the Taskmanager and looked again.  This time there was a fusesmb entry in the list.

That's all I really know at this point.
I don't have much experience doing any kind of networking yet, so I'm hoping someone else can jump in with some troubleshooting tips.

Hope it helps.
Logged

#12 Re: Connecting to Home Network Share

jm
New

Posts: 3


November 09, 2009, 07:46:51 AM

Success!

Since you didn't actually provide anything new in the last message other than diagnostics, I'm not sure what's different today vs. any of the previous times I tried to get this to work, but work it does.

The one thing I did different today was change the name of the workgroup on Tomato's NAS file sharing page to something other than the default 'workgroup'.

Who knows what will happen tomorrow, but thanks for your guide and all your subsequent help.

Jonathan
Logged

#13 Re: Connecting to Home Network Share

XOIOWA
Senior Contributor
**
Posts: 119



November 11, 2009, 05:25:39 AM

Hey,

Glad you got it to work.  I do wish I understood more of the "magic" that happens surrounding this stuff.

Happy file sharing!
Logged
Pages: [1]
Print
Jump to:  

Members
Total Members: 2406
Latest: sembik
Stats
Total Posts: 31943
Total Topics: 3843
Online Today: 28
Online Ever: 238
(April 18, 2011, 09:48:50 PM)
Users Online
Users: 0
Guests: 16
Total: 16