Monday, September 24, 2007

Run Mac OS X from USB Stick

First, prepare all that need:
  • USB Flash Disk (min. 2 GB required). You can use many types for this USB disk, such as USB Stick, USB Pendrive, ZIP Disk, your iPod, SD or MMC card, extrenal hard drive, etc.
  • JaS Mac OS X 10.4.x Retail DVD
  • Pacifist software. Download here.
OK. Ready? Now plug your USB Disk, and it will be mounted automatically.

Open Disk Utility (Applications->Utilities)
Select your USB Disk device in the left menu, and click the partition tab.
Enter a nice name for your device like osx86.
Hit Options... button, and choose Master Boot Record.
From the drop-down, choose 1 partition as the volume scheme.
Be sure the filesystem is Mac OS Extended (Journaled),
Hit the Partition button.
Next, we need to enable Owners, open a Terminal and type:
sudo /usr/sbin/vsdbutil -a /Volumes/osx86
Mount the JaS 10.4.x DVD or the Retail 10.4.x DVD.
Browse to the directory System/Installation/Packages on the DVD.
Open OSInstall.mpkg with pacifist (right-click->Open With Pacifist).
Expand Contents of EssentialSystemSoftware, then expand Contents of
EssentialSystemSoftwareGroup
.

Select Contents of BaseSystem.pkg and Contents of Essentials.pkg and
right-click and choose Install to Other disk...

Choose your USB Disk (osx86) and hit the install button. Now be patient :-)
Now depending on what DVD you used, you will need to download the
right update from apple.com. I downloaded the 10.4.8 Intel update since I used
10.4.7 retail DVD.

Open MacOSXUpd10.4.8Intel.pkg with Pacifist and install to Other disk...

N.B.: Before installing the update, you may need to free some space on the USB Disk.
Just delete the asiatic font files in /System/Library/Fonts (= 100 MB bonus).

Since we installed with Pacifist, some of the files are missing. We need to copy them.
Get them from a full 10.4.8 working install. Those files are:

/System/Library/CoreServices/SetupAssistant
/Applications/Safari.app
/Applications/Address Book.app
/Library/Receipts/BaseSystem.pkg
/Library/Receipts/Essentials.pkg

You need to replace the following files:

/mach_kernel by semthex SSE3 or SSE2 kernel
/System/Library/Extensions/AppleACPIPlateform.kext
/System/Library/Extensions/AppleSMBIOS.kext


Optional:

/System/Library/Extensions/IONetworkingFamily.kext
/System/Library/Extensions/AppleIntelIntegratedFrameBuffer.kext
(GMA950)

Add this for PS2 keyboard/mouse:

/System/Library/Extensions/ApplePS2Controller.kext

Put all your custom kext you use on your working install.

Do not forget to chmod -R 755 and chown -R root:wheel all files you copy.

Be sure that you have bless version 24.0 from 10.4.4.
Any other version of bless won't work.
Run bless -version in Terminal to check version.
sudo bless –verbose –folder
“/Volumes/osx86/System/Library/CoreServices” –bootinfo
Now, Repair permissions
Open Disk Utility.app, select your USB Disk and repair permissions.

Then set partition to active
Open a Terminal, be sure your USB Disk is plugged in
> sudo -s
> diskutil list

> /dev/disk1
#: type name size identifier
0: FDisk_partition_scheme *1.9 GB disk1
1: Apple_HFS osx86 1.9 GB disk1s1
Note that here the USB Disk is disk1 (disk1s1).

> fdisk -e /dev/rdisk1

Enter 'help' for information

fdisk: 1> p

Disk: /dev/rdisk1 geometry: 999/64/63 [4028416 sectors]
Offset: 0 Signature: 0xAA55
Starting Ending
#: id cyl hd sec - cyl hd sec [ start - size]
-------------------------------------------------------------
*1: AF 0 1 1 - 1023 254 63 [ 63 - 4028346] HFS+
2: 00 0 0 0 - 0 0 0 [ 0 - 0] unused
3: 00 0 0 0 - 0 0 0 [ 0 - 0] unused
4: 00 0 0 0 - 0 0 0 [ 0 - 0] unused
First time you do this, you should not see the star in front of partition 1.
We need to activate the partition.
fdisk: 1> f 1
Partition 1 marked active.
fdisk:*1> write
Device could not be accessed exclusively.
A reboot will be needed for changes to take effect. OK? [n] y
Writing MBR at offset 0.
During the first boot to OS X from the USB Disk,
you'll have to finish the installation setup.
For the first boot, you need to boot to your current working system.
And specify following boot flags:
mach_kernel -v rd=disk1s1
Notice that we specified disk1s1 from previous diskutil list command.

Next boot should be directly to the USB Disk,
so don't forget to enable USB boot in BIOS.
And set USB Flash boot order before harddrive.

Bring your osx86 with you and test it on any PC with SSE2/SSE3 processor like
Intel Pentium 4, Intel Pentium D, AMD Athlon XP, etc.
Enjoy it!

Source: MacGeek

7 comments:

Anonymous said...

Anyone tried this with Leopard?

Anonymous said...

Why are PC folks always trying to get what Mac has... why not just admit it, and stop crying in your soup and get a Mac... how many Macheads try to emulate PC???

AsbestosBill said...

Lots, ever hear of bootcamp?

Anonymous said...

I like testing out OSes before I actually install them. I do this with Linux, and try my best to do this with Windows.

However, how do you do this with Mac without going out and buying an Apple PC? I'm not going to drop $1000 on something that I don't even know I'd like. This is why testing out the OS on my current PC is a good thing.

daniel said...

Very interesting article, I am now subscribed to your blog.

Keep the articles coming, you are my idol.

regards

Anonymous said...

Shalom! Clarence Jaeger . payday loans

Ayelis said...

"Anonymous" accounts. For OS Haters and Spammers alike! (Are they any different?!)