Rescue Black Screen Fusion VM

My windows 2003 vm in vmware fusion turns into a black screen after an OSX crash. The guest system seems bootable but starts with total blackness. Fortunately safe mode works. Event log shows it’s unable to load vmx_fb.dll, which is the graphics driver of vmware tools.

The paradox is that vmware tool is unable to install in safe mode, which will always fail even though MSI service can be enabled with this method. Then manually deleting vmx_fb.dll and vmx_mode.dll in system32 folder also not works.

It seems the only way is to roll back vm to 2-month-ago snapshot losing all the intermediate stuffs. But this thread is the rescue. Additional vmx_svga.sys in drivers directory should also be deleted. Then the guest 2003 system can be started with the default vga driver.

Now enter the vm, reinstall vmware tools, and make a new snapshot for such emergency case.

Fix 10.11.4 mysterious trackpad reset problem after reboot

Just encountered a mysterious problem after upgraded to 10.11.4 that every time MBP reboots and logins, my trackpad settings like tap-to-click are lost. It’s mysterious because during the very beginning time after login it worked as normal, but a few minutes later trackpad settings were reset automatically. It also affected the Mac AirPlay to AppleTV which would not work except for the first few minutes after reboot.

Googling the airplay problem leads to login items. But removing all of my existing login items doesn’t fix the problem. (Of course, the trackpad plist is the first try which also doesn’t work.)

And the console log during possible resetting trackpad has messages like “kernel[0]: Sandbox: CommCenter(3359) deny(1) file-read-metadata /Library/Developer” and “otherbsd[4246]: Could not submit LoginItem job com.XXX.XXXYYY: 119: Service is disabled”;

More googling doesn’t find much useful info. Similar keyboard reset problem exists but has no fix yet. When analyzing the details of the console logs, one interesting thing is that there’re two login window app started msg around that time, when the failed login items are all at the second login window session and possibly kill my trackpad settings and airplay.

Then why on earth exists another login window session? The culprit is _xcsbuildd. As 10.11.4 upgraded Mac Server, with XCode server service included, which will run as user _xcsbuildd at background. The upgraded service’s second login session breaks some login items which seems indeed killing airplay and resetting the trackpad settings.

Simply disable xcode service in Server.app will not remove _xcsbuildd related stuffs. Use this methods to totally get rid of it.

Finally reboot and enjoy the hassle-free trackpad and airplay again.

Fix iTunes Restore iPad2 Error 9 Problem

One of my relative’s iPad2 got stuck in the iTunes logo interface and stayed unusable for a while. Just tried to get it restored by iTunes via USB. However, it failed, always auto rebooted after progress bar showed under the Apple logo.

Tried with DFU mode and restore process still failed with “Unknown Error 9”. This thread googled suggests about the unbelievable culprit: the latest iOS 9.2.1 is incompatible to restore iPad2.

Since older iOS version cannot be signed and updated by Apple now, latest iOS 9.3 beta 4 works fine to restore iPad2 successfully.

Unbelievable.

Fix 10.11 key chain prompt with deny only

Just encounter a strange problem of key chain access. When prompting for access to credentials, the dialog can only be dismissed by Deny. In the console, “Ignoring user action since the dialog has received events from an untrusted source” was logged.

According to this post, 10.11.1 contains a security patch to prevent synthetic clicks on keychain dialogs. Try disabling all apps in the privacy settings of accessibility-mac-control, but not works.

Therefore manually quitting such apps one by one will be the trick to check for the culprit. It founds that BetterTouchTool is the problem.

Update: 10.11.5 will correctly prompt for administrator password and shows the blocking app.

Fix broken miredo in El Capitan

OSX 10.11 introduced System Integrity Protection feature protecting the /usr/sbin folder, which will break existing miredo functionality to connect teredo tunnels.

Steps to fix it:

  1. Copy/move upgrade-migrated miredo command line tools from /Library/SystemMigration/History/Migration-XXX/QuarantineRoot/usr/sbin/ to /usr/local/sbin
  2. Edit /Library/LaunchDaemons/miredo.plist to use new /usr/local/sbin/miredo instead of /usr/sbin/miredo
  3. Re-enable miredo in prefpane

