Running Windows 10 from external drive on Mac

Some time ago I was able to create bootable Windows 10 installation on external SSD drive. It worked perfectly and I was able to play all Windows only games. However, it all went south when I upgraded my Macbook Pro to new 2017 model… Well. Old USB drivers stopped working, so after boot I could not use either keyboard nor mouse. Apparently there are many step-by-step instructions on how to install Window 8 and 10 on external drive, but many of them are outdated or do not cover my specific problem. Luckily there’s a discussion thread on Apple’s own support forum on how to troubleshoot and fix similar issues.
In my case I had to download new set of drivers from Bootcamp Assistant and install them. Luckily I found external USB keyboard that worked with Macbook!
Here’s the thread you may find useful.
Another good tutorial on how to fix drivers issue using a VM (if you can boot your bootcamp in VM):
https://support.twocanoes.com/hc/en-us/articles/203759489-Solution-for-non-functional-keyboard-and-mouse-after-Windows-7-Boot-Camp-restore

How to redirect std C++ streams to Visual Studio debug output

Discovered this trick for the first time. You can use AllocConsole() to redirect ANY std stream to debug console.

In most cases people use either TRACE() statement (but you have include MFC or ATL for that) or Win API OutputDebugString().

With AllocConsole() your code may look like this:

   freopen("CONOUT$", "w", stdout);

That’s it!

Learning something new every day. 😀

Windows 10 Power Management (again)

If you follow me on Twitter, you know how long I’ve been trying to fix the problem. I fixed it once, but then it started happening again. Windows 10 wakes up almost daily at random time. This problem is not unique to me.

Here’s what people usually do to fix unwanted wakes:

In command line run

powercfg -lastwake

In theory it should tell you, who woke your computer last time. Unfortunately, it did not work in my case.

My output was

Wake Source Count - 0
Wake Source - Unknown

I guess, Microsoft devs don’t follow specs exactly and “forgot” to register some sources with the Power Management service. Oh well…

In case if you saw something meaningful in output of previous command, then also run

powercfg -waketimers

There you can see services that can wake Windows.

Most likely, you have one of rogue devices which is permitted to wake computer. Then you have to go to Device Manager and find that device. In it properties uncheck this

Image is a courtesy of stackoverflow.com. 🙂

Also it’s important to disable wake timers in Power Management itself. For that, go to Power Options -> Select your current plan -> Edit Plan -> Change Advanced Power Settings

You’ll see this:

In most cases, these two settings will make Windows sleep well.

As you can guess, it was not my case. Just by time when Windows was waking up, I guessed (correctly) that culprit is Windows Update service. It sets wake timers for late nights and early morning hours. In previous versions of Windows, it was possible manually disable wakes caused by update service. It does not seem to be the case for Windows 10, because WindowsUpdate service does not have rights to wake computer up by default. However, it still wakes up! Go figure! It turned out that there’s another service which is related to WindowsUpdate. To be Windows/UpdateOrchestrator. That one has wake timers!

Go to Task Scheduler app and find it there. Then click on “Conditions”. Uncheck “Wake the computer to run this task”.

Here we go. It helped me.

Upd: As it turned out, other people discovered the same thing and also found out that Windows updates once in a while check “wake the computer to run this task” again! Solution? So far, there are two. One is to uncheck this setting manually again. Second one is to write a script that uncheck it for you on every reboot.

 

Proudly powered by WordPress
Theme: Esquire by Matthew Buchanan.