Monday, May 22, 2017

FreeBSD 11 as a Guest OS in VMWare Workstation 12 Player

FreeBSD installer has always been very crude. When VMWare Tools does not work under FreeBSD 10 and 11, it really makes things a lot worse. After all, with relatively very low popularity, FreeBSD's most likely target is VMWare.

Currently, as of May of 2017, the officially supported FreeBSD version by VMWare Tools is 9. Yet if you do try to install FreeBSD 9 in VMWare Player 12, you will find that even "portupgrade" does not build. This was a known problem at the time of the Version 9 release, yet somehow in the official FreeBSD 9 release DVD, this was never fixed. The "UPDATING" file for FreeBSD 9 Ports does provide URLs for DIY fixes, but these URLs refer to the "latest" at the time of the FreeBSD 9 release, so they no longer work.

This shows how chaotic FreeBSD's release process really is. This kind of usage of the "latest" in its release process shows that FreeBSD developers are not following the best practices of the industry.

To make things worse, the FreeBSD website itself is misleading people: 1. It provides suggestions to rebuild the VMWare Tools. The suggestions are not easy to follow, and they do not really work. 2. It provides suggestions to use "Open VMWare Tools", but it then states that the "Open VMWare Tools" approach does not support video.

Thanks to "Linux Video Tutorials" , I was able to find out that "Open VMWare Tools", along with "xf86-video-vmware" and "xf86-input-vmmouse", actually provides most of the features of the official VMWare Tools:

1. Video driver
2. Mouse driver. It supports cursor movements in and out of the guest FreeBSD OS window.
3. It supports copy-paste to and from the guest FreeBSD OS window.

This is obviously different from what the FreeBSD website was saying. What a pleasant surprise.


Tuesday, November 15, 2016

"Fix" Gigabyte Motherboards That Seem to Be Dead on Arrival

I like Gigabyte motherboards. I had just about all other brands of motherboards failing on me before, but never Gigabyte motherboards.

So naturally, the last few times when I decided to upgrade my desktop computers, I decided to go with Gigabyte motherboards.

Unfortunately, now the X99 chipset based Gigabyte motherboards appeared to be dead on arrival each time.

The first one was a GA-X99-UD3P. I bought it with an Intel i7 5820K CPU. After all the parts were put together, when the computer was powered up, the speaker connected to the motherboard would beep many times, and the machine would then power cycle itself. This would repeat over and over again. I checked the AT motherboard POST beep codes, and it seemed to indicate that the CPU was bad.

I talked to the nice folks at Microcenter, where I bought the motherboard and CPU from. They felt that it was extremely unlikely the CPU was bad, so they replaced the motherboard for me. I installed the replaced motherboard, but to my surprise, the problem was the same!

So now, it must be the CPU then. I went back to Microcenter, and had the CPU replaced.  I installed the replaced CPU, and the problem was still the same!

At this point, it was obvious that this was a compatibility issue, not faulty parts. I never expected compatibility would be a problem, since Microcenter sold the CPU and motherboard as a bundle. Why would they bundle them together if they were not compatible with each other?

I gave up, and sent my computer to Microcenter service department to take a look. Days and fifty dollars later, I got my computer back. They fixed the problem by updating the motherboard's BIOS to a later version.

I did not think anything of the solution at the time. Microcenter would have older CPUs that they could have booted the computer with, and then they could updated the BIOS.

After eleven months of use, yesterday, this computer would no longer boot. I really do not have time for a lengthy fix, so I decided to buy a new CPU and motherboard combo, and just replace both.

This time I bought an i7 6800K CPU, and an GA-X99-SLI motherboard. I thought this way, I could do a simple swap of parts, then just continue working.

Well, no such luck. After replacing the CPU and the motherboard, the computer would just keep rebooting itself. Even worse than the first upgrade, there were no AT POST beeping codes. The speaker was completely silent. I even tried using the old CPU on the new motherboard, thinking that a new 2011-v3 motherboard should be at least compatible with i7 5820K.

Well, the computer still kept rebooting itself. Although at times it seemed to be doing device scans, it never beeped or showed anything on the screen.

There must be an easier way than sending the computer to Microcenter. I googled for an answer. To my amazement, Gigabyte motherboards can be flashed even without a CPU or any RAM installed. It does not matter if there is nothing shown on the screen. Gigabyte calls it Q-Flash. Q-Flash has been around for many years, but usually you would still boot up the computer and go into the CMOS setup to use Q-Flash. I never knew that it was not really necessary to boot into the CMOS setup screen.

