-= My first offering to XFCE goddess =-
pyNeighborhood enables you to access your local network, mounting and unmounting shared folders, almost (yes, almost) 100% GUI – point and click. It works with both Windows and Linux shares,though I will cover the more problematic Windows share here. There are few guides floating around regarding pyNeighborhood but they falls short in tackle certain part as well as pose potential hazardous root access and alteration through file manager.
~* INSTALLATION *~
$ sudo apt-get install pyNeighborhood
~* CONFIGURATION *~
1. Set up the directory to be mounted
- If you prefer less troublesome procedure then just create one folder in your ‘/home/[username]‘
- I prefer not to cluster my home, so I will set up the mount point in “/mnt/lan”
$ sudo mkdir /mnt/lan $ sudo chown tux:tux /mnt/lan
You need to change ‘tux:tux’ to your username (owner) and group. Say your username is ‘foo’ then the syntax will be ‘foo:foo’.
2. pyNeighborhood can be accessed through “Applications” -> “Network” -> “pyNeighborhood”
3. Now, select “Edit” -> “Preferences” in pyNeighborhood.
- ‘General’ tab: ‘Mount folder’ will be the path to the folder we set up in step 1.
- ‘Network’ tab: Tick ‘Always use msbrowse’ if unchecked as well as ‘Try to retreive IP address when adding a machine from the group browser’.
- ‘SMB’ and’CIFS’ tab: append this chunk in front of each command. Say my username is ‘tux’ again, for example SMB tab mount command will now be:
‘sudo -u tux smbmount’
Repeat the same for the rest of the mount and unmount command but replace your username instead of tux.
This step is IMPORTANT because it let you mount without entering root password and your filemanager will not having root access thus avoid the potential hazardous alternation. Everything will be inside your userspace only. The -u (user) option causes sudo to run the specified command as a user other than root.
- ‘File Managers’ tab, remove the xterm one and a new entry: ‘thunar’ (or whatever filemanager you are using).
~* USING pyNeighborhood *~
From the left panel, you will see an icon with a name of ‘Groups’. Select it then Right click and select ‘Scan using msbrowse’
Your local workgroup will appear in the left panel under ‘Groups’, so right click on it and click ‘scan’ to show the machines under that workgroup. [Error might occur here, go to troubleshooting part later in the guide]
Choose a machine to browse, right click on it, and click ‘Add’. Alternatively, you can also double click. Try to retrieve the machine’s IP address if it is not already entered, and then click ‘Ok’.
The machine will appear in the right hand pane. Right click on the machine and click ‘scan’ to show the machine’s shared folders.
To mount a share, right click on it and click ‘mount -> mount as SMB’ (note: if SMB does not work the share will automatically be mounted through CIFS). Alternatively, you can also double click. You will see the ‘Mountpoint’ beside change to the path of your mount folder.
Right click the share, ‘unmount’ to unmount or ‘File Manager’ to access the file.
Have fun!
~* Troubleshooting *~
Thing will get a bit frustrating when you see this error on the status bar when you try to scan for machine under workgroup: ‘Failed to scan workgroup WORKGROUP’. Here we have to use commandline to get detail for the machine on the network then add to pyNeighborhood.
Open your terminal, type in the following command, note the workgroup and machine.
$ smbtree -S WORKGROUP
\\HP040
So there is a machine HP040 in workgroup WORKGROUP. Now we will have to look for the IP of the machine we want using the following command. Just replace HP040 with whatever the smbtree spit out or the machine you want to connect to.
$ nmblookup -I \HP040 querying HP040 on 192.168.1.255 192.168.1.64 HP040<00>
The IP of HP040 is 192.168.1.64, so note that down.
Go back to our pyNeighborhood, ‘Edit’ – ‘Add Machine’
‘Network Name’ : Name of the workgroup spit out by smbtree
‘IP address’ : the ip above
‘Display in a list as’ : whatever you fancy of.
That’s it. We’re done. You can mount and view the machine from the right panel.
A picture speaks a thousand words:

Do I need to uninstall samba and fusesmb?
No, you can keep them. It is always good to have alternative.
idyllic-
Great how to. Thank you very much. The only part that didn’t work for me was changing the commands in preferences to sudo -u smbf etc. I had to delete the “-u” and mount the files as root, otherwise pyneighborhood returned a “failed to mount” on the machines I added.
Hi, you have to add your user name after “-u”. It will execute sudo in user space. Say my username/logon_name is ‘idyllic’. The corresponding syntax for the command will be
“sudo -u idyllic smbf”
Hope that clarify your doubt.
hello,
after nights on my xubuntu now it is possible ti see the directory of the windows:
lack of IP number of the other machine on my pyNeighborhood, now everything is good
many thanx!!
Being a “tux” user, what is it good for to use “sudo -u tux mount.cifs” instead of directly “mount.cifs”?
Or is pyNeighborhood run with superuser privileges and therefore we need to run mount.cifs as unprivileged user?
I have spent few hours trying to get pyNeighborhood work, finally succeeded.
In your how-to, if pyNeighborhood is run under a regular user (tux), then the use of “sudo -u tux smbmount” does not make any sense (the permissions remain the same) and mounting would fail, unless /sbin/mount.cifs and other commands have been previously set as suid:
$ sudo chmod +s /sbin/mount.cifs
Which means that a regular user can run the mount command as if he was the root.
This could cause a security problem: If the user does not want to set suid bit to the mount commands, then he/she can run pyNeighborhood as root (gksudo pyNeighborhood) instead. To avoid starting nautilus/thunar in root mode, the command for file manager would be “sudo -u tux nautilus”.
P.S.1 BTW, it took me some time to find out that if the user has a password longer then 16 characters, then the mount command fails (this is a bug in mount.cifs).
P.S.2 Also, it is not clear how you meant:
“This step is IMPORTANT because it let you mount without entering root password…”
Ubuntu has root account disabled in default, therefore there exists no root password.
Running a sudo command requires the user to enter his own password (not root!) to get root’s or some other user’s permissions for running the command.
The password may not be required at all, but only when the /etc/sudoers file is set accordingly (which is not a default behaviour).
The only case when user’s password is not required is when he tries to run the command under his own user name (ie. the user tux runs “sudo -u tux command”). But then the use of sudo does not make sense.
Hi,
Thank for the response.
In Ubuntu, you can’t mount without root permission or the folder is not owned by you. So ‘sudo -u username command’ will enable you to do so. This is perfect for giving user the power to run this single processe without giving him anything else. That’s why it avoids user’s potential hazardous operation.
Secondly, mount.cifs in my box give segmentation fault everytime you run it as normal user meaning just run ‘mount.cifs’ alone will cause segmentation fault.
thanks man.
keep up the good work.
have a good day.
this is what i looking for along time…many thanks
Worked fine in 9.04 but no longer works in 10.04. Any ideas?
Yeah, it doesn’t work for my home local network anymore. I mean using smbtree and nblookup. It works perfectly at mine office though. I don’t use xubuntu anymore so I can’t help you with pyneighborhood anymore. So far, the best smb browser for me is SMB4K (KDE) and Nautilus (GNOME).
yea me too it wont work on 10.04
[...] Network Browsing with pyNeighborhood in Xubuntu Jaunty June 200913 comments 5 [...]