Random Thoughts – Randocity!

How to set creation file time on MacOS X

Posted in howto, Mac OS X by commorancy on October 23, 2023

close up photo of programming of codes

Recently, I downloaded a bunch of mp4 videos from my PS4 to create some longer form videos for YouTube with iMovie. Unfortunately, the files copied from the PS4 did not retain the original creation date and time. I was bummed because iMovie uses the creation date to sort the video clips stored in its import library.

I’m pretty sure that the PS4 stores this information with the file in the BSD operating system used on the PS4. For whatever reason, this information is lost and is not retained when copying these video files to a USB drive.

Instead, the PS4 creates the files using the current date and time of when they were copied to USB. However, the filename does includes the date and time of the PS4’s original file creation date. All is not lost. For example, one of the files is named “Grand Theft Auto V_20231021102822.mp4.” The 20231021102822 is the file’s original creation date, but it’s embedded in the filename. This is a pain in the ass, especially when you have a lot of these files and you need to depend on sorting the files by creation date.

If you’re using Linux, some of this may apply with touch, but some may not. For example, it may not be possible to set the birth time or btime in Linux. Then again, you won’t be using iMovie on Linux, so you may not encounter the same sorting problems as when using iMovie. On Linux, you’re likely to be using ShotCut. And yes, ShotCut is available for MacOS X.

Let’s explore recovering and setting the original creation date and time for these imported PS4 video files when using a Mac.

Before Getting Started / Liability Waiver / Assumption of Risk

This is a relatively deep dive tutorial and is designed for intermediate to experienced users who are comfortable running command line tools in UNIX, Linux and MacOS X. This article also expects that you are at least somewhat experienced and familiar with writing Bash shell scripts. While every care has been taken to ensure these instructions are fully accurate at the time of authorship, risk is always a possibility when running commands. Make sure you know what you’re doing and always proceed with caution when performing any shell commands.

Assumption of Risk: Should you follow any instructions provided in this tutorial, you do so at your own risk. This author and the Randocity blog holds no responsibility for how you use and/or misuse the information provided herein NOR does this author or Randocity hold any liability over any damage that may result directly or indirectly from this article’s included information. This information is provided to you AS IS. You assume all risks herein.

By proceeding with reading the remainder of this article, you agree to these terms. If you don’t agree with these terms, then navigate away NOW and go find something else to do.

Recovering Dates and Times on Files

There are two primary date/times stored as metadata with each file: creation date and last modified date. While it’s easy to set the last modification date using the ‘touch‘ command, this same command cannot be used to set the file’s creation time. Pity.

That left me looking for alternatives. If you have installed the command line development tools from Mac OS’s Xcode, there are a couple of handy command line (CLI) tools available to help with this date-setting task. These two tools are getfileinfo and setfile. Unfortunately, it seems that while the commands do get installed with Xcode, the manual pages (man pages) do not get installed. Thus, you can’t easily see or find the parameter usage of the command.

I had to refer to searching Google for the man pages for these two. Here’s the man page for getfileinfo. Here is the man page for setfile. These two commands will help get you started. If you don’t have these commands installed, you’ll need to install the Xcode command line tools.

First Step

Setting the last modification time from the above filename supplied is relatively easy by extracting the filename’s included datecode, slightly modifying it and feeding it back into the command ‘touch‘ to set the last modification date onto the file. Here’s a shell script which does just this on all files in the current directory:

#!/bin/bash
#
# setmodificationdate.sh

# FILE: "Grand Theft Auto V_20231021102822.mp4"
# DATECODE EXAMPLE: 20231021102822 => 202310211028.22

# Set IFS delimiter to EOL marker to ignore whitespace in filenames
IFS="
"

# Loop through files in current directory and update each file's last modification
# time to ${DATECODE}.${DATESS} using touch -mt [date]
for i in `ls`
do
	FILE=$i
	DATECODE=`echo "${FILE}" | awk '{print $4}' | awk -F "_" '{print $2}' | cut -c 1-12`
	DATESS=`echo "${FILE}" | awk '{print $4}' | awk -F "_" '{print $2}' | cut -c 13-14`

        # The touch command requires the date format to be YYYYMMDDHHMM.SS. Some
        # conversion is required.
	if [ $DATECODE ]; then
		touch -mt ${DATECODE}.${DATESS} "$FILE"
                echo $FILE ${DATECODE}.${DATESS} done 
	fi

done

The reason it’s important to update the files using the touch command first is that we’ll later use the getfileinfo command on these updated files to extract the modification date set with touch, making it easier to extract the date format which is used by the setfile command. Otherwise, if we don’t do this, we’ll have to spend a boatload of time reformatting that 20231021102822 string into the string format required by setfile. No, thanks.

Because I’m generally lazy when I see other easier formatting alternatives, I don’t wish to spend a full day of shell scripting on reformatting strings when I don’t have to. Since both the last modification and creation dates should be set identically, using two different commands is the easiest way to get these files back to their original dates.

Second Step

After having updated the last modification date of each of the video files using ‘touch‘, we’re halfway there. The other half is updating the creation date using the ‘setfile‘ command. Right now, even though the modification date is updated, the creation date is still set to the date and time when the file was copied from the PS4 onto the USB drive. I’m still at a loss why PS4’s Capture app does this. No reason to dwell on stupidity from Sony. Let’s move on.

If you would like to see the current creation date on the files, check it with following command:

$ ls -lhU
-rwxrwxrwx 1 owner staff 334M Oct 21 20:10 Grand Theft Auto V_20220826114603_1.mp4
-rwxrwxrwx 1 owner staff 452M Oct 21 20:05 Grand Theft Auto V_20220918194930_1.mp4
-rwxrwxrwx 1 owner staff 390M Oct 21 20:04 Grand Theft Auto V_20220922235359_1.mp4
-rwxrwxrwx 1 owner staff 398M Oct 21 20:04 Grand Theft Auto V_20221002025349_1.mp4
-rwxrwxrwx 1 owner staff 347M Oct 21 20:03 Grand Theft Auto V_20221007034124_1.mp4
-rwxrwxrwx 1 owner staff 389M Oct 21 20:03 Grand Theft Auto V_20221013095807_1.mp4
-rwxrwxrwx 1 owner staff 1.3G Oct 21 20:00 Grand Theft Auto V_20221022131151_1.mp4
-rwxrwxrwx 1 owner staff 342M Oct 21 20:00 Grand Theft Auto V_20221113174109_1.mp4
-rwxrwxrwx 1 owner staff  55M Oct 21 20:00 Grand Theft Auto V_20221124014001_1.mp4
-rwxrwxrwx 1 owner staff 389M Oct 21 19:59 Grand Theft Auto V_20221211111225_1.mp4
-rwxrwxrwx 1 owner staff 288M Oct 21 19:59 Grand Theft Auto V_20221213064150_1.mp4
-rwxrwxrwx 1 owner staff 419M Oct 21 19:58 Grand Theft Auto V_20221223001116_1.mp4
-rwxrwxrwx 1 owner staff 414M Oct 21 19:58 Grand Theft Auto V_20221230055654_1.mp4
-rwxrwxrwx 1 owner staff  77M Oct 21 19:57 Grand Theft Auto V_20230108204052_1.mp4
-rwxrwxrwx 1 owner staff 427M Oct 21 19:57 Grand Theft Auto V_20230108210502_1.mp4
-rwxrwxrwx 1 owner staff 133M Oct 21 19:57 Grand Theft Auto V_20230114165648_1.mp4
-rwxrwxrwx 1 owner staff 471M Oct 21 19:56 Grand Theft Auto V_20230205042420_1.mp4
-rwxrwxrwx 1 owner staff 441M Oct 21 19:55 Grand Theft Auto V_20230222025805_1.mp4
-rwxrwxrwx 1 owner staff 424M Oct 21 19:54 Grand Theft Auto V_20230227022823_1.mp4
-rwxrwxrwx 1 owner staff 373M Oct 21 19:54 Grand Theft Auto V_20230307124853_1.mp4
-rwxrwxrwx 1 owner staff 420M Oct 21 19:53 Grand Theft Auto V_20230311090033_1.mp4

To see the last modification time set from above touch command, use the following:

$ ls -lh
-rwxrwxrwx 1 owner staff 334M Aug 26 2022 Grand Theft Auto V_20220826114603_1.mp4
-rwxrwxrwx 1 owner staff 452M Sep 18 2022 Grand Theft Auto V_20220918194930_1.mp4
-rwxrwxrwx 1 owner staff 390M Sep 22 2022 Grand Theft Auto V_20220922235359_1.mp4
-rwxrwxrwx 1 owner staff 398M Oct  2 2022 Grand Theft Auto V_20221002025349_1.mp4
-rwxrwxrwx 1 owner staff 347M Oct  7 2022 Grand Theft Auto V_20221007034124_1.mp4
-rwxrwxrwx 1 owner staff 389M Oct 13 2022 Grand Theft Auto V_20221013095807_1.mp4
-rwxrwxrwx 1 owner staff 1.3G Oct 22 2022 Grand Theft Auto V_20221022131151_1.mp4
-rwxrwxrwx 1 owner staff 342M Nov 13 2022 Grand Theft Auto V_20221113174109_1.mp4
-rwxrwxrwx 1 owner staff  55M Nov 24 2022 Grand Theft Auto V_20221124014001_1.mp4
-rwxrwxrwx 1 owner staff 389M Dec 11 2022 Grand Theft Auto V_20221211111225_1.mp4
-rwxrwxrwx 1 owner staff 288M Dec 13 2022 Grand Theft Auto V_20221213064150_1.mp4
-rwxrwxrwx 1 owner staff 419M Dec 23 2022 Grand Theft Auto V_20221223001116_1.mp4
-rwxrwxrwx 1 owner staff 414M Dec 30 2022 Grand Theft Auto V_20221230055654_1.mp4
-rwxrwxrwx 1 owner staff  77M Jan  8 2023 Grand Theft Auto V_20230108204052_1.mp4
-rwxrwxrwx 1 owner staff 427M Jan  8 2023 Grand Theft Auto V_20230108210502_1.mp4
-rwxrwxrwx 1 owner staff 133M Jan 14 2023 Grand Theft Auto V_20230114165648_1.mp4
-rwxrwxrwx 1 owner staff 471M Feb  5 2023 Grand Theft Auto V_20230205042420_1.mp4
-rwxrwxrwx 1 owner staff 441M Feb 22 2023 Grand Theft Auto V_20230222025805_1.mp4
-rwxrwxrwx 1 owner staff 424M Feb 27 2023 Grand Theft Auto V_20230227022823_1.mp4
-rwxrwxrwx 1 owner staff 373M Mar  7 2023 Grand Theft Auto V_20230307124853_1.mp4
-rwxrwxrwx 1 owner staff 420M Mar 11 2023 Grand Theft Auto V_20230311090033_1.mp4

