MOVING!!!

Hey there, after several years of playing with Blogger and trying to get thing sorted out how I wanted, I finally decided to host my own domain so I could manage things easier. So this blog (which, admittedly, hasn't been updated much) is getting moved to my all-new site: DavisTobias.com/Linux. Also, to make it easier to transfer RSS feeds, this is the link to the new RSS feed. I'll leave this site and it's posts up, so I don't contribute to dead links on the internet, but I'm shutting off comments and won't post any more here.

June 13, 2009

Adding Samba support to Thunar

Hey there, this site has moved, so comments are disabled. Thankfully, you can go to the page, carefully linked for your satisfaction. Click here to go there.

Thunar does not natively support Samba, which is theLinux port of the Microsoft network folder/file sharing protocol, but support can be hacked in using the following method.

Note that I stole these instructions mostly from here, but I modified them for my conditions, which were: Minimal installation of Ubuntu, plus IceWM.

First make sure you have the correct software, Samba:
sudo aptitude install samba

Now you need FuseSMB, which is the Linux "File System in User SpacE" for Samba. This is found in the Universe repositories, to enable them, run the following (two) commands, borrowed from the official wikisite:
sudo su -c '\ndeb http://us.archive.ubuntu.com/ubuntu/ jaunty universe >> /etc/apt sources.list'
sudo su -c 'echo \ndeb-src http://us.archive.ubuntu.com/ubuntu/ jaunty universe >> /etc/apt/sources.list'
Now that the Universe repository is enabled, installing fusesmb is easy:
sudo aptitude install fusesmb

Now you need to add the fuse module to be loaded when the computer starts. Do this by adding the word fuse to the file /etc/modules, either using a text editor or with this command:
sudo su -c '\nfuse\n >> /etc/modules'

At this point you will need to do a full reboot to your computer so the fuse module loads correctly. Make sure to bookmark this page so you can finish the instructions when you come back!

After rebooting, you need to make a folder where Samba can mount: I made mine /media/network for simplicity. From the command line: sudo mkdir /media/network

Now you will need to make sure the folder has the correct permissions. To do this, open Thunar using sudo thunar which will give you administrator rights, so be careful not to do anything other than this. Right click on your folder /media/network and go to properties. You need to set Group "Access" and "Others" to "Read & Write". Finally, run this command: sudo chown :fuse /media/network

You also need to add the fusesmb code to the folder /etc/init.d which is done by making a script and putting it in that folder. The script is a really simple one, just make a text file on your desktop, name it something descriptive like networkmount, and put this inside:
#!/bin/bash
# This mounts the Samba service to the folder /media/network
fusesmb /media/network

Now make the script executable with this command:
chmod +x networkmount where networkmount is the name of the file
Finally, copy the file into the correct folder, you will need to be an admin, so try this command:
mv networkmount /etc/init.d/networkmount

Now you need to make Samba mount to the correct folder whenever you log in. What I did is add the correct command to the file /home/tobias/.xinitrc , which will run the command when I start X, but you may have a different way. How my .xinitrc file looks now (make sure the exec icewm-session & is last):
fusesmb /media/network &
exec icewm-session &

Now you will need to do a full reboot once more.

That's it! If you open Thunar and navigate to /media/network it will show you the available Samba networks. Note, however, that the response time is a bit slow, I thought I had done it wrong at first, but I was just impatient. If it won't load after a while, try logging out and logging back in, or resetting, to see if it will reinstate correctly.

For added navigations, if you are using the "Shortcuts" Side Pane in Thunar (control + b) you can navigate to /media and drag the network folder to the side pane for quick access! Alternately, make a link to it and put the link wherever it's handy.

test