Bluetooth Mouse Pairing: Fix ‘Authentication Error’ in Windows 7
Every once in a while my bluetooth dongle decides to go whacky on me and the mouse won’t work any longer. Sometimes the keyboard also. Usually, I can unplug the dongle and replug it. This generally recovers both the mouse and the keyboard. Sometimes it requires repairing one or both of the devices. Today was a repairing day (at least for the mouse). Except, today didn’t go at all smoothly.
Note: Before proceeding with any pairing operation to battery powered devices such as mice or keyboards, always make sure your batteries are fresh. Dead or dying batteries can cause pairing problems simply because the wireless transmitter in the device may not produce a stable enough signal for the receiver. Also note that dead or dying batteries can sometimes be the source of device connectivity problems. Therefore, always make sure your batteries are fresh before attempting pairing operations with these devices.
The Problem
Normally I just go into ‘Devices and Printers’ and delete the device and pair it again. This usually works seamlessly. Today, not so much. I successfully delete the Targus mouse from the ‘Devices and Printers’ and that works correctly. I then put the mouse into discovery mode and start the ‘Add a Bluetooth Device’ panel. The panel finds the mouse fine. I select the mouse and click ‘Next’. I then see the next image.
So, this is a reasonably stupid error because it’s a mouse. Mice don’t have authentication errors because they don’t use pairing codes. I have no idea why Windows would even present this. It’s clear that something is completely borked in Windows. And, you know, this is one of the things about Windows I absolutely hate. It gives stupid errors like this without any hope for resolution. Note that clicking the little blue link at the bottom of the window is completely worthless. Clicking that link won’t help you resolve this issue. It leads you to some worthless help page that leaves more questions than answers and only serves to waste time. I digress.
So, now that I’ve received this error, I proceed to Google to find an answer. Well, I didn’t find one. After traversing through several forums where people are asking the same questions, no answers here. Then, I proceed to search the registry thinking it left some garbage in the registry from the previous pairing. Nope, that search was a waste. So now, I’m basically at the trial and error phase of resolution.
I finally get to Microsoft’s knowledgebase which is probably where I should have visited first. Unfortunately, even that didn’t help, but I did find that Windows Server doesn’t support Bluetooth devices (not that that’s very helpful for my issue because I’m on Windows 7). What visiting this page at Microsoft did is give me an idea of how to proceed based on some images I saw. Not images of what I’m about to show you, though. Just an image of something that triggered a thought about how silly Microsoft is which lead to another thought and so on leading to the below.
The Fix
So, I go back to trying to pair again. I set the mouse up into pairing mode and then start ‘Add a Bluetooth Device’. Instead, this time I decide to right click the device about to be added:
You’ll need to do this pretty quickly as the device won’t stay in pairing mode for very long. So, click ‘Properties’ and you’ll see the following window:
Now, check the box next to the ‘Drivers for keyboard, mice, etc (HID)’ and click ‘OK’. This should immediately pair the device without the ‘Authentication Error’ panel appearing. At least, this fix worked perfectly for my situation. I can’t guarantee this will work with every Bluetooth mouse or every Bluetooth hardware. So, your results may vary. It’s definitely worth giving it a try, though.
Note: The differences in Bluetooth drivers may prevent this fix from working across the board. So, you will have to try this and relay your experience of whether or not it works for you.
Note, after I unpaired the mouse and repaired it after having done the above, I now see the following panel instead of the authentication error panel. This is the correct panel for the mouse. Clicking ‘Pair without using a code’ works perfectly now for this device. I have no idea what caused the other panel to present above. Note that once Windows gets into that state above, it stays there. Not sure why Windows would cache an error, but apparently it does. I’m at a complete loss why Microsoft would cache anything to do with real-time device connection activities like this! However, the mouse now unpairs and pairs correctly again. Whatever causes this issue, the Windows development team needs to fix it.
These are the stupid little things that make Windows such a hacky time-wasting experience. It’s these stupid quirky behaviors that give Microsoft a bad wrap and that continue to make Microsoft perceived as an inept operating system development company. It’s problems like this that make Windows a 1990’s level computer experience.
And, I’m not just talking about the error itself. I’m talking about the overall experience surrounding the error to the lack of any help in finding an answer. It’s having to resort to searching Google to find answers when Microsoft’s knowledgebase has nothing and offers no answers. It’s the having to guess using trial and error to find an answer. It’s the bad experience and bad taste that this experience leaves. Microsoft get your sh*t together. It’s long time for Windows to be done with experiences like this and time wasting experiences. If there are resolutions to a problem, then the time has long past to lead your users who see errors like this one to an exact resolution page with step-by-step instructions that work. Clearly, there is a resolution to my issue and I present it here. Why can’t your team do the same?
Seriously, I don’t understand why Microsoft relies on sites like mine to help users fix problems that Microsoft cannot be bothered to document properly. Yes, I realize I’m contributing to the problem by writing this article and ‘helping’ Microsoft out. Note, however, it’s not so much about helping Microsoft as it is helping users who run into this same stupid experience. The purpose of this article is to show just how stupid this experience is. It’s clear that Microsoft has no want in helping its own users who PAID for this product to actually give them real support and documentation. So, why do we continue to use Windows?
How to format NTFS on MacOS X
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:
- VirtualBox installed (free)
- 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:
- For writing to NTFS partitions on MacOS X:
- Tuxera NTFS (not free) or
- ntfs-3g (free)
- 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. ;)
76 comments