Note that once a file’s date is considered “too old”, the ls command no longer shows the time of the file, only the “MM DD YYYY” date. The time is still there on the file, but it’s simply not shown. With ls, this will have to do.

Extracting the Date for Setfile

To extract the date string format needed for setfile, we’ll use the getfileinfo command on the now touched files. That’s done with the following:

$ getfileinfo -m "Grand Theft Auto V_20231021102822.mp4"
10/21/2023 10:28:22

The getfileinfo -m command returns the last modified date string in the date string format “10/21/2023 10:28:22”, which is a properly formatted string to immediately use with setfile -d. Thankfully, we just set this date on the file above. This output string value from getfileinfo should match the date value in the filename. If the date value doesn’t match, the touch command above might not have worked correctly.

To set the creation date on the file, we will use the following:

$ setfile -d "10/21/2023 10:28:22" "Grand Theft Auto V_20231021102822.mp4"

The -d option is used to set the creation date on the file. This command only changes one file, though. Not very helpful since we’re needing to update a bunch of files all at once. To do this, we’ll need a shell script for batch changes.

#!/bin/bash
#
# setcreationdate.sh

# Set field separator to EOL marker to ignore whitespace in filenames
IFS="
"

# Loop through files in current directory
for i in `ls`
do
        FILE=$i

        # Extract properly formatted creation date using getfileinfo
        FCREATEDATE=`getfileinfo -m ${FILE}`

        # Update creation date using setfile with date extracted from getfileinfo
        # above, stored in FCREATEDATE
        setfile -d "${FCREATEDATE}" "${FILE}"
        echo ${FILE} done
done

Both of these shell scripts have been tested and worked perfectly to update the creation and modification dates on all of my PS4 video files back to their original dates recorded.

How do I use the scripts?

To use the above scripts, simply copy and paste them into your favorite MacOS X editor such as ‘vi’ or TextEdit, then save each script to whatever name you like. I named them setmodificationdate.sh and setcreationdate.sh, respectively. You can name them however you like. To make the script executable, do this with the following command:

$ chmod 755 scriptname.sh

Do these scripts work with vFAT formatted drives?

Yes, they do. These tools will work with vFAT as well as HFS+.

Is this the only way to change file dates?

No, there are other ways. You can use tools like ‘uuencode’, ‘tar’, ‘cpio’ or maybe even ‘zip’ to create an archive backup, then modify the dates inside the backup, then restore the files with newly updated dates. This is more complicated. The above is a simpler solution than mucking about with backup and restore processes. However, this archive solution may be the only way forward on operating systems that don’t allow modification of the creation dates on live files.

Why do all of this?

The iMovie app has an import library. In this imported clip library, the sorting feature uses the creation date, not modification date to sort the files. To make sure iMovie can sort these files properly date ascending, the creation date must be set correctly. Because copying the files to USB from the PS4 reassigns the date the mp4 was copied to the USB, not the date it was originally created on the PS4, this makes sorting from oldest to newest in iMovie a big problem.

When attempting to create a new movie using PS4 clips in chronological order, not having correct datestamps on each file makes it a challenge to locate the correct clips in the iMovie library. To correct for this, setting the creation date stamps on all of the mp4 files allows iMovie to sort them in the correct order, rather than sorting them based on the random date they were copied to the USB drive.

Note that once you have updated the dates on the mp4 files, you’ll need to restart iMovie to make sure it sees the newly updated dates on the files. iMovie won’t see these file changes until it’s been restarted.

Good luck and happy rendering!

↩︎

How to setup a black / blank screensaver on a Mac or Windows computer

Posted in Apple, Mac OS X by commorancy on February 18, 2017

Updated for 2018. This technique should work on any desktop operating system and this technique is quite easy to set up. I also realize that Windows offers a Blank screen saver that kind of negates this technique, but here it is anyway. And yes, it does work on Notebooks, too. Let’s explore.

Mac Computers

I’m starting with the Mac because it seems so much less obvious considering how ‘easy’ it should be for a Mac. One of the things you’ll notice in the screensaver area is that there is no blank or black screen saver. What people have suggested instead of a black screensaver is to enable the energy saver. While this works to turn off the backlight and save it, power savings does other unfortunate things to a MacOS computer at the same time.

Energy Saver Problems

“What problems”, you ask? Well, Apple has taken it upon themselves to also shut down a number of other critical components when the power saver is activated. Windows may be doing this as well. Yes, it does turn off the backlight. Unfortunately, with that it also turns the WiFi and networking off.  This means that if you have a VPN running, your VPN will disconnect. If your company invests in VPN software which does not self-connect on WiFi reactivation, you’re stuck reentering your passwords and setting up your terminals all over again. Unfortunately, I have no control over the software that’s used by my company and I have to live with it. So, I avoid the energy saver system like the plague to avoid random VPN disconnection. I use a screen saver instead. No, it doesn’t turn off the backlight, but that’s a small problem.

A Screen Saver?

A little history, a screen saver was used primarily to prevent burn-in on CRT tubes. It’s also distinctly different from power saver mode. Since the days of CRT tubes have long since passed, we are now using LCD screens with LED back or side lights. Some screens are made of OLED technology, which means that each pixel is a self-illuminated RGB LED light. With either of the LCD or OLED technologies, the chance for burn-in is almost non-existent. However, some LCD screens can show latent imagery under certain specific conditions if left sitting with the same static image for too long. So, a screen saver is still useful. However, a screen saver is most useful as a screen lock indicator.

Black Screen Saver on Mac

The problem is, the Mac doesn’t offer a black screensaver. It expects you to use images to cycle or other screen savers like a bouncing clock or a bouncing apple or similar.

However, I just want a simple black screen with no movement at all. You’re not going to burn-in your screen with a simple black surface, even though LCDs don’t really do that. To wit, you’ll notice no settings for that ..

screensaver-l

There is no screen saver above that provides a blank or black only screen. So, how do you do it?

Here are the steps:

  1. Find your current Mac’s screen resolution in Finder using applelogoascii => About This Mac. Then click on Display and look for your resolution. In the below example, you see 1440 x 900. It’ll be whatever your Mac offers.display
  2. Make note of the resolution above and jump to Creating a blank image using The Gimp section.

Blank Screensaver on other operating systems

If you find that your Windows system doesn’t offer a blank screen saver, you can follow these instructions:

Windows 7

  1. Windows Button => Control Panel => Display
  2. In Display, click Adjust Resolution
  3. Make note of screen resolution

Windows 10

  1. Windows Button => Control Panel => Appearance and Personalization => Display
  2. In Display, click Change display settings
  3. When the Settings window opens, make sure it’s still on Display. Then, scroll to the bottom of the right side panel and click Advanced display settings
  4. Make note of the screen resolution

Linux

  • Refer to your Preferences and Display settings to find the current screen resolution

Create a blank image using The Gimp

From here, what you’re going to do next is create a blank image in the resolution of your screen. It’s best to cover the entire screen’s pixels with black rather than, say some lower res image like 1024 x 768. This is the reason for discovering the resolution above. Using the full screen resolution prevents unexpected issues with the screen saver’s stretching (or not stretching) the pixels properly. This process can be used on all operating systems that have The Gimp installed.

To create a blank image in The Gimp, use the following:

  1. Open the Gimp (download it here — it’s free)
  2. Make sure your foreground and background colors look like so, with black on left top and white on right bottom:gimpcolors
  3. In the Gimp, File => New…
  4. Then, type in the resolution you found from from your operating system into the Width and Height fields (making sure to put the correct values in each field).
  5. Click Advanced Options and change Fill with: to Foreground Color
  6. Click, OK
  7. You should now see an image filled with black.
  8. Save the image using File => Export As… and type in a filename and change the file type from .png to .jpg to make the image smaller. Be sure to remember the folder where you are about to save your file.
  9. In the Export image as JPEG window, click the Export button
  10. You now have a new black image in the resolution of your screen.
  11. From the GIMP menu => Quit GIMP

Now that you have a saved black image, you need to add it to a list of images where your screen saver looks.

Adding this image to the Mac screen saver

This is a fairly simple concept. You will now use this newly created black image as your only screen saver image. So, no matter what the cycle rate is, it will always cycle back to this same blank image all of the time.

Here’s what I did on the Mac. I created a folder called black-image under my Pictures directory. I’ve placed my newly created image into /Users/myuser/Pictures/black-image/black-image.jpg. I’ve put it in a separate folder because that’s how Mac finds images… by folder. Now, select the folder under the ‘Classic’ screen saver using settings like so:

choosefolder

Where the arrow points, click that selection area, it will open a file requester and then choose the folder where your new black-image.jpg file is. Once you set it here, your screen will turn black when the screen saver activates (as in my case, in 30 minutes).

Windows or Linux

While I know that Windows has a Blank screen saver built-in, you can also use this technique by choosing the screen saver as Photos, then choose the folder where your blank-image is located. For Linux, simply perform the same setup using your preferences to select the photo folder where your save black-image.jpg exists. Once you do this, the screen saver will only show that single black image once the screen saver has activated.

This is actually the safest technique rather than relying on plugins or programs to provide a black screen. It will also continue to work should Microsoft decide, in their infinite wisdom, to be like Mac and remove the Blank screen saver in the next version of Windows.

