Mounting Windows Share using smbfs in Kubuntu

On my new Kubuntu box, I wanted to mount my “My Documents” folder that resides on a Windows Server 2003 R2 box. I have always had problems mounting folders due to the nature of Active Directory.

In KDE you can easily mount a share using the built in wizard, but I wanted to mount it as folder so I could access it using command line. First thing to do is install smbfs.

sudo aptitude install smbfs

Next thing we want to do here is make a folder to mount this remote location. I’m going to make it in the /media folder.

sudo mkdir "/media/My Documents"

The quotes are there to allow spaces in the directory name.

After that is this interesting line. If the share your connecting to  has any spaces in the name, you will need to put that option in quotes. Here is my complete line.

sudo mount -t smbfs -o username=blake,password=PASSWORDHERE "//server/UserData/blake/My Documents" "/media/My Documents"

I have made this into a script so I can easily run it when I need to connect.

I hope this has helped you getting your Linux box talking to your Active Directory protected share.

I died… Okay maybe not.

Merry Christmas and a Happy New Year!

I’m sure a lot of you have wondered what happened to me. Well there is one simple answer, school. Unfortunately any spare time I have is spent doing projects and working on homework. If you want to keep track of my doings, I am on Twitter which is on the left side of my blog or you can hit follow on my profile.

Christmas this year was fantastic. You can see all of the pictures that were taken from my family get together on Facebook. After all the probelm with my desktop computer I have finaly figured out how to get it running stable. Turns out all along it was a issue with the OCZ ram. New ram for Christmas and BAM, away she goes. Second gift I recived was a new monitor. It’s nothing fancy, Samsung 21′ widescreen display to replace my 21″ CRT monitor that has seen better days.

Other then that, that was my Christmas. Like I said, the best way to keep track of me is through Twitter and if you need to contact me best way would be by e-mail here. I will be posting another tutorial soon using the old PS2 Head set into a Guitar Pre-Amp and the mic input on World of Warcraft.

Linux vs Windows

As most of you know I am fluent in both Windows and Linux. Yesterday in the #mybb IRC channel, tension was tight between us Linux people and the Windows fan boy Matt (owner of msubuntu who will be sued when the site is launched) A good friend of myn, DrPoodle had had it with Matt. So with the help of MiNT we started to produce a list of all the reasons why Linux was better then windows. For any of you Windows fan boys… eat this…

1) Linux is free.
2) Linux is faster (another IRC user, tmhai, was astounded earlier today at how his laptop booted in under 30 seconds with Ubuntu, compared to the 30 minutes it took Windows to boot on it).
3) Linux is Open Source (which means bugs and security holes are found and fixed quicker).
4) With Linux, you own your Operating System. With Microsoft Windows, you don’t actually “own” the Operating System, you simply have a license that says you can use it. Every installation of Windows is owned by Microsoft.
5) Linux has better support. This is debatable, but there are a lot of community forums out there, and usually errors in Linux are much more readable than Windows errors, which leads to quicker solutions.
6) Linux has package managers. Most distros come with some form of package manager, a utility that installs safe and secure programs, and then updates them automatically.
7) Linux has daily updates. Most distros release daily updates of core files, as well as updates for programs.
8) Linux has releases every 6 months. Most distros release their next version every 6 months without fail. So instead of waiting an uncertain amount of time for the next Windows release, you know exactly when the next version of your OS will be out.
.. To read all the reasons, click Here.

If any of you Windows people have anything that could possibly have a case against Linux. I ask you to sign up on my forums and post your reasoning.

Windows XP Pro Upgrade

Yesterday I upgraded my Desktop and Laptop PC’s to Windows XP Pro. I wanted to have them join my domain here at home so I wouldn’t have to type my username and password in all the time.

First one I did was my Desktop. I ran a fresh install after the upgrade failed very badly. (Video card wouldn’t recognize) So with a fresh install of XP Pro I joined it to the Domain which is served by my Ubuntu Linux server. Joining it was no problem. This is how I did it

Start -> Right Click on My Computer -> Properties

Then under “Computer Name” tab, click on “Change…”

Where you see “Member Of” click the “Domain:” button then type in your domain. In my case it was “miller”.

Now you need to restart your computer. Now here where I had another problem. All Domain Controllers have a logon.bat script witch is run every time any user logs on to a computer within the network. Now in my home, we have never had Windows XP Pro so this is the steps I had to go through to get it working. On the server there is a Samba server that basically talk on the windows protocol. I followed this tutorial on how to setup the server.

Ok now I’ll get to the good part. In the /etc/samba/smb.conf file there is few lines that read this…

# Default logon
logon drive = Z:
logon script = logon.bat
logon path = \\server1\profile\$U

So that worked fine when I was connecting manually to the shares but now that I want permissions and such working I need this logon.bat to work. After going through a few Google Search pages I figured out how to get this to work. All I had to do was add the line “path = /home/netlogon” So when I was done though’s few lines, it looked like this…

# Default logon
logon drive = Z:
logon script = logon.bat
path = /home/netlogon
logon path = \\server1\profile\$U

Ok now I created a logon.bat in the /home/netlogon folder. My logon.bat mounts three shared drives I have created. (The How To Forge link will show you how to make other shared folders.)

net use Y: \\server1\shared
net use X: \\server1\programs
net use W: \\server1\pictures

So now your asking your self “Why didn’t he use Z:?” Will I didn’t because I specified Z: as the mounting point for the users home directory in the smb.conf. So now I can logon and off my computer with ease. My dad and sister can logon my computer and have access to all there files and none of myna.

Next I’m going to talk about upgrading my laptop. Now I ran the upgrade from XP Home to Pro. Every thing went well till I started using certain things. First thing I notices was Windows Updates would not run. It said there was 34 to install, but when I would run them they would all fail. The second thing I noticed was Internet Explore 6 was installed. So again I went to my good friend Google and started searching. A few people have had this problem and the easiest way to fix it was to make a simple batch file. I will go through this step by step.

  1. Open up Notepad (Start -> All Programs -> Accessories -> Notepad
  2. Copy the following lines into the file
  3. regsvr32 /s wuapi.dll
    regsvr32 /s wuaueng1.dll
    regsvr32 /s wuaueng.dll
    regsvr32 /s wucltui.dll
    regsvr32 /s wups2.dll
    regsvr32 /s wups.dll
    regsvr32 /s wuweb.dll
  4. Now save the file as update.bat onto your desktop
  5. Close the file then open it from the desktop.

Or Download the Batch file from Here

windows-update-fix.bat

A command prompt window should pop-up then disappear. Now if I run Windows Updates all install will work. Basically XP Pro Upgrade took out all the patches that XP Home had. But XP Pro didn’t know what was already there. So by running “regsvr32” we tolled windows that, Hey these files are here. Windows Updates is now fully functional.

Well hope this helps you in your indevers of Windows and Linux. If you have any questions or comments please post them on the Forums.