At the back of these Gigabyte motherboards, there is one USB port that is color coded differently than the standard blue color for USB 3. It is white-color coded. I placed the latest BIOS file on a USB drive with FAT file system, and plugged it into this port. One of the online videos I found on google said that you needed to rename the BIOS file to "Gigabyte.bin". For good measures I placed two copies of the BIOS file on the USB drive. One with its original name, and one renamed to  "Gigabyte.bin".

The LED light on the USB drive started to blink like crazy. At first the machine was still rebooting, and the LED light would go out while the computer was briefly powered off, and then continued to blink while the power came back on.

After a few cycles, the computer would then stay on, and the LED light on the USB drive would continue to blink. At the same time an LED light on the motherboard near the USB port started to blink as well. After several minutes, the LED lights then stayed on constantly. They seem to indicate that the BIOS finished updating.

After I power cycled the computer, it would still not boot up. Then I remembered that I still had the old i7 5820K in there. So I swapped it out with the new i7-6800K.

When I powered up the beast this time, it booted all the way up, and the CMOS setup screen showed on the monitor, finally.








Tuesday, May 24, 2016

Windows 10 Apps from Windows Store Will Not Start

So Microsoft has taken away the old calculator, and given us a new one that runs on the new WinRT side of the house. As a result, when applications from Windows Store would not run, I was out of a calculator.

In Windows event log, I saw this:


Then I followed the message here to "Microsoft-Windows-TWinUI/Operational". It really did not give anything more:


I tried uninstalling it. Nothing happened after I selected "Uninstall" from the popup menu.  Microsoft has a site that can perform diagnostics, so I tried it:

http://windows.microsoft.com/en-us/windows-10/run-the-troubleshooter-for-windows-apps

It did nothing.

So I am on my own. I started a power shell window in admin mode, and ran "Get-AppxPackage *calc*":

Now I know that the full package name for the calculator is "Microsoft.WindowsCalculator_10.1601.49020.0_x64__8wekyb3d8bbwe". I tried "Remove-AppxPackage Microsoft.WindowsCalculator_10.1601.49020.0_x64__8wekyb3d8bbwe". That gave me a bunch of errors and refused to proceed. So I tried to directly re-install it by running "Add-AppxPackage -register "C:\Program Files\WindowsApps\Microsoft.WindowsCalculator_10.1601.4902
0.0_x64__8wekyb3d8bbwe\AppxManifest.xml" -DisableDevelopmentMode". This is what I got:


Add-AppxPackage : Deployment failed with HRESULT: 0x80073CF6, Package could not be registered. (Exception from
HRESULT: 0x80073CF6)
NOTE: For additional information, look for [ActivityId] 5ef603bf-b483-0008-6b97-f65e83b4d101 in the Event Log or use
the command line Get-AppxLog -ActivityID 5ef603bf-b483-0008-6b97-f65e83b4d101
At line:1 char:1
+ Add-AppxPackage -register "C:\Program Files\WindowsApps\Microsoft.Win ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : WriteError: (C:\Program File...ppxManifest.xml:String) [Add-AppxPackage], IOException
    + FullyQualifiedErrorId : DeploymentError,Microsoft.Windows.Appx.PackageManager.Commands.AddAppxPackageCommand


I then ran "Get-AppxLog -ActivityID 5ef603bf-b483-0008-6b97-f65e83b4d101" as suggested in the error message. Finally I was getting some useful information:

Windows cannot find the resource package manifest in the bundle file:
C:\Program Files\WindowsApps\Microsoft.WindowsCalculator_10.1601.49020.0_neutral
_split.scale-150_8wekyb3d8bbwe\AppxManifest.xml.
Windows cannot find the resource package manifest in the bundle file:
C:\Program Files\WindowsApps\Microsoft.WindowsCalculator_10.1601.49020.0_neutral
_split.language-zh-hans_8wekyb3d8bbwe\AppxManifest.xml.
error 0x80070002: Reading manifest from location: C:\ProgramData\Microsoft\Windo
ws\AppRepository\Microsoft.WindowsCalculator_10.1601.49020.0_neutral_split.langu
age-zh-hans_8wekyb3d8bbwe.xml failed with error: The system cannot find the
file specified.


Apparently if you have your screen scaled above 100% because of a 4K display, or if you are using a different language add-on, this is what you could get sometimes: broken Windows Store applications.

So I temporarily changed owners of these folders to my user account to gain full access, and then put the "TrustedInstaller" back as the owner. To find the "TrustedInstaller" you need to enter "NT SERVICE\TrustedInstaller" while the location is set to your computer, not an Active Directory.

For the "scale 150" file, I just made a copy of the "scale 100" file and renamed it to what the installer was complaining about. There was another app that had a "zh-hans" file, so I made a copy of that and renamed it using the calculator's full package name.