I prefer this technique to using the power saver because of the issues mentioned above. This allows me to set up a black screen with the backlight still on which also keeps my VPN active. Of course, if you don’t deal with VPNs, then by all means use the power saver.

ScreenSaver Selection

Note that Mac and Windows (and probably Linux) offer a various number of image transition effects. You’ll want to be sure to choose the simplest effect choice for your black image. On the Mac, the fade-to-black or fade-between-images effect choices include the ‘Classic’ or ‘Ken Burns’ effects. These offer simple fades between each image.

You won’t want to choose an effect that adds white (or any other color borders) around the black image. Choose a screensaver effect that offers a simple fade and no borders. Otherwise, it will defeat the purpose of setting this up.

The screensaver effects offer previews of how the images will transition when the screensaver is running. Be sure to watch the preview of the screensaver plugin to ensure it will provide you with a solid black screen. You may have to use a few real images in the screensaver to find the effect that offers a simple fade transition.

[UPDATE: 9/13/2019]

Screen Aura

A recent reader pointed out that the black image seemed to still have an aura of illumination and wasn’t 100% inky black. As I’ve stated above, the backlight remains on when using the above black image screensaver technique. This means that the backlight light will show through the image and may make your black screen appear faintly dark gray. It may also be more pronounced if your backlight is at 100% brightness or when you’re sitting to the side of your display as LCD displays don’t always offer full 180º viewing angles. At very sharp angles to the screen, the backlight illumination may appear brighter.

The only way to really fix this is to reduce the brightness of your backlight. Most external monitors allow for this. Notebook attached screens usually have a brightness setting built into the keyboard. You can then reduce the brightness of the backlight by pressing the screen brightness down button on a notebook keyboard.

If you have an external monitor attached to your computer, turning down the backlight brightness involves using the external monitor’s menu system. The only way to turn off the backlight on an external monitor is to put the computer into a power saving mode… not in any way the same as using a black screensaver.

OLED Monitors and Contrast Ratio

If you truly want inky blackness when using a black screensaver image, you’ll need to invest in an OLED monitor. This technology uses very small LEDs for each pixel. When you use a black image as a screensaver, each pixel image will turn off each individual LED on the OLED panel making the screen 100% as black as it can get… or, in other words, it will look like the screen is turned off. Replacing a backlit LCD monitor with an OLED monitor is the only way to get true inky blackness using a black image screensaver. Otherwise, you have to manually turn down the backlight brightness.

Looking at contrast ratios is important when buying any display. The higher the contrast ratio, the deeper the blacks will be. OLED screens have some of the highest contrast ratios of any displays on the market, for obvious reasons.

OLED Monitor Scams

Be careful when shopping for OLED monitors. Searching on Amazon for ‘OLED Monitor’ actually brought up many listings for LCD backlit monitors. Even clicking the ‘OLED Monitor’ filter checkbox on the left side of Amazon’s listings still brought up many incorrectly labeled LCD backlit monitors. Don’t be tricked into buying an LCD backlit monitor thinking you’ve bought an OLED monitor.

Make sure that you’ve read the technical specifications of that model monitor carefully. You may need to visit the manufacturer’s web site to find this technical information for that model number. The manufacturer will list the panel type included in its display. However, Amazon’s listing may be entirely wrong. This same caveat can be had if you visit Best Buy or a local retailer. Additionally, I can almost guarantee none of the monitors sold at Target or Walmart will have this technology. OLED technology is much more expensive to produce than LCD backlit displays. For this reason, discount retailers aren’t likely to carry many (or any) OLED monitors… and if they do, they’ll usually cost twice the price of an LCD backlit monitor.

Variable Backlight Contrast (aka The Poor Man’s OLED)

Some LCD backlit monitors contain variable backlight contrast. These are usually in the form of TV monitors versus computer monitors. While this technology does not provide as nearly an inky black blackness as an OLED monitor, it can come very close. Hence, it being known as the poor man’s OLED.  This technology offers backlights that automatically vary their brightness based on the image currently being shown. This means that when a black image is shown, the backlights are almost 100% off. This technology hasn’t made it into many, if any, computer monitors, but it is in HDMI based TV monitors. If you can find a TV that contains this variable backlight contrast, it can perform a similar inky black function as an OLED monitor, but costing less money to purchase. However, again, you’ll need to read the tech specs of the monitor to determine if it contains this variable contrast backlight system. Many monitors don’t offer this variable system and instead offer only static brightness that must be manually adjusted.

What about QLED?

QLED is another backlit LCD technology and follows all of the same rules as LCD backlit screens. If the QLED monitor ships with variable backlight contrast, then it may be a good candidate for inky blacks. If it doesn’t have variable contrast backlights, then it won’t provide this.

As an FYI, I personally bought my 4K Vizio monitor because it had variable contrast backlight technology. When portions of the screen go black, these sections of the screens have their backlights nearly turn off. It’s a smart design technology used to mimic the contrast levels you can find in a more expensive OLED panels. So, now you know.

If this tutorial was helpful to you, please leave a comment below and let me know.

↩︎

Tagged with: , , , ,

Why does my iPhone/iPad sync all of my music every time?

Posted in Apple, itunes bugs, Mac OS X by commorancy on December 10, 2014

itunes_redI have a lot of music in my iTunes library that I have collected over the years. I also have several Apple devices such as an iPod, an iPad and two iPhones that I sync. Some people see my devices and think I have three phones. Even though it looks like a phone, one of them is an iPod. I carry the iPod for two reasons: 1) If the battery runs out on the iPod, I can still make calls. 2) I put only music on the device leaving my phone open for apps.

Though, that’s not really the problem. I also have multiple computers each running iTunes software and this is where the problems start. When I sync my iPod, it resyncs all 5000+ songs over and over again (takes far too long). Let’s explore.

iTunes and Media

Let’s understand the reason why iTunes resyncs a song to a device. The primary reason iTunes resyncs a song already on your iDevice is due to a change in song metadata. What is metadata? Metadata includes information such as play counts and last access times. It also includes other tag data such as artwork, title, artist, track number, duration, volume, etc. Basically, any changes to any portion of the IDtag associated with the song will force a resync to the device. Why is this important? It’s important because many households now have multiple computers.

For example, let’s say you purchased your brand spanking new Airport Extreme 3TB drive and you have now copied your entire iTunes library of music and movie files to to that network drive in hopes of sharing to your multiple computers. Nothing seems wrong with that, right? So, now all of the computers in your household will optimally share these same exact media files. Definitely a space saver, or so you thought. Yes, it may have solved your space issue, but now it has created an entirely new problem. That problem, last access times will change each time any of these computers sharing this folder play a song. Worse, when any single computer’s iTunes software instance updates to a new version, iTunes will scan the entire library of files. Let’s understand why this is a problem.

Shared Drives, iTunes and Last Access Times

When you have multiple computers accessing a single set of media on a shared network drive, this can lead to the multiple computers battling over which computer has last modified a specific song or movie. In some cases, as I said above, an iTunes instance might touch every file in the library. When other iTunes instances start, they will see the song last modify dates have changed from the last time it launched and mark the song to be downloaded to your device.

Let’s assume you have 3 computers in your household: one is yours, one is your spouse’s and one is your child’s. You have hooked each of these computers to a /Volumes/Music folder hooked to that brand spanking new Airport Extreme 3TB drive (where your media files now live), each of these computers will update the last file time access separately. Let’s say your spouse’s computer’s iTunes has gotten updated to a newer version. Each time an update happens, Apple ‘fixes’ the library to make it compatible with the newest version. This ‘fixing’ action touches every single file in the library and marks the last access updated.

So, you come along and plug in your iPhone to sync on your computer’s iTunes software (also sharing this same folder). Because every file has now been updated as a result of your spouse’s update to the latest iTunes version, your device will now download every song to your device. The same problem will happen when your child’s computer is updated.

How do I solve this problem?

The solutions aren’t as easy as one might hope. The easiest solution is to duplicate your entire library to a new folder and point your iTunes instance to that folder. Then do this again for your spouses computer and your child’s computer. Unfortunately, if your library is terabytes in size, this solution may not be practical. If your library is 100-200GB, that might be possible. This is really the best of all solutions. Once you separate your library into separately duplicated media folders, each iTunes instance will have exclusive access to its files only. This is the best of all worlds because the only iTunes computer that will update those files will be yours alone. This means that play counts and last access times will remain 100% accurate and are controlled exclusively by your iTunes computer. The same for your spouse and your child’s library set. The downside is that any new purchases made by your spouse will need to also be downloaded separately by you and by your child. Downloading from iTunes isn’t a problem today because they allow re-downloads from the cloud. But, it is somewhat of a hassle as what’s contained in each of the libraries will diverge.

In the case where you have a 1TB or larger sized library and this duplication solution is impractical, there is another alternative.

Home Sharing Server

Apple now offers the Home Sharing feature in iTunes. What this setup requires is a single system completely dedicated to the Home Sharing service. I might suggest, for practicality’s sake, to buy a new computer to dedicate iTunes to the Home Sharing server purpose. I might suggest a Mac mini or an iMac for this purpose, though you could just as easily use a Windows machine running iTunes. Let’s assume we’re using a Mac mini for this purpose as Mac mini’s are reasonably inexpensive and will serve this purpose perfectly. For performance reasons, I might also suggest a wired connection between the Mac mini and your shared library device (i.e., Airport Extreme 3TB). Your remote computers can access the Home Sharing library wirelessly.

This setup requires unwinding the shared drives mounted on each computer separately and abandoning that. Instead of sharing a network drive to each computer, you will now exclusively share that folder to the newly designated Home Sharing server. Then, share your iTunes library through Apple’s Home Sharing services within that Mac mini iTunes instance. This will then be the only machine that has direct access to your network drive media files. From here, you will then connect each of the other notebook computers and devices to this Home Sharing server to access playlists, music and movies.

How does this solve the problem? Because the single dedicated Home Sharing server has exclusive access to the files, only it will update metadata rather than having 3 or 4 or more computers competing to change file access times. It also means you only need to create your playlists once rather than on each computer separately. Now, a single set of playlists will reside on the Home Sharing server which can be managed centrally from that single computer.

