TechFRP Search

Custom Search

Thursday, October 20, 2011

Install XBMC in Ubuntu Oneiric Ocelot

     I've read a lot of talk about not being able to install the Stable versions of XBox Media Center in recent versions of Ubuntu. You have to go to the Daily Unstable releases or third party downloaders. None of that is true if you just make one Simple Tweak to the Install Instructions directly from

     The instructions on are below:

          sudo add-apt-repository ppa:team-xbmc
          sudo apt-get update
          sudo apt-get install xbmc
          sudo apt-get update
          sudo apt-get upgrade
1   Open a Terminal and enter the first command to add the PPA repository on your PC.
          sudo add-apt-repository ppa:team-xbmc

2   Now Go into Your Software Sources setup.
         In Oneiric you can get there through the System Settings control panel.

3   When you Click on Software Sources you get this:

4   The area we need to change is here, referring to Oneiric.

  These are the lines added by the XBMC install repository command we issued above.

5   The problem with this is that XBMC has not updated their Repository listing on the Web Server since Maverick. So, when Ubuntu looks for this location on the Web Server it doesn't exist and can't install. The good thing here is that we can edit this to Point at the Maverick repository which installs the Latest Stable version and Works absolutely fine on both Natty and Oneiric.

6   Highlight the first entry in the list and click the Edit Button.

   In the Distribution field change oneiric to maverick.
   **Important Note** - use all lower case when entering maverick or it will not work!

7   When done it should look like this, then Click Ok.

8   You will prompted to provide your password to commit the change. Enter it now.

9   Repeat the exact same process for the Second listing if you want access to the Source code through repositories.

10   Finally Continue with the Command Line steps at a Terminal prompt and XBox Media Center will install on your copy of either Natty or Oneiric.

          sudo apt-get update
          sudo apt-get install xbmc
          sudo apt-get update
          sudo apt-get upgrade

You should now have a fully working copy of XBMC installed on your version of Oneiric or Natty.

As always the steps above have been tested and verified in my lab. I am not responsible for any problems you may encounter with your PC. They are pretty straight forward. If you follow the instructions as indicated you should have no problems.

I hope you found this tip helpful. If you did, let me know. Leave a comment or give me a shout on Twitter: @wjgtech.

Monday, October 17, 2011

Tweak Unity 2D Launcher Urgency Alerts in Ubuntu 11.10

     It's been a while since we last had an update here but when it's time, it's time. The latest version of Ubuntu has been released bringing us the Oneiric Ocelot. I'll have a full review coming soon but there is one thing that was begging to be tweaked in the New Release Now. 

     If you are running a PC that doesn't have the ability to do 3D compositing, (IE Virtual Box) then you will be forced to run the Unity Desktop in 2D mode. While this isn't in itself bad, it does present one problem when it comes to the Launcher bar. When another program is running and is asking for your attention the Launcher bar does a little animation where it pops up the Icon for that App in the Launcher bar and Wiggles it back and forth for a couple of seconds before disappearing.

     That's the way it works in the full 3D mode. In 2D mode things are a little different. Instead of just the Icon peaking out onto your Desktop to alert you, the entire Launch Bar Pops Over your active app. Again this isn't too bad except that for some reason in the 2D mode the Settings for this Popup have been configured for an Unbelievably long time. I've timed it on my test station to 7 or 8 seconds before it slides away out of view again. In the computer world, 7 or 8 seconds is an intolerable amount of time to be interrupted. It really becomes a complete distraction for me when Running TweetDeck which has constant Alert popups happening all the time. Very, Very Annoying.

     ...but Fear not patient readers, there is a way to Tweak this. It is fairly simple and straight forward to do in a few easy steps. As always, you should make backups of any files you make changes to before proceeding. All the steps outlined below have been tested in my Test Lab and been found to work as presented. I am not responsible for any unintended consequences that you may encounter while attempting to apply these steps. All right now, lets get to it. :-)

1     The first thing you're going to need to do is Open a Terminal window.
2     Now you need to make a backup copy of the file in /usr/share/unity-2d/launcher
3     To do this enter the following at the prompt, Remember to use Sudo:
        sudo cp /usr/share/unity-2d/launcher/LauncherItem.qml /home/"YourHomeDir"

       You can see the results of the file copy from my Lab here:

