Google Nexus S USB Tethering on Windows XP

Having USB tethering working on Windows XP using your Nexus device is somewhat different. You will be complained by Windows that the driver is missing and you might get no idea where the hell the driver is.

Google actually has a hidden article which provided the link to the driver.

http://support.google.com/android/bin/answer.py?answer=182134


Edit 2014-11-05: It seems that Google has unintentionally removed the link to the configuration file. Anyway you can find the old page from the Internet Archive here:

http://web.archive.org/web/20131130072158/https://support.google.com/android/answer/182134?hl=en

I have also captured the screenshot of the webpage and the configuration file below (just copy and paste the content and save as file with file name tetherxp.inf) in case the above link no longer works.

; MS-Windows driver config matching some basic modes of the
; Linux-USB Ethernet/RNDIS gadget firmware:
;
;  - RNDIS plus CDC Ethernet ... this may be familiar as a DOCSIS
;    cable modem profile, and supports most non-Microsoft USB hosts
;
;  - RNDIS plus CDC Subset ... used by hardware that incapable of
;    full CDC Ethernet support.
;
; Microsoft only directly supports RNDIS drivers, and bundled them into XP.
; The Microsoft "Remote NDIS USB Driver Kit" is currently found at:
;   http://www.microsoft.com/whdc/hwdev/resources/HWservices/rndis.mspx


[Version]
Signature           = "$CHICAGO$"
Class               = Net
ClassGUID           = {4d36e972-e325-11ce-bfc1-08002be10318}
Provider            = %Android%
Compatible          = 1
MillenniumPreferred = .ME
DriverVer           = 03/30/2004,0.0.0.0
; catalog file would be used by WHQL
;CatalogFile         = Android.cat

[Manufacturer]
%Android%          = AndroidDevices,NT.5.1

[AndroidDevices]
; Google Nexus One without adb
%AndroidDevice%    = RNDIS, USB\VID_18D1&PID_4E13
; Google Nexus One with adb
%AndroidDevice%    = RNDIS, USB\VID_18D1&PID_4E14
; Google Nexus S without adb
%AndroidDevice%    = RNDIS, USB\VID_18D1&PID_4E23
; Google Nexus S with adb
%AndroidDevice%    = RNDIS, USB\VID_18D1&PID_4E24
; HTC Sapphire without adb
%AndroidDevice%    = RNDIS, USB\VID_0BB4&PID_0FFE
; HTC Sapphire with adb
%AndroidDevice%    = RNDIS, USB\VID_0BB4&PID_0FFC
; Motorola Sholes without adb
%AndroidDevice%    = RNDIS, USB\VID_22B8&PID_41E4
; Motorola Sholes with adb
%AndroidDevice%    = RNDIS, USB\VID_22B8&PID_41E5

[AndroidDevices.NT.5.1]
; Google Nexus One without adb
%AndroidDevice%    = RNDIS.NT.5.1, USB\VID_18D1&PID_4E13
; Google Nexus One with adb
%AndroidDevice%    = RNDIS.NT.5.1, USB\VID_18D1&PID_4E14
; Google Nexus S without adb
%AndroidDevice%    = RNDIS.NT.5.1, USB\VID_18D1&PID_4E23
; Google Nexus S with adb
%AndroidDevice%    = RNDIS.NT.5.1, USB\VID_18D1&PID_4E24
; HTC Sapphire without adb
%AndroidDevice%    = RNDIS.NT.5.1, USB\VID_0BB4&PID_0FFE
; HTC Sapphire with adb
%AndroidDevice%    = RNDIS.NT.5.1, USB\VID_0BB4&PID_0FFC
; Motorola Sholes without adb
%AndroidDevice%    = RNDIS.NT.5.1, USB\VID_22B8&PID_41E4
; Motorola Sholes with adb
%AndroidDevice%    = RNDIS.NT.5.1, USB\VID_22B8&PID_41E5

[ControlFlags]
ExcludeFromSelect=*