Why is this not a perfect solution? Play counts. Because each computer accessing the Home Sharing server will update play counts for anything consumed, this can cause those songs with updated play counts to resync with your device each time your child or spouses listens to or watches a movie. On the other hand, the number of media that requires rsyncing will be substantially fewer than when each computer can potentially update every file in the library.

It is also not a perfect solution for syncing because you will need to sync your device with your Home Sharing server itself. Not the computer that’s consuming the Home Sharing library remotely. But, it will nearly eliminate the need to resync every file to your device each time you sync.

Can this be resolved by Apple?

Sure. But, it’s not something that will happen overnight. The reason this is a problem is because iTunes doesn’t fundamentally understand the concept of a multiuser environment. MacOS X does, but not iTunes. Apple has shoehorned in some pseudo multiuser features, but without fully supporting everything required for a multiuser environment. For example, to fully support multiple users on a Home Sharing library, each user would supply a set of unique credentials to identify themselves to get into the library which would then create a separate and unique profile for each user. Under that separate profile, iTunes could keep track of play counts separately for each user. In this way, what you play and what your spouse plays would be unique and different. So, if you synced your device against your user profile, your devices would only download those items that you had consumed with your device(s) only. Same for your spouse and for your child.

Implementing a full separately profiled multiuser system in iTunes is the only way to segregate devices and syncing. This is also the only way to prevent syncing extraneous songs after they have been played by someone else. Unfortunately, today this is not a reality.

Additional benefits that could come out of a multiuser system using individual profiles is parental controls. Each profile could then have a set of permissions to allow or disallow access to parts of the library. For example, if you had a playlist of R rated movies, you could set parental controls to lock out access to that playlist from children. A multiuser system offers a lot of benefits to parents for access controls in addition to solving the problem of re-syncing every song in the library to an iPhone or iPad.

If you would like to see such a feature added to iTunes in the future, I encourage you to visit Apple’s iTunes Feedback page and leave an enhancement request for a full multiuser and parental control system be added to iTunes Home Sharing feature.

Restore a Mac formatted 6th Gen iPod nano in Windows 7

Posted in Apple, botch, Mac OS X by commorancy on September 22, 2012

I recently picked up a sixth generation iPod nano refurbished from Gamestop. When I got home and plugged it into iTunes for Windows 7, iTunes recognized it as a Macintosh formatted iPod and said that it needed to be restored. Here’s where the fun begins.. not. Several things happened after I plugged it in. First, Windows recognized it as drive O: and opened a requester wanting to format the iPod. This format panel stays open until cancelled. Second, when I tried to restore the iPod, iTunes kept showing me error 1436, which is a rather non-descript error that takes you to a mostly generic Apple help page that is only moderately helpful. I take that back, this help page wasn’t helpful at all.

Note, Macintosh formatted iPods cannot be used with Windows. However, Windows formatted iPods can be used on both Windows and Macs. So, this is simply a problem that exists because this iPod was originally formatted on a Mac. Such stupid issues that cause such time wasting problems.

How did the first restore go?

It didn’t. I realized the above mentioned Windows disk format panel had the iPod open and the 1436 error was due to this. However, that was just the beginning of the problems. When I cancelled that panel and I tried the restore again, I got a different issue. Basically, iTunes opens a progress bar that keeps moving without any progress. I wasn’t sure if this progress panel was normal or abnormal. Although, I suspected abnormal after 3 minutes without any changes. So, I began searching for how long an iPod restore should take. I found that restore should complete in only a few minutes (less actually). So, I knew something was wrong when it wasn’t making any progress.

Disk Mode

It was clear that iTunes wasn’t going to restore this iPod through its normal means. I began searching on the net for how to recover this iPod and ran into a site that led me to Apple’s How to put an iPod in Disk Mode help page. This page is actually very useful and where the 1436 error page should have led me but didn’t.

What is Disk Mode? Disk Mode puts the iPod into a state that allows it to be formatted as a disk. Well, you don’t really want to format it. Instead, in Disk Mode, it gets rid of all that pesky Macintosh formatting garbage and actually lets you restore it properly. For the sixth gen iPod nano, to put it in Disk Mode, press and hold the power and volume down buttons until the screen turns black and the Apple logo appears. When you see the Apple logo, press and hold both volume up and down buttons until the iPod shows a white screen. This is the Disk Mode screen.

Recovering

At this point, I plugged the iPod back in with iTunes running and iTunes saw that the iPod was ‘corrupted’ and asked to restore it. Well, the restoration this time went like a champ. No issues at all. However, after I restored it, I did have to close out of iTunes and restart iTunes. Until I did that, iTunes kept telling me that the iPod was in ‘Recovery Mode’ even though I knew that it wasn’t based on the screen of the iPod. After restarting iTunes, that stopped and it finally recognized the iPod as new and let me put music on it. Yay!

So, there you have it. Although, it should have been as simple as plug-in and restore. But, Apple had to make this a chore because of the PC vs Mac formatting thing. Seriously, is that even necessary?

Design

Let me take a moment to commend Apple on this design of this iPod nano. When the first long skinny nano was first released, I thought it was kind of cool, but not worth it. Then the smaller squatty nano arrived and I liked that design so much that I bought one. I got my use out of that and eventually bought an iPod touch. However, the iPod touch isn’t useful in all circumstances and I wanted something smaller and lighter. When this nano was released, I always thought it was a great idea and well executed save for the fact that it has no application support. So, here’s where Apple dropped the ball on this one.

The size and weight is awesome. The look is great, especially if you get a watch band. It just needed a refresh to add a few more features like Bluetooth, video (although, not really necessary in my book) and apps support. I loved the square display because this is the exact image ratio of CD covers. So, it was the perfect marriage between a music player and a user interface. Some people complained that the touch display was overkill. Perhaps, but I always liked it, but I have never needed one of these. I still don’t really need one. The reason I bought one is because Apple has discontinued this model in lieu of it’s bigger screen cousin.

The new nano, however is neither nano in size nor is it really that small. This nano was the perfect size and perfect shape. It truly deserved the name nano. However, the new nano is really not deserving of that name. The screen is too big and it’s really just a dumbed down iPod touch. Yes, the new nano has video capabilities, but so what? I don’t plan on ever loading video on it. Without WiFi or streaming mechanisms, there’s no point. I realize Apple wants to enrich their ecosystem (read, sell more videos to people), but this isn’t the device to do it. In fact. this latest nano design to ship late 2012 is really not that great looking. I feel that it’s stepping too far into the same territory as the iPod touch. So, why do this? It’s also bigger, bulkier and likely heavier. The battery life is probably shorter even. It’s no longer a small portable player.

The 6th generation iPod nano (this one I just bought) is truly small and light. It can go just about anywhere and has a built-in clip even! It lacks some features, yes, but for a music player I certainly don’t miss them. If you’re thinking of buying a 6th generation iPod nano, you should do it now while the Apple outlet still has them in stock. Yes, they are refurbished, but they’re still quite spectacular little music players. However, don’t go into the purchase expecting the feature-set of an iPhone or an iPod touch. It’s not here. If you go into the purchase thinking it’s an iPod shuffle with a display, then you won’t be disappointed with the purchase.

Apple’s ever changing product line

What I don’t get about Apple is removing a product from its product lineup that clearly has no competition in the marketplace at all, let alone having no competition even within its own product lineup. Yet, here we are. Apple is dropping the 6th generation design in lieu of the 7th generation design that’s bigger and bulkier (and likely heavier). In fact, it looks a lot like a smaller dumbed-down iPod touch.

In reality, the 7th gen nano is so close to becoming a tiny iPod touch clone that it clearly competes with the Touch. This is bad. The 6th generation nano (pictured above) in no way competes with the iPod touch, other than it has a tiny touch screen. The 6th generation nano design clearly still has a place in Apple’s lineup. I just don’t get why they dump products from their lineup and replace them with designs that aren’t likely to sell better (0ther than to those people who complained you couldn’t play video on the 6th gen nano). The 6th gen nano is great for the gym or while running. However, after this newest nano is introduced, if you want a square sized small music player, you have to get a shuffle with no display. The bigger bulkier 7th gen design just won’t work for most activity use cases. Apple, your design team needs to better understand how these devices are actually being used before you put pen to paper on new designs, let alone release them for public consumption. Why is it always just one device? Why can’t you have both in the product lineup?

Of course, if they had retained an updated 6th gen model along with adding the 7th gen model, then that would make a lot more sense. Removing the older model in lieu of this one, this is not a replacement design. You can’t wear this one like a watch. So, that whole functionality is gone. What I would like to have seen is two models. A 6th gen revamped to add more features like Bluetooth and perhaps a camera and, at the same time, introducing this new video capable model. The updated 6th gen doesn’t need to playback movies, the screen is too tiny for that. In fact, the screen on this new 7th gen model is too tiny for that. Even the iPod touch is too tiny for watching movies, in practicality. It’s not until you get to the iPad does watching a movie even become practical. In a pinch, yes you could watch a video or movie, but you’d be seriously straining your eyes. I’d rather do that (or rather, not strain my eyes) with a much bigger screen. No, an updated square-format touch screen iPod is still very much necessary in the lineup. I understand Apple’s need for change here, but not for the use case that’s now lost with this 7th generation iPod. Sometimes, Apple just doesn’t seem to get it. This is just one of a new series of cracks in the armor that is the new Jobs-less era Apple. Welcome to the new Apple folks.

↩︎

How to format NTFS on MacOS X

Posted in Apple, computers, Mac OS X, microsoft by commorancy on June 2, 2012

This article is designed to show you how to mount and manage NTFS partitions in MacOS X.  Note the prerequisites below as it’s not quite as straightforward as one would hope.  That is, there is no native MacOS X tool to accomplish this, but it can be done.  First things first:

Disclaimer