4     Now that we have a backup lets edit the LauncherItem.qml file by typing in:
          sudo gedit /usr/share/unity-2d/launcher/LauncherItem.qml

          **Remember: Use Sudo to launch Gedit and the filename is case sensitive. **

5     Now if you've typed everything in correctly you should be looking at the Gedit text editor with the LaunchItem.qml file loaded into it.

6     Scroll down the page until you see this area below. It is approx. 3/4 of the way down the page.

7     The areas to Tweak are:

             loops: (urgent) ? 30 : 0
                    NumberAnimation { target: tile; property: "rotation"; to: 15; duration: 150 }
                    NumberAnimation { target: tile; property: "rotation"; to: -15; duration: 150 }

8     Change "loops: (urgent) ? from 30 to 5 to shorten the number of times the animation runs.

9     Change Both of the "NumberAnimation" entries above from 150 to 75 to increase the speed of the Wiggle.

       When done the entries should look like this.

10   Now, Save the file and close Gedit. You now need to Reboot your PC for the Launcher to pick up the changes. You could kill the Launcher app but I like a clean restart when making changes.

     And that is it. The Launcher Urgency Alerts should take no more than a second or two on your screen before they go away which is much more like the 3D implementation of Unity.

Give it a try, I found this to be Absolutely Necessary with the 2D Unity desktop.

If you found this tip useful, please let me know. Leave a comment or give me shout on Twitter @WJGTech. 

Monday, May 2, 2011

Ubuntu 11.04 Natty Narwhal Review

     Well, April 28th has come and gone and Ubuntu has released another OS revision. 11.04 the Natty Narwhal tries to take things in a different direction from previous releases by introducing a new Desktop interface. The Unity Desktop was first introduced in the 10.10 Netbook Edition as the the default Desktop for the first time but was not very fleshed out. Since then Canonical has been working hard to put some spit and polish on the interface bringing it to the masses with 11.04. Alas, 10.10 was only 6 months ago and although alot of work has gone into the Unity interface much more work was really needed.

     First of all, the Unity interface requires 3D acceleration on the Desktop to function. If you don't have a compatible Video Card for 3D acceleration then 11.04 will tell you the first time Unity loads and default to the Ubuntu Classic desktop which is the same Gnome 2.x from previous releases. Check the hardware compatibility list to see if your Video Card will work with Unity. Now if all has gone well upon first login you'll be greeted with the Unity Desktop. It is fairly slick compared to a standard out of the box Linux Gnome install. The most noticeable change is the Launcher Bar on the left. It is a quick shortcut launcher for your favourite programs.

     You can add your own app shortcuts simply by dragging and dropping onto the Launcher. You can remove items you don't want from the Launcher by right clicking any item and essentially de-selecting Keep In Laucher. It's a bit of an awkward wording for the removal of items, but it is functional. To re-order the sorting of the app launchers you drag an item by pulling it off of the Launcher bar and then back onto the bar in the location that you want. Again, a bit of an awkward way to be re-sorting the items.

      A second big change comes in the form of a Common Menu interface. Similar to Apple's Mac OS the application menu dialog has moved from the application window to the Panel at the top of the screen. The currently active application is controlled by the menu's at the top. Change the application and the same menu is now applicable to that new application. It allows a slightly better usage of the space available on the screen making more room for the actual application.

     One of the other things you will notice missing in this area is the familiar Applications Places System. Places is still up there but the word Applications has been removed and replaced by the single Button in the upper left corner. System can be found in a few places around the desktop, the easiest way to find it is under the Power button in the upper right corner. It presents the Systems settings in a Windows style control panel type of interface.

     The third area you'll notice the biggest change in is when you click the Button (formerly applications) to bring up the App selection. It looks like this:

     As you can see this is quite new and takes some getting used to for finding things. At the top you have a search bar. Enter any part of an application name and it will find it in the list. Below you have various App categories, Media Apps, Internet Apps, More Apps, etc. They hold what you would expect except for the catch all More Apps which literally holds everything else and is so overly full it's almost useless. Once you click to open one of the Root Categories you can select a drop down in the upper right that appears to refine the listing to be more like the familiar menu items you are used to. The perplexing thing here is that the drop down selector isn't available until you've selected a root category. It really should be available from the start.

     Finally, while I have no specific testing evidence the overall feel and responsiveness of the system seems improved over 10.04 and 10.10. Video playback, specifically for Flash based video seems significantly improved and the system so far has been very stable and reliable. It comes bundled with some good apps including Firefox 4.01 and Banshee for multimedia playback. Ubuntu One seems better integrated and and the Ubuntu Software Center is improved again providing an easy interface for installing applications both Open Source and Fee based.

     In the end Ubuntu 11.04 Natty Narwhal is a good OS with many improvements, speed and stability. However, the Unity Desktop leaves a lot to be desired for customizability and ease of use at the moment. Things feel Awkward and unfinished. For example there is no configurability of the Launcher Bar itself and it's graphical effects are seriously limited. Current products like GLX Cairo and Docky provide the same functionality as Launcher with huge advantages in flexibility and Graphics. In fact one could argue that you could have the same desktop interface as Unity with any previous Ubuntu release just by installing Cairo or Docky and placing it on the left side of the screen.

     It seemed to me like there was a lot of Hype surrounding the release of Natty and when hype is that high it is hard for anything to live up to those expectations. With Natty though it is doubly disappointing because of the Hype, and it truly is unfinished. Canonical should have taken another year to continue working on Unity and polish it until it shone brightly. There was no need to make it the default interface at this point in the distribution. I really believe that Canonical felt they needed to push Unity along due to Gnome 3 being released at about the same time.

     All in all I do believe that 11.04 Natty Narwhal is a solid release for Ubuntu and is a worthwhile upgrade. If you don't like the changes in Unity at this point you still have the option of running "Ubuntu Classic" which is the new release running Gnome 2.x. Either way the OS seems fairly solid and worth upgrading to.

     As always, I hope you found this helpful and informative, if you did leave a comment and let me know.

