Sunday, October 30, 2016

iMac migration from Windows

I decided to use Migration Assistant from Mac OS X El Captain to transfer files from Windows machine to new iMac 27.

It is a decent tool, and it provides option to migrate email, but I did not try that. I just used it to transfer my files, music, and video, etc. Of course, client tools need to be installed on Windows machine. Copy process took few hours over Wi-Fi.

Then I noticed that OS X actually created  a new user account and copied all files I requested under that user! which is not exactly I wanted. I also observed by then, OS X createsits own Download, Pictures, Music, and movie folder outside Document folder, which is different from Windows by default. This is not quite convenient at all, and  later I realized that it is for iTunes and Photos, and iBooks default file path.

OS X denies to move my previous windows files to my current folder, since they belongs to the migrated user, so I used cp -r to make a copy of the files, and then chown -R. One thing I ignore during this process is to keep to original timestamp. I am not exactly sure they are already lost during Migration Assistant process, and my cp -r process, since I deleted the migration assistant user account later before I realize this.

Migration Assistant doesn't provide option for web browser bookmarks, so I export my IE bookmarks and Firefox book marks, and import them back to Safari/Firefox.

OS X uses unicode for text file encoding (UTF 8/16), which is different from Windows text file by default. In order to open previous windows file via TextEdit, you need change it preference. To change it permanently for other application, command-line iconv or duplicate an open file in TextEdit , and the select unicode encoding for saving file.

iTunes could not play APE/FLAC files, so alternate application is VOX. VOX might not recognize cue file properly, so you need a UTF  encoding version cue file via iconv or TextEdit.

iTunes can play MP3 files from my previous Windows machine, but I quickly noticed that MP3 tags are not displayed in iTunes Library. Again, it was due to encoding, as iTunes also use UTF, so a tag editor is required. eyeD3 is a command-line tool to do so, while Unicode Rewriter is a nicer application to do so too.

Before I changed MP3 file tag, I would like to know existing tag, Kid3 is the ideal application to do this.

I believe that Unicode Rewriter creates a new V2.3 MP3 tag with Unicode, after it reads original MP3 tag. Kid3 can be used to remove all unnecessary V1 tags and APE tags if any on MP3 files.

iTunes then can import unicode tagged MP3 file into iTune Library with proper display.

Audacity can modify sound file in various format

XLD can split APE files.

QuickPlayer might not be able to play certain video codec formats, so MPlayerX is the alternative to do so.


OS X creates default computer name during the first boot process, you can change afterward via command line scutil  or from System Preference->Sharing. OS X has three related names, one of them is used for file sharing over the network.

Samba file sharing for ubuntu client doesn't work well, but afp does.
Samba file sharing for Windows client need profiled credential.
Shared folder on OS X is defined in Sharing section of System Preference.

Unarchiver can extract RAR file format

Didbit 1: screen capture: CMD+SHIFT+3 or CMD+SHIFT+4  partial screen (from Apple support)
Tidbit 2: CMD + <- beginning of line; CMD-> end of line; CMD+ up beginning of page; CMD + down, end of page
Tidbit 3: Option + <-, forward one word;Option+->, backward one word; up and down for paragraph movement.
Tidbit 4: to delete after cursor: Fn + delete
Tidbit 5: to zoom screen: enable it from System Preference -> Accessibility -> Zoom

UEFI PXE ESXi6 TFTP iPXE

Newer generation hardware default boot mode could be UEFI now, so existing PXE server might not work anymore.

VMware ESXi 6 ISO installation will still work for UEFI hardware, but there are changes for PXE boot process. Here is PDF link from VMware Installing VMware ESXi 6.0 Using PXE

Like always, my favorite blog site from William Lam already posted related blog a while ago about this:
http://www.virtuallyghetto.com/2015/10/support-for-uefi-pxe-boot-introduced-in-esxi-6-0.html
(Thank William again!)

VMware site PDF actually added obvious details which is missing from William: As we will use boot file from /efi/boot/bootx64.efi from installation ISO directly, instead of original pxelinux.0, so we need put boot.cfg file in the same location as mboot.efi. (bootx64.efi is renamed as mboot.efi), otherwise mboot.efi will not find boot.cfg during PXE boot process and throw out fatal TFTP error (15) about parsing boot.cfg. 

Update: Later version of ESXi uses b.b00 as kernel in boot.cfg file, insead of tboot.

We might encounter TFTP error (24) during PXE boot process if we start PXE Boot with a web server

Update: mboot.efi doesn't have http capability for tftp to continue, so we need start iPXE first. iPXE can be obtained from ipxe.org, or just download package to from vCenter server Auto Deploy service. File name inside the package for iPXE is: snponly64.efi. 

We don't have such issue for legacy BIOS, however now it is all about UEFI. If you decide to test out UEFI HTTP chainloading in VMWare VM, you need Burning iPXE into ROM for network adapter. (https://ipxe.org/howto/vmware)

The process is so-called chainload: snponly64.efi is obtained from tftp server, then it is look for mboot.efi from tftp server. Configuration in dhcpd.conf includes lines below:

class "pxeclients" {
   match if substring(option vendor-class-identifier, 0, 9) = "PXEClient";
   next-server ip-of-tftp-server;
   if option client-system-arch = 00:07 or option client-system-arch = 00:09 {
      if exists user-class and option user-class = "iPXE" {
         # Instruct iPXE to load mboot.efi as secondary bootloader
         filename = "mboot.efi";
      } else {
         # Load the snponly64.efi configuration of iPXE as initial bootloader
         filename = "snponly64.efi";
      }
   } else {
      filename "gpxelinux.0";
   }
}



Tip 1: before you start UEFI PXE boot process, please check UEFI boot order, and make sure PXE is after hard disk, otherwise PXE boot process will repeat after ESXi server reboot :-) (If your ks.cfg file includes reboot after installation)

Tip 2: We use PXE boot for multiple ESXi servers installation purpose, so the easiest way I found out about assigning IP address as you expected via DHCP is to edit dhcpd.conf file for DHCP reservation:

group {
host host-name1 {hardware ethernet xx:xx:xx:xx:xx:xx; fixed-address ip-address1; option host-name "host-name1";
host host-name2 {hardware ethernet xx:xx:xx:xx:xx:xx; fixed-address ip-address2; option host-name "host-name2
...
}

Of course, you need reboot DHCP for this, but you don't need multiple MAC-address-boot.cfg files. dhcpd.conf syntax is really picky, so you will follow the format exactly