; Windows XP specific sections -----------------------------------

[RNDIS.NT.5.1]
Characteristics = 0x84   ; NCF_PHYSICAL + NCF_HAS_UI
BusType         = 15
DriverVer           = 03/30/2004,0.0.0.0
AddReg          = RNDIS_AddReg_NT, RNDIS_AddReg_Common
; no copyfiles - the files are already in place

[RNDIS.NT.5.1.Services]
AddService      = USB_RNDIS, 2, RNDIS_ServiceInst_51, RNDIS_EventLog

[RNDIS_ServiceInst_51]
DisplayName     = %ServiceDisplayName%
ServiceType     = 1 
StartType       = 3 
ErrorControl    = 1 
ServiceBinary   = %12%\usb8023.sys    
LoadOrderGroup  = NDIS
AddReg          = RNDIS_WMI_AddReg_51

[RNDIS_WMI_AddReg_51]
HKR, , MofImagePath, 0x00020000, "System32\drivers\rndismp.sys"

; Windows 2000 and Windows XP common sections --------------------

[RNDIS_AddReg_NT]
HKR, Ndi,               Service,        0, "USB_RNDIS"
HKR, Ndi\Interfaces,    UpperRange,     0, "ndis5" 
HKR, Ndi\Interfaces,    LowerRange,     0, "ethernet"

[RNDIS_EventLog]
AddReg = RNDIS_EventLog_AddReg

[RNDIS_EventLog_AddReg]
HKR, , EventMessageFile, 0x00020000, "%%SystemRoot%%\System32\netevent.dll"
HKR, , TypesSupported,   0x00010001, 7

; Common Sections -------------------------------------------------

[RNDIS_AddReg_Common]
HKR, NDI\params\NetworkAddress, ParamDesc,  0, %NetworkAddress%
HKR, NDI\params\NetworkAddress, type,       0, "edit"
HKR, NDI\params\NetworkAddress, LimitText,  0, "12"
HKR, NDI\params\NetworkAddress, UpperCase,  0, "1"
HKR, NDI\params\NetworkAddress, default,    0, " "
HKR, NDI\params\NetworkAddress, optional,   0, "1"

[SourceDisksNames]
1=%SourceDisk%,,1

[SourceDisksFiles]
usb8023m.sys=1
rndismpm.sys=1
usb8023w.sys=1
rndismpw.sys=1
usb8023k.sys=1
rndismpk.sys=1

[DestinationDirs]
RNDIS_CopyFiles_98    = 10, system32/drivers
RNDIS_CopyFiles_ME    = 10, system32/drivers
RNDIS_CopyFiles_NT    = 12

[Strings]
ServiceDisplayName    = "USB Remote NDIS Network Device Driver"
NetworkAddress        = "Network Address"
Android               = "Android"
AndroidDevice         = "Android USB Ethernet/RNDIS"
SourceDisk            = "Ethernet/RNDIS Driver Install Disk"

Random PC Freeze due to HDD

Just to drop down some very strange computer problem encountered before. This is back to 2010-10-09, happened on my friend’s desktop.

When happen?

Someday.

Symptom

Randam PC freeze. Mouse still able to move. HDD LED on during freeze. Freeze happens more frequently during playing computer game Alien Swarm.

Cause

Unstable loading speed of HDD. Sometimes HDD loading speed drop to around 1MB/s.

Unstable Loading Speed of HDD with Drop to 1MB/s

Solution

Replace the hard disk.

Data Recovery with Ubuntu + Virtual Box on Occasion Disconnect Hard Disk

Too busy recently so just to make this as simple as possible.

Situation:

One of my schoolmates brought me a failed hard disk, in which UBCD4Win also failed to boot the PC with the hard disk installed (Stopped after the Windows Logo with only the movable cursor on the screen). He needed data recovery on the important Excel files stored on the hard disk.