If you were wondering, I've customized my desktop to provide more colour than the default brown.
Redmond Controls
ClearLooks 2 Squared Berries Window Borders (Downloaded)
Oxygen Icon set.

Wednesday, March 23, 2011

Auto Login Troubles in Windows

     We have had a problem for some time now with the new PC's we've been getting. All of them are having difficulty properly logging into the Domain in situations where an Auto Login is configured. Regular manual logins by desktop users have no difficulty, but in situations that call for a PC that uses a predefined Auto Login setup, there are problems.

     When Auto Login is set there is no obvious error until you see that no network resources were mapped. Further investigation reveals that the system used "Cached Credentials" to log the user into the PC. It is like the network wasn't yet ready to accept connections but Windows was. The real problem is that any network resources like, the assigning of a home directory, the running of Login scripts and proper Domain Authentication do not occur. These network resources are accessible after the desktop loads but do not run automatically as they are supposed to.

     We found that if we plugged in a small Hub/Switch so that the PC went to the Hub first, then the Hub went to the Network jack, the problem did not occur. This wasn't a good solution though as we didn't want to have small Hub's all over the place. As a temporary fix it worked but we had to find what the real problem was. We called the Vendors that made the PC's (Big Industry Names) but not one of them could help at all with explaining why their new PC's were doing this.

     After a lot of research, trialling and testing we found a solution. The core of the problem was the New PC's. They were so much faster than the older models that Windows was ready to login before the network card had completed it's speed and duplex auto negotiation. The Auto Login setup will run as soon as Windows is ready and sees an active network. Even though the network link is active, it was taking another second or so before the Speed and Duplex was negotiated with the Switch. At that point Windows uses the Cached credentials because the Domain controller is unreachable. A second or two later the negotiation has completed and the network is accessible but not until after Windows login has occurred.

     We figure out two ways that you can Fix this problem. One would be to disable the Switch's Auto Negotiate settings for that Port. Set it to a predefined speed that is known to be good with the PC. This wasn't considered to be the best solution though because changes to individual Ports tend to be forgotten over time and if the PC is moved the Port will probably be left at the Static settings. The way we chose to correct the problem was to disable the Auto Negotiate feature at the PC. In this way you set the PC itself to the speed and duplex you know it is capable of, in our case 100/Full. Now if the PC is moved to another location it will still work in any Port/Jack and there are no changes required at the Switch.

     Once this was changed every Auto Login functioned correctly. The systems logged in, Authenticated properly with the Domain, mapped home directory assignments and completed the running of all login scripts. This setting may vary with Network card manufacturers but for us it is found under the NIC's Device Properties. Setting it to 100/full instead of Auto Negotiate resolved the problem entirely. By doing this you eliminate the need for interaction between the NIC and the Switch. It takes time for them to figure out the best settings to communicate. When it's statically assigned the network activation happens quicker. It saves you that second or two difference between Windows being ready and the Network being ready.

     If you are having similar problems and haven't been able to figure it out yet, give this a try and see if it solves your troubles. It did for us. :-)

     As always, I hope you found this useful. If you did, please leave a comment and let me know, I'd love to hear from you. Until next time don't forget you can always find me on Twitter @wjgtech.