This article discusses commands that will format, destroy or otherwise wipe data from hard drives.  If you are uncomfortable working with commands like these, you shouldn’t attempt to follow this article.  This information is provided as-is and all risk is incurred solely by the reader.  If you wipe your data accidentally by the use of the information contained in this article, you solely accept all risk.  This author accepts no liability for the use or misuse of the commands explored in this article.

Prerequisites

Right up front I’m going to say that to accomplish this task, you must have the following prerequisites set up:

  1. VirtualBox installed (free)
  2. Windows 7 (any flavor) installed in VirtualBox (you can probably use Windows XP, but the commands may be different) (Windows is not free)

For reading / writing to NTFS formatted partitions (optional), you will need one of the following:

  1. For writing to NTFS partitions on MacOS X:
  2. For reading from NTFS, MacOS X can natively mount and read from NTFS partitions in read-only mode. This is built into Mac OS X.

If you plan on writing to NTFS partitions, I highly recommend Tuxera over ntfs-3g. Tuxera is stable and I’ve had no troubles with it corrupting NTFS volumes which would require a ‘chkdsk’ operation to fix.  On the other hand, ntfs-3g regularly corrupts volumes and will require chkdsk to clean up the volume periodically. Do not override MacOS X’s native NTFS mounter and have it write to volumes (even though it is possible).  The MacOS X native NTFS mounter will corrupt disks in write mode.  Use Tuxera or ntfs-3g instead.

Why NTFS on Mac OS X?

If you’re like me, I have a Mac at work and Windows at home.  Because Mac can mount NTFS, but Windows has no hope of mounting MacOS Journaled filesystems, I opted to use NTFS as my disk carry standard.  Note, I use large 1-2TB sized hard drives and NTFS is much more efficient with space allocation than FAT32 for these sized disks.  So, this is why I use NTFS as my carry around standard for both Windows and Mac.

How to format a new hard drive with NTFS on Mac OS X

Once you have Windows 7 installed in VirtualBox and working, shut it down for the moment.  Note, I will assume that you know how to install Windows 7 in VirtualBox.  If not, let me know and I can write a separate article on how to do this.

Now, go to Mac OS X and open a command terminal (/Applications/Utilities/Terminal.app).  Connect the disk to your Mac via USB or whatever method you wish the drive to connect.  Once you have it connected, you will need to determine which /dev/diskX device it is using.  There are several ways of doing this.  However, the easiest way is with the ‘diskutil’ command:

$ diskutil list
/dev/disk0
   #: TYPE NAME SIZE IDENTIFIER
   0: GUID_partition_scheme *500.1 GB disk0
   1: EFI 209.7 MB disk0s1
   2: Apple_HFS Macintosh HD 499.8 GB disk0s2
/dev/disk1
   #: TYPE NAME SIZE IDENTIFIER
   0: GUID_partition_scheme *2.0 TB disk1
/dev/disk2
   #: TYPE NAME SIZE IDENTIFIER
   0: Apple_partition_scheme *119.6 MB disk2
   1: Apple_partition_map 32.3 KB disk2s1
   2: Apple_HFS VirtualBox 119.5 MB disk2s2

 
Locate the drive that appears to be the size of your new hard drive.  If the hard drive is blank (a brand new drive), it shouldn’t show any additional partitions. In my case, I’ve identified that I want to use /dev/disk1.  Remember this device file path because you will need it for creating the raw disk vmdk file. Note the nomenclature above:  The /dev/disk1 is the device to access the entire drive from sector 0 to the very end.  The /dev/diskXsX files access individual partitions created on the device.  Make sure you’ve noted the correct /dev/disk here or you could overwrite the wrong drive.

Don’t create any partitions with MacOS X in Disk Utility or in diskutil as these won’t be used (or useful) in Windows.  In fact, if you create any partitions with Disk Utility, you will need to ‘clean’ the drive in Windows.

Creating a raw disk vmdk for VirtualBox

This next part will create a raw connector between VirtualBox and your physical drive.  This will allow Windows to directly access the entire physical /dev/disk1 drive from within VirtualBox Windows.  Giving Windows access to the entire drive will let you manage the entire drive from within Windows including creating partitions and formatting them.

To create the connector, you will use the following command in Mac OS X from a terminal shell:

$ vboxmanage internalcommands createrawvmdk \
-filename "/path/to/VirtualBox VMs/Windows/disk1.vmdk" -rawdisk /dev/disk1

 
It’s a good idea to create the disk1.vmdk where your Windows VirtualBox VM lives. Note, if vboxmanage isn’t in your PATH, you will need to add it to your PATH to execute this command or, alternatively, specify the exact path to the vboxmanage command. In my case, this is located in /usr/bin/vboxmanage.  This command will create a file named disk1.vmdk that will be used inside your Windows VirtualBox machine to access the hard drive. Note that creating the vmdk doesn’t connect the drive to your VirtualBox Windows system. That’s the next step.  Make note of the path to disk1.vmdk as you will also need this for the next step.

Additional notes, if the drive already has any partitions on it (NTFS or MacOS), you will need to unmount any mounted partitions before Windows can access it and before you can createrawvmdk with vboxmanage.  Check ‘df’ to see if any partitions on drive are mounted.  To unmount, either drop the partition(s) on the trashcan, use umount /path/to/partition or use diskutil unmount /path/to/partition.  You will need to unmount all partitions on the drive in question before Windows or vboxmanage can access it.  Even one mounted partition will prevent VirtualBox from gaining access to the disk.

Note, if this is a brand new drive, it should be blank and it won’t attempt to mount anything.  MacOS may ask you to format it, but just click ‘ignore’.  Don’t have MacOS X format the drive.  However, if you are re-using a previously used drive and wanting to format over what’s on it, I would suggest you zero the drive (see ‘Zeroing a drive’ below) as the fastest way to clear the drive of partition information.

Hooking up the raw disk vmdk to VirtualBox

Open VirtualBox.  In VirtualBox, highlight your Windows virtual machine and click the ‘Settings’ cog at the top.

  • Click the Storage icon.
  • Click the ‘SATA Controller’
  • Click on the ‘Add Hard Disk’ icon (3 disks stacked).
  • When the ? panel appears, click on ‘Choose existing disk’.
  • Navigate to the folder where you created ‘disk1.vmdk’, select it and click ‘Open’.
  • The disk1.vmdk connector will now appear under SATA Controller

You are ready to launch VirtualBox.  Note, if /dev/disk1 isn’t owned by your user account, VirtualBox may fail to open this drive and show an error panel.  If you see any error panels, check to make sure no partitions are mounted and  then check the permissions of /dev/disk1 with ls -l /dev/disk1 and, if necessary, chown $LOGNAME /dev/disk1.  The drive must not have any partitions actively mounted and /dev/disk1 must be owned by your user account on MacOS X.  Also make sure that the vmdk file you created above is owned by your user account as you may need to become root to createrawvmdk.

Launching VirtualBox

Click the ‘Start’ button to start your Windows VirtualBox.  Once you’re at the Windows login panel, log into Windows as you normally would.  Note, if the hard drive goes to sleep, you may have to wait for it to wake up for Windows to finish loading.

Once inside Windows, do the following:

  • Start->All Programs->Accessories->Command Prompt
  • Type in ‘diskpart’
  • At the DISKPART> prompt, type ‘list disk’ and look for the drive (based on the size of the drive).
    • Note, if you have more than one drive that’s the same exact size, you’ll want to be extra careful when changing things as you could overwrite the wrong drive.  If this is the case, follow these next steps at your own risk!
DISKPART> list disk
Disk ### Status Size Free Dyn Gpt
 -------- ------------- ------- ------- --- ---
 Disk 0 Online 40 GB 0 B
 Disk 1 Online 1863 GB 0 B *
  • In my case, I am using Disk 1.  So, type in ‘select disk 1’.  It will say ‘Disk 1 is now the selected disk.’
    • From here on down, use these commands at your own risk.  They are destructive commands and will wipe the drive and data from the drive.  If you are uncertain about what’s on the drive or you need to keep a copy, you should stop here and backup the data before proceeding.  You have been warned.
    • Note, ‘Disk 1’ is coincidentally named the same as /dev/disk1 on the Mac.  It may not always follow the same naming scheme on all systems.
  • To ensure the drive is fully blank type in ‘clean’ and press enter.
    • The clean command will wipe all partitions and volumes from the drive and make the drive ‘blank’.
    • From here, you can repartition the drive as necessary.

Creating a partition, formatting and mounting the drive in Windows

  • Using diskpart, here are the commands to create one partition using the whole drive, format it NTFS and mount it as G: (see commands below):
DISKPART> select disk 1
Disk 1 is now the selected disk
DISKPART> clean
DiskPart succeeded in cleaning the disk.
DISKPART> create partition primary
DiskPart succeeded in creating the specified partition.
DISKPART> list partition
Partition ### Type Size Offset
 ------------- ---------------- ------- -------
* Partition 1 Primary 1863 GB 1024 KB
DISKPART> select partition 1
Partition 1 is now the selected partition.
DISKPART> format fs=ntfs label="Data" quick
100 percent completed
DiskPart successfully formatted the volume.
DISKPART> assign letter=g
DiskPart successfully assigned the drive letter or mount point.
DISKPART> exit
Leaving DiskPart...

 

  • The drive is now formatted as NTFS and mounted as G:.  You should see the drive in Windows Explorer.
    • Note, unless you want to spend hours formatting a 1-2TB sized drive, you should format it as QUICK.
    • If you want to validate the drive is good, then you may want to do a full format on the drive.  New drives are generally good already, so QUICK is a much better option to get the drive formatted faster.
  • If you want to review the drive in Disk Management Console, in the command shell type in diskmgmt.msc
  • When the window opens, you should find your Data drive listed as ‘Disk 1’

Note, the reason to use ‘diskpart’ over Disk Management Console is that you can’t use ‘clean’ in Disk Management Console, this command is only available in the diskpart tool and it’s the only way to completely clean the drive of all partitions to make the drive blank again.  This is especially handy if you happen to have previously formatted the drive with MacOS X Journaled FS and there’s an EFI partition on the drive.  The only way to get rid of a Mac EFI partition is to ‘clean’ the drive as above.

