Archive

Posts Tagged ‘smb’

How to mount a Windows share on startup

April 28th, 2014 2 comments

I recently invested in a NAS device to add a little bit of redundancy to my personal files. With this particular NAS the most convenient way to use the files it stores is via the Windows share protocol (also known a SMB or CIFS). Linux has supported these protocols for a while now so that’s great but I wanted it to automatically map the shared directory on the NAS to a directory on my Linux computer on startup. Thankfully there is a very easy way to do just that.

1) First install cifs-utils

sudo apt-get install cifs-utils

2) Next edit the fstab file and add the share(s)

To do this you’ll need to add a new line to the end of the file. You can easily open the file using nano in the terminal by running the command:

sudo nano /etc/fstab

Then use the arrow keys to scroll all the way to the bottom and add the share in the following format:

//<path to server>/<share name>     <path to local directory>     cifs     guest,uid=<user id to mount files as>,iocharset=utf8     0     0

Breaking it down a little bit:

  • <path to server>: This is the network name or IP address of the computer hosting the share (in my case the NAS). For example it could be something like “192.168.1.1″ or something like “MyNas”
  • <share name>: This is the name of the share on that computer. For example I set up my NAS to share different directories one of which was called “Files”
  • <path to local directory>: This is where you want the remote files to appear locally. For example if you want them to appear in a folder under /media you could do something like “/media/NAS”. Just make sure that the directory exists (create it if you need to).
  • <user id to mount files as>: This defines the permissions to give the files. On Ubuntu the first user you create is usually give uid 1000 so you could put “1000″ here. To find out the uid of any random user use the command “id <user>” without quotes.

So for example my added line in fstab was

//192.168.3.25/Files     /media/NAS     cifs     guest,uid=1000,iocharset=utf8     0     0

Then save the file “Ctrl+O” and then Enter in nano.

3) Mount the remote share

Run this command to test the share:

sudo mount -a

If that works you should see the files appear in your local directory path. When you restart the computer it will also attempt to connect to the share and place the files in that location as well. Keep in mind that anything you do to the files there also changes them on the share!




I am currently running a variety of distributions, primarily Ubuntu 14.04.
Previously I was running KDE 4.3.3 on top of Fedora 11 (for the first experiment) and KDE 4.6.5 on top of Gentoo (for the second experiment).
Check out my profile for more information.
Categories: Linux, Tyler B Tags: , , , , ,

Accessing Windows 7 Shares from Ubuntu is a Pain

June 28th, 2010 16 comments

This blog post is about my experiences. If you hit this page from a search engine looking to fix this issue click here to skip to the solution.

Recently, I’ve been reorganizing my computers based on their usage. My old HTPC, has resumed its duties as my primary desktop/server, my Mac Mini has been attached to the my desktop through Synergy, my server was given to my brother for personal use, and his old computer – a nettop – is now being used as our new HTPC.

After a painful decision making process – a topic for another time, and another post – I decided that this nettop, named Apollo after the Greek god of many things including “music, poetry, and the arts” [as close as I could get to entertainment],  should run Ubuntu 10.4 with XBMC as the media center app. After testing it’s media playback capabilities from a local file, I was rather impressed. I set out to add a SMB share from within XBMC, and was prompted to add a username and password.

I wasn’t really expecting this, because Leviathan – my desktop/sever running Windows 7 – has public sharing turned on, as well as a guest account. I entered in my credentials, and was asked yet again for a username and password. After trying multiple times, I decided to quit XBMC and see if I could get Ubuntu to connect to the share. Here too, I was prompted for a username and password, again and again.

Next I headed to the terminal to run smbclient. This didn’t work either, as I was shown a message saying smbclient failed with “SUCCESS – 0″. I guess success shouldn’t be zero, so my next move was to attempt mounting the network share using CIFS. Again, I was met with repeated defeat.

Begrudgingly I took to the internet with my problem, only to find that there were many people unable to connect to their Windows 7 from Ubuntu. The suggestions ranged from registry hacks to group policy administration, none of which worked. One repeated suggestion however, was to un-install the Windows Live Sign-in Assistant. However, as a user of the Windows Live Essentials (Wave 4) Beta that was recently released – I had no such program. I did however have a similar application called the Windows Live Messenger Companion, which I chose to uninstall – again, to no avail.

However, I soon reasoned that perhaps whatever was blocking people using the Windows Live Sign-in Assistant was now being used within the actual Windows Live Messenger client or the other Windows Live Essentials apps that I’d recently installed. I started by uninstalling everything but Windows Live Messenger – because I really, really like the beta version. Alas, this did not help. Next I uninstalled the actual Windows Live Messenger client and voila – I was able to connect with no prompting for passwords at all. Because that makes -any- sense.