Trial:

  1. Connected the hard disk to a desktop running Windows 7 using hot plug, after installed the drivers the hard disk disappeared from the Disk Management. Tried reinsert the hard disk but it appears on the Disk Management for a few seconds and disappeared. The hard disk was not shown on the Device Manager and my DVD drive connected to the same SATA controller also disappeared from Device Manager after reinsert.
  2. Boot UBCD4Win, stopped after the Windows Logo with only the movable cursor on the screen.
  3. Tried NTFS4DOS bundled with UBCD4Win, able to list the directory but need several second until free space is displayed for the DIR command. However failed to copy the data needed because of the unsupported Chinese characters and the missing of XCOPY command (I am not sure if COPY command works on directory. I tried to COPY a file but it just shows 0 file copied. Later I found out that the directories and files has the user privacy set).
  4. Tried Ubuntu. Able to boot up the PC successfully and able to see the hard disk SMART status. However the NTFS file system is damaged and failed to access the files. I am no experience in operating Ubuntu and the data recovery software on Linux so gave up.
  5. Tried CloneZilla to attempt cloning the hard disk to another hard disk. Failed because I cannot find raw clone. NTFS file system is damaged and showing the following screen when attempting cloning.
    Tried fsck as suggested but not working on NTFS seems. Used ntfsfixas suggested in some websites but failed as well with the following messages.

    Error on CloneZilla when Attempting Cloning

    Error Message when using ntfsfix

Finding:

Common bad sector problem on the failed hard disk. What make it even worse is that when loading some particular sectors on the hard disk, it will make itself offline.

Final Solution:

Ubuntu with ddrescue for getting a hard disk image as suggested by the post on Ubuntu Community Documentation, and VirtualBox for reading the hard disk image as inspire by the post in HowtoForge.

Step 1: Create disk image with ddrescue

  1. Find the partition using Disk Utility, for example /dev/sdc1
  2. Run the command sudo ddrescue -v -r1 /dev/sdc1 st.img st.log (the command in the screenshot is a bit not correct. -nswitch should not be used in this case)

    ddrescue Command and Offline Hard Disk

  3. When discover the hard disk is offline (by watching the time from last successful read displayed by ddrescue), reinsert the hard disk (on hot plug supported mainboard, not sure what will happen if not supported.), and rerun the above command. I actually put that running for the whole night but with the -R flag on since the end of the partition has less bad sectors so the chance for the hard disk to disconnect itself is lower.
  4. Run the above command a couple of times until most of the data are recovered.
  5. The un-recovered data are actually scattered around the hard disk. By using the log file from ddrescue with the help of Excel (Need to enable HEX2DEC in Analysis ToolPak add-in of Analysis ToolPak add-in), make a script to recover the scattered data and try to avoid the sectors which may cause the hard disk to disconnect itself manually by adjusting the parameter in the ddrescue command, for example ddrescue -v -n -T -r1 -i7526M -s17M /dev/hdb1 st.img st.log

    Running ddrescue with Script for Scattered Data Recovery

Step 2: Converting disk image to VDI disk image format

Sadly VirtualBox does not support IMG disk image. To make the image available for further processing, it is necessary to convert to VDI format supported by VirtualBox. Command used: VBoxManage convertfromraw -format VDI st.img st.vdi

Step 3: Data Recovery

So finally you mount the VDI disk image to the VirtualBox and run the Windows XP inside the VirtualBox. It will prompt for disk checking during boot but please just skip it. It took me over 2 hours and still not finish the checking whereas in Windows XP, it just need 30 minutes! Just run the command chkdsk D: /F in your Windows XP command prompt! Finally after 4 nights and 1 morning of work, I found the Excel files in the hidden folder (Forgotten the exact name XD) in the checked hard disk inside VirtualBox for my schoolmate.

The disk check during Windows XP boot up is slow, really slow.

Final Words

Well at the end this article took me more than an hour to finish. Whatever. All in all this is a good experience having myself trying out on rarely used Linux platform. Hope this article also served as a guide to someone who are desperately looking for help in recovery their valuable data. But as always, BACKUP YOUR DATA REGULARLY!