Annoyances and Caveats

MacOS X always tries to mount recognizable removable (USB) partitions when they become available.  So, as soon as you have formatted the drive and have shut down Windows, Mac will likely mount the NTFS drive under /Volumes/Data.  You can check this with ‘df’ in Mac terminal or by opening Finder.  If you find that it is mounted in Mac, you must unmount it before you can start VirtualBox to use the drive in Windows.  If you try to start VirtualBox with a mounted partition in Mac OS X, you will see a red error panel in VirtualBox.  Mac and Windows will not share a physical volume.  So you must make sure MacOS X has unmounted the volume before you start VirtualBox with the disk1.vmdk physical drive.

Also, the raw vmdk drive is specific to that single hard drive.  You will need to go through the steps of creating a new raw vmdk for each new hard drive you want to format in Windows unless you know for certain that each hard drive is truly identical.  The reason is that vboxmanage discovers the geometry of the drive and writes it to the vmdk.  So, each raw vmdk is tailored to each drive’s size and geometry.  It is recommended that you not try to reuse an existing physical vmdk with another drive.  Always create a new raw vmdk for each drive you wish to manage in Windows.

Zeroing a drive

While the clean command clears off all partition information in Windows, you can also clean off the drive in MacOS X.  The way to do this is by using dd.  Again, this command is destructive, so be sure you know which drive you are operating on before you press enter.  Once you press enter, the drive will be wiped of data.  Use this section at your own risk.

To clean the drive use the following:

$ dd if=/dev/zero of=/dev/disk1 bs=4096 count=10000

 
This command will write 10000 * 4096 byte blocks with all zeros.  This should overwrite any partition information and clear the drive off.  You may not need to do this as the diskpart ‘clean’ command may be sufficient.

Using chkdsk

If the drive has become corrupted or is acting in a way you think may be a problem, you can always go back into Windows with the data1.vmdk connector and run chkdsk on the volume.  You can also use this on any NTFS or FAT32 volume you may have.  You will just need to create a physical vmdk connector and attach it to your Windows SATA controller and make sure MacOS X doesn’t have it mounted. Then, launch VirtualBox and clean it up.

Tuxera

If you are using Tuxera to mount NTFS, once you exit out of Windows with your freshly formatted NTFS volume, Tuxera should immediately see the volume and mount it.  This will show you that NTFS has been formatted properly on the drive.  You can now read and write to this volume as necessary.

Note that this method to format a drive with NTFS is the safest way on Mac OS X.  While there may be some native tools floating around out there, using Windows to format NTFS will ensure the volume is 100% compliant with NTFS and Windows.  Using third party tools not written by Microsoft could lead to data corruption or improperly formatted volumes.

Of course, you could always connect the drive directly to a Windows system and format it that way. ;)

Tagged with: , ,

Bad Operating System Design Ideas Part 1

Posted in Apple, Mac OS X, windows by commorancy on November 6, 2011

Here is a new series I am putting together.  While we all need to use operating systems every day, there are lots of stupid ideas that abound on these devices that some developer thought would be ‘cool’.  Let’s explore these design ideas and why they’re stupid.  Let’s start with one company that people seem to think can do no wrong.. Apple.  Yeah, I could start with the easiest target, Windows, but I’ll save the best (er.. easiest) for last. :)

Apple isn’t immune

Spring Loaded Folders

Apple’s OS X most definitely has some quirky and, frankly, stupid design ideas that simply need to go away.  For very good reason, the first on this list is spring loaded folders. This is one design idea that breaks EVERY UI rulebook.  This functionality moves windows around under the cursor to unexpected places during, of all times, when you’re about to drop a file or folder on it.  It’s almost like some kind of bizarre practical joke. I mean, if this isn’t the absolute worst idea, I don’t know what is.  I’m not even sure what they were thinking at the time of conception, but windowing operating systems should never ever move windows or cursors automatically.  Let the user move things if they want them moved.  Worse, the idea of spring loaded folders has nothing at all to do with moving the windows around.  The spring loaded folder is supposed to open a folder when you are dragging and hovering over to the top of a folder name.  While opening a new window in the middle of holding drag-and-drop operation may seem like a great idea, it’s really obvious why this UI concept doesn’t work:  it will lead to dropping folders into the wrong place.  I don’t even want to say how many times I’ve inadvertently lost folders and files as a result of spring loaded folders. Yes, at least you can turn it off and it should be off by default.

Android isn’t immune

There is no easy way to manage running applications (at least not in 2.2) or really any other settings.  You have to dig through the ‘Settings’ area to get to Applications and then manage them from there after a few drill downs.  Same with most settings.  This is a mobile device.  These things need EASY and FAST access.  Digging through 5 menus to get to the Bluetooth area is both wasteful and dangerous while driving.  Let’s get these things front and center with one click.

IOS isn’t immune

Dragging icons from screen to screen to move them is near impossible.  Most times it drops onto the current screen at the edge.  You then have to pick it up and drag it again.  It would be far simpler to show a representation of all of the screens at once and then drop it onto the screen you want it on.  You can then put it in the exact location later.

Windows isn’t immune (but who said it was?)

When you’re hovering over a scrollable area of an Explorer window, you have to click to activate before you can scroll.  The trouble is, there is no empty place to click that doesn’t activate something.  If you’re hovering over the folder area, whatever you click on will activate.  If you’re in the files area, the same thing.  This is magnified when the Explorer window also happens to be a file requester.  So, you’re trying to scroll to the bottom of the files area.  If you click anywhere in the files area, it will fill in the filename with the file you have just clicked.  Annoying.  I don’t know why Windows can’t just realize the mouse pointer is over that area and activate at least the scrolling part.  There really should be no click necessary.

Why Windows can’t remember my folder settings in Windows 7, I have no idea.  Getting rid of the Quick Launch bar, bad idea.  Turning the ‘Start’ button into the ‘Windows’ button, stupid (at least from a support perspective).  Can we at least keep some consistency from one OS to the next?

These are my initial pet peeves.  There are tons more that have yet to be documented.  I will highlight these in part two of this series.

Enjoy (and comment if you have peeves of your own).

Installing Mac OS X (Snow Leopard) in VMWare Player 3

Posted in Apple, Mac OS X, Uncategorized, virtualization by commorancy on January 9, 2011

 

With this article, I’ll start by saying.. please purchase your copy of Mac OS X desktop software from Apple. It’s $29 and you get the original media (which is always good to have on hand).

 

 

To start, here are the softwares you will need:

Installing Mac OS X on VMWare Player is a pretty simple install, but note that there are some important issues that aren’t yet resolved. I’ll explain the issues, however, after the install steps.

Installation

Inside the Empire EFI 1.3.2 archive, you will see the following files:

You will see that the extracted ‘Snowy_VM’ folder contains several files besides just the EFI media.  Inside the Mac OS X Server*.vmwarevm directory, you’ll see it contains two .vmx templates for VMWare.  Use the .vmx file without the underscore at the beginning.  Note, you’ll need to use this template to get the install going.  It’s far simpler to use their existing template than trying to figure out all the proper VMWare Player settings.  So, use what’s given rather than trying to reinvent the wheel.  If you absolutely feel you want to reinvent, then I’ll leave that for you to determine what’s necessary.

To begin, inside VMWare Player, select File->Open a Virtual Machine.  Find the .vmx file mentioned just above and open it.  Once opened, it will appear as ‘Mac OS X Server 10.6 (experimental)’ in the VMWare Player selection panel.  From here, you will need to modify the settings for the CDROM device under this machine.  Choose the ‘Mac OS X Server 10.6 (experimental)’ imported machine and choose ‘Edit virtual machine settings’ on the bottom right of the window.  Now click the on the CDROM device and under ‘Connection’ change it to ‘Use ISO image’ and browse to and select the darwin_snow.iso image inside the Snowy_VM directory’. Click ‘OK’.

You’re now ready to boot.  So, click ‘Play Virtual Machine’.  Once the machine has started and the system begins searching for a CDROM (read the text on the screen), you will need to change the CDROM to the Mac OS X Snow Leopard media.  I recommend using an ISO media to install. So, I will assume you are using an ISO image here.  At the bottom of the active VM Window, right click the CDROM icon which may now be greyed out (disconnected) and choose ‘Settings’.  Locate the Snow Leopard media on your hard drive and click ‘OK’ to accept it.  Check the box next to ‘Connected’ at the top of the window and click ‘OK’ at the bottom.

The system should recognize the disk change and begin to boot the media in about 10 seconds.  Once the install begins, you are now installing Mac OS X.  Follow the steps to install Mac OS X.  Once Mac OS X is installed, reboot.  Note the hard drive given in this Snowy_VM archive is ‘ready to go’.  So you don’t need to format it.

Booting issues with VMWare Player and Mac OS X

Let’s pause and explain this.  When you reboot the first time, the system may or may not boot up.  There are two behaviors you should watch for.  The first behavior is that you get to the Apple Logo screen with the spinning lines.  If it never progresses beyond this grey screen, then you will need to reboot and try again.

The second behavior is that it may get past the grey screen, but then Finder never appears and you see a forever spinning cursor.  If you see this, you will need to reboot and try again.

These issues are annoying, but that’s why this is ‘experimental’.  So, we live with these issues.

The third issue is that you will need to continually leave the darwin_snow.iso image in the drive all of the time to boot up Mac OS X. Hey, at least it works.  Leaving it in the drive is really not a problem as it boots up so quickly.  Perhaps they can create a standalone booter later, but for now this works.

Note, I recommend setting up a second CDROM drive inside your Mac OS X virtual machine’s settings.  This way, you leave one CDROM always set up with darwin_snow.iso and you use the second one to load/unload other ISO images.  If you like, you can set the second one up to your physical drive also so you can pop real CDs in the drives as you need.  Note that if you change the darwin_snow.iso image to something else, you have to remember to set it back when you’re done.  If you don’t do this, Mac OS X won’t boot.  So, this is why I recommend setting up a second drive for loading ISO images.