Then I ran "Add-AppxPackage -register "C:\Program Files\WindowsApps\Microsoft.WindowsCalculator_10.1601.4902
0.0_x64__8wekyb3d8bbwe\AppxManifest.xml" -DisableDevelopmentMode". This time, it worked. Now I have my calculator back.

I also had the same problems with Microsoft Solitaire Collection. I used the same fix, and that is now working also.

Update: on a different laptop running Windows 10, I got the same error on the Windows 10 Store application itself. The Windows 10 Store app shows a blank icon on the task bar. It is as if there is no application icon in that spot. When I clicked on it, The Store windows comes up briefly and then just disappears. "Sfc /scannow" etc. did nothing. Troubleshooting tools did nothing. The same steps showed that it was missing a scale 125 file and one for the language "zh-hans" as well. So Again I copied the scale 100 files to 125, and copied the default language folder to the missing "zh-hans" folder name. Now the icon is back, and the Store application launches fine.

Apparently this is a problem that has been plaguing Microsoft for quite some time. Even in the Windows 8 days a couple of years ago it had the same problems: http://programount.blogspot.com/2014/08/fix-windows-81-cannot-launch-pc.html. Even with the causes known for so long, they still cannot manage to fix it.

Saturday, November 7, 2015

Uninstalling Exchange Server 2016

This was like a nightmare.

I installed Exchange Server 2016 on a server machine that had other services running. As a result, I could not just reinstall Windows Server 2012 R2 and started over.

After the installation, Exchange Server 2016 refused to cooperate. All of the Exchange web applications would return "invalid user name or password". The command line power shell could not connect to the Exchange Server upon launch: "Access denied". The Exchange Server Toolbox threw a COM error and would not load.

I was logged in as the domain administrator, but apparently that did not matter. I restarted the server, I re-logged in, Exchange Server 2016 would not work no matter what.

When I tried to uninstall Exchange Server 2016, the uninstaller would refuse to proceed because "there were mailboxes in its database".

Exchange Server 2016 Setup program is really a hybrid application with GUI and power shell command line. Instead of providing on-screen GUI user controls to remove existing mailboxes, it provides a list of commands to be run on the power shell command line that you have to launch by yourself.

Since the power shell could not be launched in my case, the instructions on running these commands were useless unless I could fix this mess first.

Apparently the Exchange power shell uses some of the Exchange web applications in IIS to "connect to Exchange". The fact that there were other certificates in IIS before its installation was something that the Exchange Server 2016 Setup just could not comprehend. The fact that IIS 8 is a retard when handling multiple certificates is the main reason that all this were happening. After decades of development, apparently handling a handful of certificates by subject names and alternative subject names was just way too hard for Microsoft.

So I installed Exchange Server 2016 on a new server just to see what the default settings in IIS were supposed to be.

After the comparisons, I was able to fix some of the Exchange web applications and log into the Exchange "ecp" virtual directory.

But I was still not able to log into "owa" to see my inbox. The authentication would work, but what followed was just a blank page. In the event log I saw that the Exchange "OAB" app could not start because it could not find "Microsoft.Exchange.FrontEndHttpProxy.DLL". Its full path was in a shared config file that the "OAB" app used, and the file was actually there. I tried to place it in the GAC, and it did not make any difference. So I removed it from the GAC, and then copied the entire "HttpProxy\bin" directory under "OAB". This time "OAB" found "Microsoft.Exchange.FrontEndHttpProxy.DLL", but in the event log the new error was that it "does not implement IHttpHandlerFactory or IHttpHandler".

Forget it, I was going to uninstall the whole thing. But the power shell was still not working. After comparing it to a different installation, it turned out that it was trying to do a remote access on the local machine:

C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -noexit -command ". 'C:\Program Files\Microsoft\Exchange Server\V15\bin\RemoteExchange.ps1'; Connect-ExchangeServer -auto -ClientApplication:ManagementShell "

The remote access was failing, so it did not work. After switching to a local version, it worked just fine.

At this point I was able to disable the mailboxes that prevented me from uninstalling Exchange Server 2016.

But the nightmare was over just yet. It turned out that the list of commands in the Exchange Server 2016 Setup was incomplete.

It did not mention anything about "Audit log" mailboxes.

Did I mention that "Get-Mailbox" does not show all of the mailboxes? It does not. So "Get-Mailbox" returns nothing, but the uninstaller refused to proceed because "there were still mailboxes in the database".

Finally I found this category of mailboxes by reading the options for "Get-Mailbox".

So I disabled the last mailbox, and uninstalled Exchange Server 2016, finally.

