Friday, May 08, 2015

Installing OSX Yosemite on VirtualBox under Windows

***Creating a Yosemite ISO***

Download the OSX Yosemite installer from the App Store on a Mac, which will place it in the Applications folder.
If you try to download from another source you take your chances with someone hijacking your OS, besides it being an illegal copy.

Run these commands in the Terminal:

hdiutil attach /Applications/Install\ OS\ X\ Yosemite.app/Contents/SharedSupport/InstallESD.dmg -noverify -nobrowse -mountpoint /Volumes/install_app
hdiutil convert /Volumes/install_app/BaseSystem.dmg -format UDSP -o /tmp/Yosemite
hdiutil resize -size 8g /tmp/Yosemite.sparseimage
hdiutil attach /tmp/Yosemite.sparseimage -noverify -nobrowse -mountpoint /Volumes/install_build
rm /Volumes/install_build/System/Installation/Packages
cp -rp /Volumes/install_app/Packages /Volumes/install_build/System/Installation/
cp -p /Volumes/install_app/BaseSystem.* /Volumes/install_build/
hdiutil detach /Volumes/install_app
hdiutil detach /Volumes/install_build
hdiutil resize -size `hdiutil resize -limits /tmp/Yosemite.sparseimage | tail -n 1 | awk '{ print $1 }'`b /tmp/Yosemite.sparseimage
hdiutil convert /tmp/Yosemite.sparseimage -format UDTO -o /tmp/Yosemite
rm /tmp/Yosemite.sparseimage
mv /tmp/Yosemite.cdr ~/Desktop/Yosemite.iso

***Getting the ISO to your Windows PC***