Have a great day.

Thursday, March 17, 2011

How To: Expanding Windows 2003 Boot Volumes in VMWare

     I've been working alot with VMware lately and there's one thing that has always been difficult. How do you best expand Windows Server partitions from a deployed template? A Template is great but you don't want the hard drive partitions to take up unnecessary space. The problem is expanding those partitions to the size you need for production, but what is the best way. You can use dynamic disk properties to concatenate two partitions into one, but this isn't exactly the best for a production environment. There is a better way using the Diskpart utility, surprisingly from Microsoft. I wasn't too familiar with Diskpart until this past year. We've been looking at upgrade paths from WinXP to Win 7 and have started using the utility. We've avoided Vista like the plague.

     Diskpart is a newer utility from Microsoft that replaces the ancient Fdisk for creating and manipulating hard drive partitions. It's biggest strength is that it is free and that it brings more powerful / modern tools to the Windows world for disk partitioning.  

     As anyone that uses VMWare ESX knows it is really easy to add space to existing Virtual  Hard Drives. The difficult thing is utilizing the extra space in the Windows Server. The problem is compounded when using Templates in VMWare to deploy a server. You want the template to take up as little space as possible when in storage but need to expand that partition to an appropriate size in production. Window's native gui utility Disk Management doesn't have the ability to "Expand" disk partitions (Windows Server 2003). Diskpart though allows you to do that rather easily albeit with a few exceptions but I'll show you how to get around those exceptions as well. 

     As usual all of these steps have been tested successfully in my Test Lab. I am not responsible for any problems that you may encounter. I would also recommend that you only do this on a new Server Template deployment and not a live production system. If you must do this to a live server make sure you "Clone" your server before you begin so you have a backup you can recover from should something go wrong. That being said, if you follow these steps closely you should have no problems.

     First Deploy your server within VMWare's VCenter. Once it's established go in to "Edit Settings" of the Virtual Machine.

     After clicking "Edit Settings" you will see the properties for the Virtual Machine as below:

Highlight Hard Disk 1 and under "Disk Provisioning" increase the provisioned size to whatever you need for production. In this case we'll increase it to 150GB.

     As you can see above the Size has been increased to 150GB. All of this can be done while the Windows Server is on. Hopefully you noticed in the screenshots above there is only 1 Virtual Hard Disk installed in this server. It must therefore be the C: partition of Windows. As I said above there is a catch with DiskPart and the Boot Volume in Windows Server 2003. You cannot "Expand" the partition on the Boot Volume, sort of. It is more precise to say that you cannot "Expand" the Boot Volume while it is Active. The way around this is to attach the Virtual Hard Disk as a second Volume on another server. In this way the Disk you want to "Expand" is not Active. 

     The first thing you need to do is "Shutdown" the server that you want to expand the partition on. Once it's turned off go to the "Edit Settings" of another Virtual Machine that is active.

As highlighted above Click on the "Add" button.

Highlight "Hard Disk" and select the "Next" button.
Choose to "Use an Existing Virtual Disk" as shown above and click on "Next".
We now need to browse to the Virtual Hard Disk File that we want to Expand. Be careful here, you want to make sure that you select the correct disk file for the correct server.