Well, to make the zombie story complete, after completing the uninstall, the server was rebooted, but the event log continued to receive Exchange Server 2012 errors non-stop.

It turned out that the Exchange Server 2016 Setup left behind its "back end web site" in the IIS, but the name changed to just "Site 7" (on other machines this could be "Site 4" or whatever ID it was using). I could not even click on this site because it did not have its files. So I clicked on the root "Site" folder of  IIS, and deleted it from the right pane of the IIS manager.

In addition, it left a bunch of application pools in IIS as well. What was worse was that it also left changes on EVERY application pool in IIS, including those that did not even belong to Exchange Server 2016. These changes were not even visible in the IIS manager. You would have to get into "C:\Windows\System32\inetsrv\config\applicationHost.config" and remove them manually. You would need to go into the "applicationPools" section and remove "CLRConfigFile='C:\Program Files\Microsoft\Exchange Server\V15\bin\GenericAppPoolConfigWithGCServerEnabledFalse.config'" from EVERY application pool. In the "globalModules" section, you would have to remove "".

That cleaned up the server for good.










Saturday, December 6, 2014

Clone Windows OS Drive to a New SDD Drive

Even though Microsoft started up as a company that produced "Disk Operating System", AKA "DOS", its latest Windows operating systems no longer manage some of the basic disk operations, say cloning a hard disk.

But nowadays, migrating from old hard drives to new SSD drives requires that you clone existing drives to the new SSD drives. Microsoft has made sure that any of its backup/restore features cannot be used for drive copy or cloning. So you will need some tools from other software vendors.

Some SSD drive manufacturers such as Samsung offer software for such migration. But Samsung's software is simply horrible. It takes over one hour and twenty minutes to copy an old 500 GB drive to its 1 TB EVO SSD drive. Then at the end of the copy it throws an error and gives up.

You are on your own.

I bought Paragon Software's cloning tool before when I migrated a Windows 7 machine. $20 is not a bad price. But now when I need to upgrade a Windows 8.1 machine, I found that I needed to upgrade, and Paragon Software's download link only provide the old version.

It looks like that I need to pay again.

Then I saw recommendations for "AOMEI Backupper (http://www.backup-utility.com)". The drive clone feature in this software can be enabled either by payment, or with a message in your social media account such as Facebook or G+, etc. that mentions "AOMEI Backupper". So I posted a message in G+, and then I migrated two of my Windows 8.1 machines to new SSD drives, free.

Everything worked perfectly.

I will be migrating a MacBook next. But apparently MacBook can be migrated without third party tools.

Microsoft: you are really losing it.

Update: apparently AOMEI Partition assistant is no longer available for free with a post to social media. It will now cost you $50.

Saturday, November 22, 2014

Why Is My MacBook's Touchpad Stuck?

About a year after I bought my MacBook, I noticed that its touchpad no longer clicked when pressed, as if there was dirt underneath it to prevent it from going down.

Later I realized that my MacBook's battery would die almost immediately after it is unplugged. Since I always used it with the power adapter connected, I did not really care. But I did not make a connection between the touchpad problem with the battery.

Another year later, I found that the battery was swollen to the point that the back cover could not be closed completely anymore. So I decided to take it out and replace it.

To my surprise, the touchpad started to click again when pressed while the battery is out. After replacing the battery with a new one, the touchpad still clicks when pressed. Apparently when the touchpad stopped clicking when pressed, it was when the battery started to swell up.

So now I have a perfectly working MacBook, and I now I know that the touchpad can be used as a battery health monitor as well: when it no longer clicks when pressed, chances are that your battery has gone bad and started to swell up.

Thursday, August 28, 2014

When Android Music Players Did Not Show All Songs on an External SD Card

Apparently Android indexes mp3 files on an micro SD card after you insert it into your phone. All music players show the same set of indexed music files.

Unfortunately, the indexing can sometimes be incomplete. When I started up a music player, -- either the Samsung Music Player or the Google Music Player, it did not matter -- I saw some of my songs, but not all of them. I could browse into the folders on the micro SD card and play each of  the missing files, but I just could not find them inside the music player.

My files are inside the "Music" folder, and I do not have a file named ".nomedia" in there.

So I decided to try to get my phone to re-index the SD card. Here are my steps:

1. I turned off the phone.
2. I removed the micro SD card.
3. I restarted the phone to let it know that I no longer have a micro SD card plugged in.
4. I turned off the phone again.
5. I re-inserted the micro SD card.
6. I restarted the phone to let it know that I now have a micro SD card plugged in again.

Sure enough, Android started scanning the micro SD card to index files on it. At first I was a little nervous, because the music players where showing even fewer files than before. But after a while, all mp3 files are found, and my problem is now solved.