As a matter of interest, I installed the regular WLM non-beta client and made sure that the Windows Live Sign-in Assistant was installed, and tried to connect again. Not surprisingly, I was no longer able to connect to my Windows 7 shares. After un-installing the Windows Live Sign-in Assistant my shares were back up and I was mostly happy. Except that I couldn’t use the new Windows Live Messenger beta.

I can’t be sure if the other tinkering I did also helped clear up my problems, but as a recap here are the steps I recommend to access your Windows 7 shares from Ubuntu:

1) If you have the Windows Live Essentials (Wave 4) beta installed, you’ll have to uninstall all of the applications that come with this. For now, you can install the current version of Windows Live Messenger and the other Windows Live Essentials.

2) If you have Windows Live Messenger installed, or ANY of the Windows Live Essentials programs installed check to see if you have the Windows Live Sign-in Assistant installed. If so, uninstall it.

3) Hopefully, now you can enjoy your Windows 7 shares in Ubuntu

Important Note:

Beta software has this nasty habit of leaving beta status sooner or later. If this issue is not resolved when the newest version of Windows Live Messenger is officially released, you may not be able to use the Window Live Messenger client if you need your Windows 7 shares from Ubuntu. I would suggest using an application like Pidgin as your instant messenger, as it can also connect to the Windows Live Messenger service. Other options include Digsby, Miranda, and Trillian.

Originally posted on my personal website here.

XFCE: A Bitch Session

October 14th, 2009 10 comments

After a full day of using XFCE as my new desktop environment, I have just a few complaints, handily summarized in the following ordered list:

  1. No Alt-Tab: I was under the impression that alt-tab window switching was a standard feature of every desktop environment since at least Windows 98. So where the hell is it in XFCE? Nowhere! That’s where! Instead, I enabled the ring switcher plugin for Compiz, which I had to run in order to use GNOME Do anyway.
  2. Default Browser Doesn’t Save: This one started out with the crappy default web browser that comes with XFCE, Web Browser 2.26.3. It is allegedly a GNOME project (which is odd to say the least, since this is XFCE, and GNOME defaults to the Epiphany Browser). In any case, even after setting the default browser to Firefox (Iceweasel in my case), the system still launches all links in this inferior app.
    Screenshot-Preferred Applications
  3. Cursor Set Doesn’t Apply Immediately: Along with changing the default web browser for my system, I changed the cursor set. The default one was ugly, so I grabbed some new ones from Synaptic, and set one in the mouse theme options dialog. The problem is that the cursor set doesn’t change until some random amount of time has elapsed after I log on. So my session begins with the old, ugly cursors, and then eventually gets around to changing over to the prettier new ones. What the hell?
  4. GNOME Do and Screenlets Don’t Always Start: This one is likely related to running Compiz on top of XFCE (which includes it’s own compositing engine), and the order of startup applications. In any case, sometimes when I log on, GNOME Do and Screenlets fail to start, and I have to bring them up manually. I have a feeling that this is because Compiz hasn’t yet started, and the applications fail, as they rely on it being there. Still, a hearty WTF to this one as well.
  5. Default File Browser Lacks Network Locations: The XFCE default File Manager is Thunar 1.0.1, which is fine, except that it does not include any way to browse network shares. In GNOME, I can hit the ‘Network’ place, and immediately view any available SMB share drives on my local network. As of yet, I haven’t figured out how to find or mount network locations through the XFCE GUI.
  6. The ‘Start’ Menu Fails: I never thought that I would say this, but I find myself longing for the Applications/Places/System menus of GNOME, instead of the mashed together start menu that is present under XFCE. Although this could just be because I’m not yet familiar with XFCE, I find it harder to locate programs in this menu system. The GNOME organization just felt more logical once you got used to it.
  7. Lack of Default Features: This speaks mostly to the organization of XFCE. Instead of including every imaginable feature in the default install, extra features are added through a series of plugins, so as not to bog down machines that don’t require them. As such, my default install did not include a battery level indicator, a wireless network strength monitor, or a slew of other ‘basic’ desktop environment features. Installing the package xfce4-goodies fixed all of these problems.

Of course, not everything about XFCE is bad. So far, I’ve found it to be stable and exceedingly fast. X11 hasn’t crashed once, although I have no doubt that it will; and once I installed the xfce4-goodies package, I found the environment to be very functional. Overall, I am pleased with my choice, even though there have been some minor setup annoyances.




On my Laptop, I am running Linux Mint 12.
On my home media server, I am running Ubuntu 12.04
Check out my profile for more information.