After Clicking the "Browse" button you'll be taken to a listing of your DataStores. Select the DataStore that contains the Virtual Machine with the Hard Drive that you want to expand.
Find the folder containing the files for your Virtual Machine that you want to expand. Select the Hard Drive file and click Ok. The file will have a .vmdk extension.
Once selected VMWare will give the hard drive the next Available Virtual Device Node. Nothing further needs to be done with this screen. Click Next.
The final summary screen will be shown as above. Click Finish to complete adding the Virtual Hard Disk to the server.

     This attaches our 150GB Virtual Hard Drive to the live Windows Server. We now need to go into Windows by opening a Console session to the Server. Once on the Windows 2003 server Open the Computer Management Interface and Highlight Disk Management.
     With Disk Management Highlighted you should see all of the Virtual Hard Drives attached. If you don't see the second Hard Drive right away, Right Click Disk Management in the Left Window and Select "Rescan..." from the popup menu. This should make the second Hard Drive appear in the Window as shown above. You can see the Boot Volume of this server above shown as Disk 0. The Disk we want to expand is shown as Disk 1. You can also see that the 1st partition on that drive is the original 128GB and there is an additional space after that shown as "Unallocated". That is the additional space that we added through VMWare.

     Now we need to open a Command Prompt in Windows. At the command line type "diskpart" and press enter.

Next type "list volume" to see the listing of Hard Disks that are detected by "DiskPart". You can easily identify below the difference between the Boot Volume and Expansion Volume by examining the Sizes.
Next type "select volume 1" and press enter.
Now type "extend" at the command line and hit enter. 
     As you can see above the expansion of the existing partition was successful. You can also see the confirmation of the new size in Disk Management. It now shows 150GB for the full size. Finally type "exit" to close out DiskPart.

     Now we need to clean things up. Go back in to "Edit Settings" of the current Virtual Machine. We need to remove the second drive that we expanded from this machine.
Highlight the second drive, in this case Hard Disk 2 and click the "Remove" button. Make sure that you also select "Remove from virtual machine". We don't want to remove and delete the files, we still need those for the original Virtual Machine. Click Ok to remove the drive.

     Since we didn't remove this drive from the original Virtual Machine it is ready to go. Power on the Virtual Machine and log into Windows when ready. You will get the following prompt. Click "Yes" to reboot and finalize the detected changes.
     After rebooting log back in and open Computer Management, then highlight Disk Management.
     You'll now see that your boot volume C: has been expanded to 150GB and works just fine. If you need to expand a secondary drive attached to the same server it's even easier. Just do the DiskPart instructions again. Make sure to apply all the steps to the drive you want to expand. There is no need to attach the drive to another host virtual machine since it isn't the boot volume. In Windows Server 2008 it gets even easier. Back another time with much briefer instructions on that. 

     As always I hope you found this useful. If you did let me know, leave a comment.

Wednesday, January 5, 2011

How to Create Delays in Batch file Execution

     Happy New Year. It's been a great holiday but it's time to get back to work. I had a need recently to create a delay in the execution of a batch file that I run on one of my servers. The batch file stops and then restarts a service nightly. Sometimes the stop command takes a little time before it actually stops the service and can conflict with the start command since the service isn't in a state ready to restart. For those that don't already know, batch files are sequentially executed command statements. Over the years they have added more complex functionality to batch files but in the end they are still a sequential process. They can be very powerful but are made up of very simple statements. As a result there is no easy command like a count() function, but there is a trick you can use instead.

      At the point in your batch file where you want execution to delay before continuing simply enter:

      ping localhost -n 60

      This will result in the system pinging the localhost PC for a count of 60 resulting in roughly a 60 second delay in your Batch files execution before continuing. The end result is a successful execution delay. You can modify the count number to anything you need to create the length of delay required.

      For me, this was perfect to create a delay for 60 seconds before the batch file attempted to restart the service. Since implementing this line in the the batch file it hasn't failed once to properly stop and restart the service.

      It's a simple little trick that really helps customize your batch files. I hope you found this tip helpful. If you did, let me know, leave a comment or give me a shout on Twitter. @wjgtech.