Since El Capitan also force kernel driver signing, if your tun/tap driver has problem to load, install the latest ones from here.

MX Master bluetooth pair problem with Yosemite

Just bought the latest Logitech MX Master mouse, which is quite powerful for Yosemite to natively support Mission Control and Spaces with its mouse gesture button, together with the interesting Smart Shift scrolling feature.

But also encountered the problem of pairing it with my MBP Retina on Yosemite 10.10.3. One discussion thread in the logitech forum suggested to delete all existing bluetooth devices to fix the connection. However, some hidden devices remain in the bluetooth paired list for Alt-Click menu. In this case, a complete bluetooth plist delete will finally help to pair the mouse with MBP.


Update:

Yosemite Bluetooth sometime freezes after wakeup, which then cannot be turned on/off and receive connections until reboot. If you want to manually restart it, do it by command line:

sudo kextunload -b com.apple.iokit.BroadcomBluetoothHostControllerUSBTransport

sudo kextload -b com.apple.iokit.BroadcomBluetoothHostControllerUSBTransport

Or you can use my Bluetooth Restart Alfred Workflow or similar AppleScript.


El Capitan UPDATE:   Above bluetooth kext restart method will make the bluetooth driver unusable in 10.11, so restart your mac seems the only way to fix bluetooth freeze.

Fix safari or chrome scroll lagging in Yosemite

Just found some lagging when scrolling content in Chrome/Safari, especially after a few scrolls, the web page will pause about 0.5s then leap to the target position, which is quite annoying. After a few google around and testing, the Better Touch Tool v0.9995 is found to be the culprit. After disable it, all browsing returns smooth.

But as I use customized three finger swipes frequently, the magicprefs is now the alternative choice for gesture customization, which seems no conflict problem. But the system three finger swipe gesture must be disabled first in the trackpad preference pane, then the magic preference will enable the available gestures.

Update:

Just encounter a Yosemite system-wide problem of missing right click menu, but ctrl+click still works, which might be related to WindowServer process. Only reboot can get the right click back. After rebooting more than 10 times,  it seems to happen after drag & drop to secondary monitor by bluetooth mouse. Quite strange, not sure if it’s bluetooth problem or drag&drop problem. Revert to Better Touch Tool temporally. And BTT released 1.0 which seems no lagging problem now.

Fix Mac App Store An Error Has Occurred

Just encountered a frustrating problem when updating Numbers in the Mac App Store. There’s “an error has occurred” message in the Updates list as well as Purchased app list for Numbers after a seemingly success but actual fail update. Then, opening Numbers app will fail, showing an alert that the app is still updating. Go back to the MAS, the button for Numbers is now installed, so you cannot update/install the app ever again because App Store deems it alright.

Try deleting the Numbers.app in Application folder won’t help either. The “an error has occurred” is still there and the app status is always “installed” even the app is absent from my Mac. Logging out, and logging in to MAS several times, an error always occurred.

Now googling hundreds of pages. Try the interesting MAS debug mode solutions here, but the problem remains. Try the reset errors solution, still no hope. Even try the reset everything for app store cache solution and safari cache solution, both fails. And nothing going wrong for MAS in the Console even strongly suggested that it might be a MAS server problem, which would requires a bug report eventually. I supposed.

Finally, a non-sense post in somewhere in the piles of discussion threads on the web I’ve browsed gave a helpless cue and last resort action: changing the system language/location to English. The mysterious MAS problem is solved. The latest Numbers update showed and installed.

Now I advocate that a fallback App installer/updater mechanism should be there just in case that MAS goes wrong.

Published
Categorized as Tips

fix himedia player to add nas files into media library