Format a USB drive with exFAT. Drive should be at least 8GB. Copy the ISO to there.
OR.. if both machines are on a LAN, share out a folder on your Windows PC and connect to it from the Mac. (smb://IPADDRESS-OR-HOSTNAME)

***Working with VirtualBox***

Create a New VirtualBox machine, choosing the latest version of OSX listed as the OS you will be installing. Allow at least 2GB of RAM.
After the setup wizard, once you are back at the main VirtualBox screen, under the VM settings for System change the chipset to PIIX3.

Before booting, go to the command line and type:

c:
cd\program files\oracle\virtualbox

Then execute the following commands replacing Yosemite with whatever you named the new VM.

VBoxManage modifyvm "Yosemite" --cpuidset 00000001 000306a9 04100800 7fbae3ff bfebfbff
VBoxManage setextradata "Yosemite" "VBoxInternal/Devices/efi/0/Config/DmiSystemProduct" "MacBookPro11,3"
VBoxManage setextradata "Yosemite" "VBoxInternal/Devices/efi/0/Config/DmiSystemVersion" "1.0"
VBoxManage setextradata "Yosemite" "VBoxInternal/Devices/efi/0/Config/DmiBoardProduct" "Iloveapple"
VBoxManage setextradata "Yosemite" "VBoxInternal/Devices/smc/0/Config/DeviceKey" "ourhardworkbythesewordsguardedpleasedontsteal(c)AppleComputerInc"
VBoxManage setextradata "Yosemite" "VBoxInternal/Devices/smc/0/Config/GetKeyFromRealSMC" 1

Set your Yosemite ISO as the CD/DVD drive in the settings for your VM.

***Installing OSX***

Boot the VM. (At one point it may say LPC device initialization failed and appear to hang; just a wait a minute or two.) At the installer, go to Utilities>Disk Utility and create one Mac OS Journaled partition on the VM hard drive.
Then complete the installer, choosing the hard drive partition you just created.
When I did this I had installation hang at a particular spot for like half an hour. Come to find out that I could not longer find the ISO on the USB drive.
Either the USB drive went out or something deleted the ISO. I got a new copy, put it on my hard drive, and set it to read-only. Then the install went fine.

***iCloud won't work***

iCloud activations are tied to the system serial number. There are some advanced tools that attempt to modify the OSX system files to change this.
Google Chameleon Wizard if you are interested. Not covering here because of the high risk of borking everything and having to start over.

***Disabling Visual Effects***

On the new OSX install, download and install BeamOff. This will need to be run on every boot to work. The visual effects don't get along with the VirtualBox driver.

Saturday, April 25, 2015

Replacing a Mac Hard Drive

Choices for migrating your Mac files and settings to a new drive:

1. Boot into Recovery Mode (Command-R) and use Disk Utility to copy the system partition to the new drive connected via an external enclosure.

OR
2. Remove the drive and duplicate using a duplicator.

OR the option I think is best:
3. Install the new drive and reload OSX. Then use Migration Assistant to pull in files and settings from the original drive connected via an external enclosure.

Strategies to make the new drive work well under OSX:

- Use SSD Chameleon to enable TRIM if the new drive is an SSD AND your OSX is 10.6.7 and above. If this software refuses to enable TRIM you need to wipe and reload OSX.
- Use SSD Fan Control to quiet the fan if the new drive doesn't support temperature sensor connector

Don't forget to reference the relevant repair guide on ifixit.com so you know how to get to the drive and reassemble things with a minimum of fuss.
Don't forget a 2.5" to 3.5" bracket if you are installing an SSD into a Mac with a desktop hard drive such as the iMac. Avoid brackets that support more than one drive as they might be too large fit in cramped Mac interiors.

Friday, April 24, 2015

Network Folder Question Mark in OSX Dock

Problem: Network folders show up in the dock as a question mark and can't be opened.

Solution: Create a file nsmb.conf with the following two lines:

[default]
smb_neg=smb1_only

Save it to the desktop. Open Terminal.
Run the command "sudo bash"
Enter your sudo password. If you don't know it, look HERE.
Enter the command "cp ~/desktop/nsmb.conf /etc/nsmb.conf"
Run the command "exit" and then exit the Terminal.
Restart.
The folder should show up properly now.

This forces SMB back to version 1 of the protocol for all users.

Saturday, March 21, 2015

An Important Principle to Remember about the Future of Oil

"The value of effectively every asset class on Earth is influenced by the assumption that a fossil fuel-based economy will persist for so long that any potential for future change to asset values can be ignored. That assumption is wrong. The global industrial economy operates on an assumption of available and relatively inexpensive energy, either in the form of electricity or liquid fuels. If the form, availability of, or cost of, those energy sources changes it will fundamentally change the cost to use and produce virtually every other asset on Earth. And that will necessarily change the value of every one of those assets. There will be both positive and negative impacts, and understanding this change, in both scope and speed, will provide insight on one of the largest wealth shifts ever experienced.
The owner of the most valuable fossil fuel reserve on Earth [Saudi Arabia] just started discounting for a future without fossil fuels. While they would never state this reasoning publicly, their actions speak on their behalf. And that changes everything."
-Elias Hinckley

Thursday, February 19, 2015

The Windows Ecosystem is now Ad-supported.

The Windows Ecosystem is now Ad-supported.
...at least for anyone outside of a business. And it has gotten much worse than the average boatload of crapware these manufacturers are known for. It is extraordinarily sad how heavily laden with advertising the entire Windows experience has become. Let's say you buy a Windows 8.1 PC today. As it turns out, your Metro start screen is littered with dozen of tiles for third-party services and apps that have paid $$ to the OEM for placement. Removal requires the user to delete all the tiles, and any new user on the machine will have to delete the tiles for themselves as well. It takes going into Powershell to remove these "provisioned apps" on a machine-wide basis.
Now let's move past Metro. You get to the desktop, only to find more shortcuts for third-party stuff. There are multiple programs installed (whose developers have paid $$ for placement) which are "lite" versions or trialware intending to get you to spend $$ to buy the full version.
Perhaps the worst is whatever anti-virus is included. The computer will usually come with a 1, 3, 6, or maybe even 12 month Norton subscription. Which is fine until the subscription runs out, at which point the AV becomes nag-ware trying to get the user to pay $$ to re-up the subscription. The average user doesn't necessarily grasp the importance of this and figures if the program is still there it must be doing SOME good. But it is actually exposing the user to risk. The user is unlikely to know that they can UNINSTALL the AV and use Windows Defender.
It doesn't stop there. The user goes online. Invariably they end up at a site serving ads that trick the user into installing crapware such as false anti-virus programs, media players, you name it. Stuff they don't need. But even worse, these installs also go ahead and install additional crapware in addition to the crapware that the user was tricked into installing.
So the user might choose to go download something reputable like VLC or PDFCreator or even Adobe Flash. Well now they have more crapware because the download site they use for these programs install other stuff by default. Choosing not to install this extra stuff means knowing that the grayed out "Decline" button, or the grayed out "Custom install" option, really is clickable. Or some other weird user interface trick that makes the user think they CAN'T opt-out.
And this, my friends, is why in addition to the normal crapware cleanout I perform on my family and friends PCs, I also uninstall the antivirus, and I install Firefox and Chrome and configure ad-blocking for IE, Firefox, and Chrome. I don't have a problem with ads, but no possible moral obligation to view ads is worth 2-hour crapware/spyware/malware cleanout sessions every other month.
Macs may not come with crapware but they are increasingly getting targeted by online advertisements that lead to Mac malware.
For a long time, Linux enthusiasts have said the best way to clean and repair Windows is to format and install Linux. Given that malware has become a virtually unavoidable structural component of the consumer Windows ecosystem, I finally have to say they are right. It is high time for the techies in people's lives to burn a Linux Mint install disc and use it regularly.

Friday, February 13, 2015

Figuring out CFM and Grille Sizes (including Return Grille) for Central HVAC systems

A HVAC system is sized for the volume of air in your home. If your house is 1200 sqft and the ceilings are 7 ft tall, the air volume is 8400 cubic feet. A properly sized HVAC system will perform at least 6 full air changes per hour, so it would need to move 8400x6=50400 cubic feet of air per hour. 50400/60 minutes then would equal 840 CFM.
(A real HVAC installer would also want to measure leakage to tweak the CFM rate for your specific house construction but that's beyond the scope of this post.)
To find the size of the compressor in tons, divide 840 by 400 (400 CFM per ton), giving 2.1 tons. Round up to a standard size 2.5 ton unit.  If you are going to use a heat pump you've already done your heater sizing.
How big to make the return air grill? You don't want so much air rushing past the grill that it is noisy but you don't want a large grill either. The grill should be sized for an air speed of 300-500 FPM, or feet per minute. 400 FPM is the usual target.
We know you'll need to push 840 CFM. We'll divide by 400 FPM giving 2.1 sqft as the necessary filter face size. Convert to inches: 2.1 x 144 = 302.4 sqin. Take the square root of 302.4 = 17.389. So let's look at some standard size filters near 18in:

18x20 = 360sqin
16x20 = 320sqin

A 16x20 return grill would provide the necessary air flow and actually take us a little under 400 FPM.

If you already have an HVAC system you can work the numbers and see how well your system is sized. Also nice to know if you are planning on adding square footage somehow (new floor, finishing the basement, enclosing a porch, etc.) You can check your HVAC guy's recommendations this way.

You'll want to further assure you can get a full 840 CFM by checking the technical documentation for the air handler. You want to find the max external static pressure drop (intake resistance to air) that still allows the air handler to deliver 840 CFM. Then purchase filters that do not exceed that drop. Ideally, purchase the filter with the highest MERV rating that has a pressure drop for your size filter that is below this value. Most filter manufacturers don't provide detailed pressure drop information, unfortunately.

The air handler will also not push the right CFM if the pressure is not balanced throughout the home. This usually happens in a closed room with no air return (very common). All closable interior doors leading to living spaces (office, bedroom, bathroom, den) should be shortened by 1 1/2 inches on the bottom, or have an air vent installed in the door, or a jump vent.

Saturday, January 31, 2015

Diagnosing CPU Thermal Throttling

Computer processors are designed to run under specific environmental conditions, including temperature. With an Intel processor, the responsibility for ensuring a processor does not overheat is split between the motherboard and the CPU, and the motherboard constantly monitors CPU temperature by way of a temperature sensor next to the CPU, and alerts the CPU if that temperature exceeds certain threshhold. This is known as a PROCHOT signal. The CPU receives the PROCHOT signal from the motherboard and immediately drops down to it's lowest multiplier. This reduces the speed of the CPU, causing it run cooler. With an AMD processor, this is all handled by the motherboard, which forces a lower clock on the CPU.
It may not be apparent that your processor is having overheating problems. As mentioned above, the system is always ready to compensate by slowing down the CPU. If you don't perform many processor-intensive tasks, it may not be noticeable. The reason is that once the processor cools down, throttling turns off until the processor is put under stress again.
Where it becomes noticeable is when CPU-intensive programs are run. For most people, this means Netflix. However it could be any HD video playback including YouTube HD and Blu-ray. It could also occur when running distributed computing clients like Folding@Home, doing video editing, or playing 3D games.
In a nutshell, a properly built and working computer should have a CPU that is capable of handling any load thrown at it without overheating and/or triggering the PROCHOT signal from the motherboard. Don't let anyone tell you otherwise.
If you suspect thermal throttling, there are two programs that can be used to test this on Windows. First, you need a program that will push your CPU to the max, like Prime95. Second, you need a program that will display CPU speed in real-time and allow you to block the PROCHOT signal temporarily for testing purposes, like ThrottleStop. It would also be helpful to search online and find the maximum temperature listed for the processor.
Before running tests, go into the Control and into Power Options, which may be in the Hardware category. Drop down the list of extra power modes and choose High Performance. This will ensure that Windows isn't the one bringing down your processor speed. If this is a laptop, make sure it is plugged in.
Run Prime95 and choose Stress Testing, and choose the test that is listed as generating maximum heat (sometimes they change around which test is good for what between versions). Once the test is running, open ThrottleStop. At the top right of the main ThrottleStop window, the processor speed will be given, as well as the multiplier and frequency. The processor speed should not drop lower than 10% of the rated speed for the processor. It may go over if the processor supports Turbo Boost. The processor model and type are also listed so you can search online to find out what the rated speed is if you aren't sure.
If the processor dips farther than 10% below the rated speed you likely have thermal throttling. To be certain, uncheck the box that says "BD PROCHOT". IMPORTANT: ONLY LEAVE THIS BOX UNCHECKED LONG ENOUGH TO OBSERVE WHETHER IT SOLVES THE PROBLEM, THEN TURN IT BACK ON. Unchecking this box basically "muzzles" the motherboard PROCHOT signal and leaves the CPU blind as to how hot it is running. Any overheating can potentially damage the CPU and/or motherboard, so this is all at your own risk.
(If you have an AMD processor, you won't have the capability to disable this. You'll have to diagnose based on throttling patterns alone.)
Assuming that disabling the PROCHOT signal solves the problem, you need to correct the issue(s) causing the processor to overheat. Consider the CPU fan and heatsink, as well as the case fans. If the room the computer is in is uncomfortably hot that might also be an issue. But probably the most common culprit would be dust bunnies inside the computer. You'll need to blow out the internals with air.
If you've eliminated dust as the issue and the problem remains, consider case temperature, unless it is a laptop. Any desktop computer should have these fans: a fan on the CPU heatsink, a fan on the back of the case, and the fan inside the power supply. Are the fans fighting each other, especially if you have more than these three fans?
If it's not dust and the case temperature is fine, remove the heatsink/fan from the CPU, and clean off and replace the thermal paste. Then remount the heatsink/fan.
If all of the above fails to correct the problem, consider a more robust heatsink/fan for your CPU. If you are overclocking, maybe also consider water cooling.
I should also mention that it is entirely possible that the motherboard temperature sensors are bad. If you suspect this, try a BIOS upgrade first, if available.
I know all of this because I had a problem with this on a laptop. It all started with Netflix HD movies not playing right. I went through all kinds of drivers and software and BIOS updates before realizing my problem was CPU thermal throttling. It's been a long road. The laptop is under an extended warranty and the repair tech barely understood what I was talking about. I would hazard a guess that a not insignificant number of professional PC technicians don't even really understand the issue of thermal throttling. Hopefully this post will be a help.