Booting up successfully

After getting through any unsuccessful boot attempts (or not), you should get to the registration screen.  After going through all of the registration screens you will be at the standard Finder desktop.  At this point, you might want to change things like Sound and Display. Note that the sound and display drivers are just about as good as what’s in Virtual Box.  In fact, Virtual Box’s resolution setup is a bit more complete than this.  So, don’t expect a whole lot here.

Suffice it to say that you will need to follow editing of the apple.com.Boot.plist file as in the ‘Installing Mac OS X on VirtualBox‘ article on Randosity.  Add in the lines related to the graphics.  Once you have done this, edit the virtual machine in VMWare player and choose the Display setup.   Under ‘Monitors’ change it to ‘Specify Monitor Settings’ and manually change the maximum resolution to ‘1366×768’. When you reboot, Mac OS X should go into this mode.  If it doesn’t work, then you may have to fiddle with the apple.com.Boot.plist file until it works.  Note that the resolutions here are limited, so don’t try to set up some odd resolution as it won’t work.

Note, this is the best resolution I could find.  Note that in the above directory, you’ll see the file ‘EnsoniqAudioPCI.mpkg.tar’.  This is a Mac OS X driver for audio.  I have tried installing this without success.  But, your mileage may go farther.  The trick is in getting this into the Mac.  So, you’ll need to start a browser and download the EFI file again on the Mac.  Then extract it, find this file and install it.

At this point, you should be all set.  You may run into the booting issues from time to time, just reboot until it boots up.  Hopefully this booting issue will be fixed at some point.  Good luck and happy installing.

If you’re looking for something that boots consistently for Mac OS X, has better video mode support and working sound, then I would suggest setting up Mac OS X on VirtualBox. The setup for VirtualBox is a little more complex, but it boots consistently every time, has its own standalone boot loader and offers a few more features.

If you have questions, please leave a comment below.

Running / Installing Mac OS X (Snow Leopard) on VirtualBox

Posted in Apple, Mac OS X, VirtualBox, virtualization by commorancy on June 21, 2010

Updated 8/2/2011

Lion Update

With the recent release of Lion, there is a push to get a Lion version working on VirtualBox.  At present, there is yet no boot loader capable of booting Lion on VirtualBox. So, for now, Snow Leopard is still it for a standalone MacOS on VirtualBox.  I will update this article as necessary to address a working installation of Lion as it progresses.  Stay Tuned.

Nawcom Mod CD