My HiMedia 910a player doesn’t support adding nas files (samba/nfs) into its media library. Browsing thru folders is quite tedious for media enjoy time. And 900 series players seem auto overwrite some system files when booting. Therefore customize your own firmware is the choice. Following is the solution after two days of search and configuration:

  1. Make sure you have squashfs-tools installed, if you are on Mac, then build yourself with this code from vasi.
  2. Download your device’s latest firmware, which is named as install.img but actually a tar file. Use tar to extract img’s contents files, in the “packageN” (N=5 or other number) folder, find squashfs1.img
  3. use unsquashfs to extract squashfs files, in the output folder rtk_rootfs/etc/init.d, modify file rcS to uncomment this line:

    /usr/local/etc/rcS>/dev/console&

  4. in rtk_rootfs/user/local/etc.org/, modify file rcS to add a line at the end:

    /usr/local/etc/myinit.sh&

  5. make sure it is executable: chmod +x rcS
  6. use mksquashfs to create back squashfs1.img file, and use tar to create back install.img
  7. upgrade this new created firmware, then myinit.sh will be auto called when booting
  8. Insert a sdcard or usbdisk to player, so that himedia system will allow add to media library button from these “local files”. I use a sdcard, so following location will be /tmp/usbmounts/mmcblkop1
  9. telnet into himedia, go to /tmp/usbmounts/mmcblkop1, mkdir a folder like “nasfiles”
  10. go to /usr/local/etc, vi myinit.sh to mount nfs share after sdcard is ready:

    #!/bin/sh

    sleep 35

    if [ -d /tmp/usbmounts/mmcblk0p1/nasfiles/ ]; then

    mount -t nfs -o ro,nolock 192.168.xx.xx:/folder/ /tmp/usbmounts/mmcblk0p1/nasfiles

    fi

  11. make sure myinit.sh is executable
  12. Now when himedia player is starting, it will auto mount remote nfs files into sdcard folder, then go to storage card’s nasfiles folder, the system will allow you to add nas folders or files to media library!
  13. However, sometime the system media library handling will not work properly. You can also manually fix the media library database when some folder or file is grayed out. Take the sdcard out and insert into your PC.
  14. Go to the sdcard root folder, go into “.Theatter” hidden folder, there’s stx.db file, which is in sqlite format. use sqlite3 to open it. Backup if you don’t want risk library corrupt.
  15. Mostly the ExtHddFolder table is your target, check full_folder_name to be correct; change folder_type to 3 will show the folder in “My Movies”; if you just want folders shown, delete all files item.
  16. Insert back, reboot and wait some time for network up and mount up, browse into My Movies, you have a neat and direct display of Nas folders and movie files!

Setup Test Analytics on GAE with Google Apps Account

Test Analytics is a quite good project from Google for testing analysis practice. It is open sourced at http://code.google.com/p/test-analytics/. However the documentation is quite limited and not straight forward for configuration and setup.

Just spend quite a few hours to make it run on GAE with Google Apps account. Here is the  steps:

  1. Create target GAE application in GAE (https://appengine.google.com) with your Google Apps account, select user authentication to Google Apps and set your apps domain (i.e. xxxx.com)
  2. In your Google Apps Administrator Homepage (https://www.google.com/a/xxxx.com/), add services with GAE application id set to the created one
  3. Download or git clone the test analytics project code
  4. In the pom.xml at project dir, add following lines into the maven-gae-plugin <plugin> element:

    <configuration>
    <serverId>appengine.google.com</serverId>
    <sdkDir>${appengine.sdk.root}</sdkDir>
    <appDir>${basedir}/target/test-analytics-1.0-SNAPSHOT</appDir>
    </configuration>

  5. also change gae.version to latest version in pom.xml

    <gae.version>1.7.1</gae.version>

  6. In ~/.m2/settings.xml add: (make sure <id>value is equal to <serverId> of maven-gae-plugin in pom.xml)

    <settings>
    <servers>
    <server>
    <id>appengine.google.com</id>
    <username>google apps account</username>
    <password>google apps password</password>
    </server>
    </servers>
    </settings>

  7. In the appengine-web.xml under src\main\resources, change:

    value of frontend.url to your GAE application url

    value of frontend.localdomain to your Google Apps Domain xxxx.com

    value of frontend.whitelisting to true

  8. in terminal, go to project folder, run “mvn gae:unpack” to install latest gae java sdk to maven repository
  9. run “mvn gae:deloy”
  10. now maven will download all required plugins, compile project and upload it to GAE
  11. check if it works successfully by login with your Google Apps Account, you can enable accessing accounts in GAE application’s  permission settings