There is a new CD image from Nawcom (http://blog.nawcom.com/?p=306) that makes installation of MacOS X much easier on VirtualBox (instead of using Prasys’ EFI boot CDs).  And yes, I’ve tried it.  The Nawcom EFI CD is much faster for installation because it does some very clever things, including installing the boot loader at the end of the install.

So, I am now recommending you to download and use the Nawcom ModCD instead of the Prasys EFI boot CDs listed below.  Although, I will leave the information for the Prasys Empire EFI CDs available should the Nawcom CD not work for you.  Alternatively, you can try the tonymacx86.com iBoot or iBoot Legacy CDs if all else fails.  Even using the Nawcom ModCD, you will still need to follow the instructions on changing the resolution of the screen as documented below as this CD doesn’t change that part of the installation process.

Go!

Let’s start by saying this. Support Apple by legally buying your copy of Mac OS X.  Don’t pirate it.

Note also that buying a retail packaged disk from the Apple store prevents a lot of headaches during this process.  A Mac OS X Install Disk that comes bundled with any Mac system will only install on the hardware with which it came bundled.  For example, if you try to install from a bundled DVD media that was shipped along with a MacBook Pro, it will not install on Virtualbox and you will see the error ‘Mac OS X cannot be installed on this computer’.  Save yourself the headache and get a retail disk from the Apple store.

Before getting started, if you are wanting to run Mac OS X on VMWare Player 3 instead, then check out Randosity’s Running Mac OS X on VMWare Player 3 article for details.

Apple’s Stance

Apple wants you to buy and run Mac OS X (desktop edition) on a MacBook Pro or other similar Mac hardware. While I think that’s a grand notion to sell the hardware, the hardware will sell regardless of the operating system. Further, if you are a hardware company, why sell the operating system separately anyway? I mean, if it’s the hardware that matters, how is it that you can buy Mac OS X separately both desktop and server editions. I digress.

Because Apple wants you to buy into their hardware platforms, they would prefer you not run Mac OS X on Virtual Environments. I personally think, however, that this idea is both socially and ecologically irresponsible. For a company that tries to tout itself as Green and Earth-Friendly, by not allowing virtualization of Mac OS X (any desktop version), this prevents people from using the hardware they already have and instead forces us to buy new hardware that will eventually fill landfills. Using existing hardware that may work just fine, although not made by Apple, at least keeps the hardware out of the land fill and they are still making money off selling the operating system.

Supported vs Non-Supported CPUs

Note, these boot CDs support specific types of CPUs.  If your CPU is not listed (i.e., Atom processor), you will need to download and use the CDs labeled with the word ‘Legacy’.   These CDs may or may not work for your CPU, but these are the only CDs that have a chance of working on non-supported CPU types.

Let’s get started — items required

  • A recent PC hardware config (within the last 3 years) installed with 64 bit Windows 7 or Vista or Linux 64 bit
    • Note, the faster the PC is, the better that VirtualBox will work.
  • A recent processor (Intel core i3, i5, i7, i3m, i5m, i7m, AMD Phenom or similar 64 bit processor)
  • Enabled VT-x (for Intel Processors) or AMD-v (for AMD processors) in the PC BIOS
  • Retail version of Mac OS X Snow Leopard.  (If you try any other version other than the retail package, it probably won’t work!)

As stated above, you will need hardware capable of VT-x / AMD-v (BIOS level virtualization support passthrough). Without this hardware configuration, you will not be able to install Mac OS X. Most recent dual and quad core processors support this technology. Although, you may have to enter the BIOS to enable it. So, check your BIOS for ‘Virtualization’ settings and enable it.

Pick your host operating system. You can run Windows 7, Vista, XP, Linux (Ubuntu, Redhat, etc) or Solaris. Whichever operating system you choose for the host, make sure it’s a 64 bit edition. I recommend Windows 7 64 bit edition as XP 64 bit edition can be somewhat of a bear to work with and Vista isn’t readily available at this point. If you’re looking for the least expensive solution, then I would choose Linux. I personally use Windows because I also need Windows 7 for other tasks as well. If you are currently running a 32 bit OS edition, you will first need to upgrade the host to 64 bit to operate Snow Leopard. Snow Leopard is mostly 64 bit now and, thus, requires a 64 bit host OS to function.

Note that this tutorial was tested using Mac OS X 10.6.3 (Snow Leopard). OS X may install using 10.6.4 or later, but Apple may also make changes that could prevent it from working. If you have an older install disk than 10.6.3, the installation may fail. I recommend using 10.6.3 or later.

What is EFI?

One other thing to note about Macintosh computers and Snow Leopard… Macintosh computers require an EFI BIOS to boot. What is EFI? EFI stands for Extensible Firmware Interface and was developed by Intel for the Itanium platform in the mid-90s. This ‘BIOS’ replacement is designed to allow direct 32 and 64 bit addressing right from the firmware unlike the PC BIOS which only allows 16 bit addressing during boot operations.

Apple integrated EFI into the PowerPC and later the Intel Macintosh line to boot Mac OS X. Because this boot system is not compatible with PC BIOS, it requires the standard PC BIOS to boot an EFI boot system first. Then, the EFI boot system can then boot Mac OS X. So, the boot system goes like this:

  • PC BIOS boots EFI
  • EFI boots Mac OS X

Yes, VirtualBox has an EFI boot system within, but this EFI system will not boot Mac OS X (probably on purpose). Instead, the Empire EFI boot ISO is necessary to boot Mac OS X (both the Mac OS X install media and the actual operating system once installed).

Focus on Windows

With this post, I will focus on using Windows as the Host and Mac OS X as the guest. You can utilize this guide if you want to use Linux, but you will need to determine how to get certain steps done with Linux (i.e., creating and/or mounting ISO images). So, let’s get going.

Items you’ll need

Steps to get it working

  • Install VirtualBox on Windows
  • Open VirtualBox and click ‘New’. This will start a Machine build Wizard
  • Name this machine ‘Mac OS X’
  • Set the Type to Mac OS X + Mac OS X Server (if it isn’t already) and click Next
  • Set memory to 1024 (or whatever you want to give it) and click Next
  • Under Boot Hard disk, either create a new HD or select an existing HD file* (at least 20GB), click Next
  • If Creating new, continue onward. Otherwise, skip down to ‘Readying VM for First Use’
  • In the New HD Panel, choose Dynamic Expanding Storage, Click Next
  • Click the Folder icon to choose where this disk is to be stored (C not recommended)
  • Set the size to 20GB (type in 20GB), click Next
  • Click Finish to exit HD creation and click Finish again to exit VM creation

Readying VM for First Use

Now you have a new VM for Mac OS X set up, it’s not to use ready yet. So, Let’s ready it for use:

  • Click to select the Mac OS X machine
  • Click the ‘Settings’ button
  • Click the System settings icon
  • Uncheck ‘Enable EFI’ (we will use EFI, just not VBox’s built-in version**)
  • Under Processor tab, leave it at 1 CPU and enable PAE/NX if it isn’t already
  • Under Acceleration, Enable VT-x/AMD-v (must be enabled). Without this setting, you can’t run Mac OS X in VBox.***
  • Under Display, set the Video Memory to 128 and Enable 3D Acceleration
  • Under Storage, IDE controller type must be ICH6
  • Also under Storage, click ‘Empty’ cdrom drive and set the Empire EFI disk to this drive using the Folder icon****.
  • Audio Driver is Windows Directsound + ICH AC97
  • Network should be Bridged Adapter (NAT may work)
  • Click ‘OK’ to save these settings

Now you’re ready to start the install process. Click the ‘Start’ button to start the Mac OS X virtual machine. Once the Empire EFI screen has loaded, eject the Empire EFI ISO image by unchecking it from the Devices->CD/DVD Devices Menu and then locate your Mac OS X Install ISO and select this. If you have the original media and want to create an ISO, go to the ‘Creating an ISO image with ImgBurn’ section below. After the Mac OS X install ISO is selected and you’re back at EFI, press the F5 key. The screen should refresh to show the newly inserted Mac OS X install media. Once it shows the install media, press the enter key to begin installation.

Note, if you start this process using the Empire ISO image, then you must use a Mac OS X Install ISO. If you want to use the physical media, then you’ll need to burn the Empire ISO to a CD and boot from the physical media drive in VirtualBox. You can then eject that media and insert the Mac OS X install media. You cannot mix and match ISO to physical media. I was not able to get mixing ISO and physical media to work in Empire EFI.

Installation of Mac OS X

Once you get the Mac OS X Installer going, I’ll leave it up to you to finish the full install process. However, I will say this about the hard drive. The VBox HD is blank. So, you will need to prepare it with ‘Disk Utility’. Once the Mac OS X installer starts and you get to the first screen with a menu bar, choose Utilities-> Disk Utility. It will recognize the Disk is there, but it cannot be used until it is partitioned and formatted. Choose the VBox disk and click the ‘Erase’ tab. Under Erase, choose Mac OS X Extended (Journaled) and then name it ‘Hard Disk’ (or whatever you want to call it) and click the ‘Erase’ button. It will confirm that you want to do this, so click ‘Erase’ again. Exit Disk Utility and continue the installation. It will probably take 30-40 minutes to install Mac OS X depending on various factors.

Mac OS X Installed — What’s Next?

If you’ve installed from the Nawcom ModCD, then skip this part and go directly to Final Steps + Increasing screen resolution.  If you’ve installed from tonymacx86.com’s CD, you may still need to install MyHack.  If you’ve installed from Prasys’ Empire EFI CD, you will need to install MyHack.  So, continue on.

Ok, so now that Mac OS X is installed, the system still won’t boot up without the EFI disk. So, reboot after the install with the Empire EFI ISO in the drive. Choose the new bootable ‘Hard Disk’ in the EFI menu and boot into Mac OS X. Once Mac OS X is loaded, open Preferences and set the ‘Startup Disk’ to your new bootable installation. Now, open Safari and search Google for ‘MyHack’ or locate this Randosity article in Safari and go to this site: MyHack. The download will be a package (.mpkg) file and needs to be downloaded on Mac OS X. Once downloaded, double-click the package to install. Click through the Wizard until you get the screen with the ‘Customize’ button. Click Customize and enable PS2Controller (keyboard and mouse) and disable SleepEnabler (doesn’t work with later OS X versions). Click to finish the installation process.

After MyHack is installed, you can eject the Empire EFI media and your Mac OS X installation will now boot on its own.

Final Steps + Increasing screen resolution

You’ll notice that the resolution is fixed to 1024×768. You can change this resolution, but it has to be done in two files. First on Mac OS X, there’s the /Extra/com.apple.Boot.plist file. This file describes the resolution for the Mac to use. Before you edit this file, install Xcode from the Mac OS X media (insert it into the drive with the Mac running). Open ‘Optional Installs’ folder and double-click ‘Xcode’ and follow the installation instructions. Note, it takes about 2.3GB of space. Plist files are easier to edit when the Property List Editor is installed from Xcode. Otherwise, you will have to hand edit these files with TextEdit.

Also note that the /Extra folder is at the root of the Hard Drive volume.  It is not inside your local user profile folder.  You will also note that after a default install, Mac OS X doesn’t show hard disk icons on the desktop.  To turn this icon on, from the top menu, select ‘Finder->Preferences…’.  Then, put a check next to ‘Hard Disks’ under ‘Show these items on the desktop’.  Once you open the Hard Disk icon, you should see the Extra folder.  If you still don’t see the Extra folder, be sure that you have installed MyHack or used the Nawcom ModCD.  If MyHack hasn’t been installed, there won’t be an /Extra folder there.  The Extra folder gets installed as a result of installing MyHack.

Also, there can only be one available resolution in Virtualbox and on the Mac at a given time. I wish it supported more resolutions at once, but it doesn’t. Note also that because VirtualBox doesn’t support Mac OS X fully, there are no machine additions. To enable the resolution, on the PC side of VirtualBox (on the VirtualBox host), you will need to run the following command from a command shell (cmd):

VBoxManage setextradata "Mac OS X" "CustomVideoMode1" "1920x1080x32"

The “Mac OS X’ label is the exact machine name in VirtualBox. The “1920x1080x32” setting is customizable to your needs (and video card capabilities). However, both this setting and com.apple.boot.plist (on the Mac) must match for the screen resolution to take effect.

The ‘VBoxManage’ command is located in the Program Files\Oracle\VirtualBox folder or wherever you installed VirtualBox. You can add this location to your PATH variable so you can use this command without typing in the full path each time.

In the com.apple.Boot.plist file, you will need to add the following properties (if not already there):

Graphics Mode - String - 1920x1080x32
GraphicsEnabler - String - y

(The resolution value should match the above VboxManage command). If you want to change resolutions later, you will need to edit both places again and reboot your Mac.

If you reboot and the screen hasn’t changed or has changed to 1280×1024 and not the resolution you expected, double check that both com.apple.boot.plist and the CustomVideoMode1 setting match and are active. Both of these settings must match for the resolution to work.

Updating com.apple.Boot.plist

It’s easiest to edit this file with the Property List Editor tool. So, install Xcode before managing this file. In order to edit this file, you cannot edit it directly. Instead, copy the file and paste it to your desktop. Edit the file on your desktop. Then, once done editing, drop the file on top of the /Extra folder. Click “Replace File” when asked and supply your account password. Once the file is replaced, you can reboot to see if the resolution change has taken effect.

Audio Support

Update: On my HP quad core system, I am unable to get the AC97 sound driver to work on 10.6.4 (as have others). I have uninstalled and reinstalled this kernel extension, but it simply will not activate. I am still working with this setup to see if I can get it working, but so far no luck. I should point out, then, that the AC97 sound driver may not work on all systems and may not work with 10.6.4. So, you may not want to update to 10.6.4 until this issue is resolved if you need sound.

Mac OS X does support audio output with an AC97 audio driver in Snow Leopard up to 10.6.3. It does not appear to support audio input. I will say, however, that the audio driver is, at best, under performing. That means, it breaks up, it doesn’t always work and it generally sounds crappy. That said, if you want to hear the various insundry noises that the Mac can make for bells, you can install the driver. The AC97 driver can be found in this Virtualbox Forum Thread.

Note, if the supplied installer does not properly install the driver, download the .zip file and install the AppleAC97Audio.kext Extension the into /Extra/Extensions folder. Then follow the instructions below on rebuilding the Extensions.mkext file.

Kernel Extensions — Rebuilding .mkext cache files (Kernel Extension Cache)

Mac OS has always been known for its extensions. Well, Mac OS X is no different in this respect. In the original Mac, you simply drop the extension into the Extensions folder and it works. Well, unfortunately, it’s not quite that simple with Mac OS X. If you want to drop in a .kext file (extension), you will need to rebuild the Extensions.mkext database. This database is what helps Mac OS X find and work with installed extensions. To rebuild these cache files, you will need to use the following Terminal.app as root:

# kextcache -v 1 -t -m /Extra/Extensions.mkext /Extra/Extensions/ /System/Library/Extensions/
# kextcache -v 1 -t -m /System/Library/Caches/com.apple.kext.caches/Startup/Extensions.mkext /System/Library/Extensions/

Running these commands will rebuild the cache files necessary to activate newly installed extensions. So, if you need to install any new extensions, you will need to run the above commands to recreate the extension cache files.

Creating an ISO image with ImgBurn

To create an ISO image using ImgBurn, you will first need to download and install it. Once it’s installed, start it up. Now click ‘Create image file from disc’. Insert the Mac OS X CD. The CD will be labeled ‘Boot Camp’. This is fine as this is the only partition that Windows is able to see. As long as it sees the ‘Boot Camp’ partition, the image will be created correctly. Click the CD icon at the bottom of the Window to create your ISO image. Once the image has been created, you can continue at your previous step.

Rebooting the Mac

As a side note about rebooting. With some hardware, rebooting Mac OS X in VirtualBox doesn’t work. Sometimes it seems to hang, sometimes it gives a banner telling you to power off the machine. Basically, there isn’t really a resolution to this issue. Simply use shutdown, then when it appears all disk activity has stopped, close the Vbox window (making sure to power it off). Then click ‘Start’ again to start it up. This is really more of an inconvenience than anything, but it’s manageable.

Updating Mac OS X

As new updates get released by Apple, you may be tempted to install them immediately.  While this shouldn’t be a problem on a real Mac, it is possible that a security or full update from Apple could break VirtualBox installations accidentally (or, more likely, intentionally).  Since Virtualbox offers snapshot capabilities, I recommend taking advantage of this and do the following:

  • Cancel any updates
  • Shutdown Mac OS X
  • Take a snapshot of your Mac OS X Guest in the Virtualbox console
  • Start up Mac OS X
  • Update OS X

If the update causes your system to stop booting, stop working or in any way become broken, you can revert to the snapshot and not update.  On the other hand, if the update works perfectly, then I recommend you delete the snapshot once you feel comfortable that the update is working as expected.  If the update doesn’t work, you may need some updated components such as the Chameleon boot loader or an updated boot disk to handle the new OS update.

Notes

* I suggest using a VMDK HD image as there are more tools for VMDK format files than VDI files. Though, your choice. If you want to use a VMDK file, go to vmcreator.com and have them make you a file to download.

** VirtualBox’s EFI works, but not with Mac OS X. Whether that’s intentional is unknown. Instead, you need to use the Empire EFI ISO disk to boot Mac OS X to install it.

*** You may have to enable VT-x/AMD-v in your machine’s BIOS.

**** Click the ‘Add’ button in the Media Library window to locate your ISO image, then make sure this file is selected and click ‘Select’.