Saturday, June 11, 2016

How NOT to dual boot Windows 10 and Android on an Acer Aspire Switch 10 E Laptop/Tablet hybrid

Update: Originally I was going to call this article "How to dual boot...", but after somewhere between 8-12 hours of intense research and trial and error, I still haven't reached my goal. So I post this in hopes that it will come up in a future google search for someone who has some specific questions about the Acer Aspire Switch 10 E. Later, once I actually get it working properly, I'll post a proper "how to" article.

In this article we'll be talking about configuring Phoenix OS alongside Windows 10 and how to get a bootloader working with it, which is especially challenging with this UEFI only laptop. It's a long read, but I'm hoping this will be useful to someone in the future who has similar problems. It will be faster for you to read through my woes of what didn't work for me, than to do trial and error yourself. This article assumes you have at least intermediate knowledge of computers, which would make sense if you are wanting to dual boot your PC   :)

OK, this is only partially related to the RGC as it has to do with the Acer Aspire 10 E which I just got this past week for the excellent price of only $100 on Amazon new...

This is a pretty sweet and fun little computer! The first time I took it apart from the keyboard and just held it as a tablet and browsed a website, I marveled at it for a minute and it felt great! I couldn't believe I was still using full blown x86 Windows on a tablet like device. This thing is very versatile.

So, one of the first things I did with it obviously was to upgrade it from Windows 8 to Windows 10, since that is still free at the time of this writing, until the end of July I believe.

After that, I started to speculate whether I could get some android apps running on it. But I didn't really want to go with virtualization... I've had bad luck with that in the past on my older laptop.... Virtual machines just simply refusing to start.

So I did a little digging and found out about this thing called Amiduos, made by American Megatrends, the same guys who have been making computer BIOS systems since I was 4 years old! So I thought this sounded promising... It says it is the "fastest android emulator for PC". OK, these guys must know how to code some sweet dynarecs in assembly or something, they are the BIOS guys after all   ;)  

It took a LONG time to get Amiduos configured... In fact, if I hadn't been so exhausted that night and falling asleep while it was running, I probably would have assumed it had frozen up and given up on it. But eventually it did load. And I was able to download some android games to test.

While it did run all the games I tried, they were slow. Not painfully slow, but too slow to be playable.

So I knew there had to be another way. A way to actually run android on an x86 machine?

So after a little more research, I discovered several options....

* Android x86, which is the oldest and probably now the least mature of the products

* Remix OS which has been around for a couple of years
* Phoenix OS... Chinese newcomer on the scene, but appears to be very competitive with Remix.

After reading their spec sheets I chose Phoenix for a couple of reasons, mainly because if you run it off a USB stick, Remix requires USB 3.0 and Phoenix can be run off 2.0. There were a couple other reasons as well, but I can't remember specifically.

Anyway...   It was time to try it out...

At the time of this writing, Phoenix is at version 1.0.8 RC (Release Candidate). You can download it from their site here:

Installation is theoretically very simple. You just run their installer exe and tell it what USB stick or Hard Drive to install to, and then reboot and run it.

In practice it's much more complex, especially due to the fact that my Acer only has a UEFI system as opposed to a legacy BIOS. This is my first experience with one of these after messing with it for many hours, I'm not really thrilled about it.

Supposedly there is a firmware update for some of the Acers to give them a menu option to revert to legacy bios. Not the Switch 10e. I updated the firmware from 1.02 to 1.09 (newest) and there is no such option when you boot to the UEFI.

So the weird part is this: each operating system that you want to boot from has an .efi file which contains information about the OS, presumably where to locate it and stuff like that.

But, by default the Acer UEFI utility is set for "Secure Boot", which is supposed to add some kind of extra protection... Protection against what I'm not sure....   In my mind it's protection against being able to install your OS's and use your computer how you want to... But I digress.

So, the weird dichotomy with the "Secure Boot" feature is that in order to use a different .efi file, you have to manually add it to a kind of whitelist. To do this, you go into the UEFI menu, into the "Security" tab, and then under "Select an UEFI file as trusted for executing". After you've done this, you have to save and exit the UEFI, and then next time you load the UEFI up, it will show in the list of boot options along with Windows Boot Manager, USB HDD, etc.

What makes it weird is that most places recommend you disable the "secure boot" feature in order to make things "easier". The problem on the Acer UEFI is when you disable secure boot, it also disables the option to go in and add an .efi file as trusted, and therefore disables the method of adding them to the boot list. I guess you can leave secure boot on first, add the efi files, and then disable secure boot afterwards... I haven't messed with it enough to confirm this with 100% certainty.   [ I will try to update this later once I confirm ]

Anyway, back to PhoenixOS....   I got it up and running just fine, and as of 1.0.8 RC it has Google Play services, which is awesome. It doesn't come rooted by default, but, this post on the Phoenix OS forums has a link to a system.img which you just replace in your PhoenixOS directory, and then it will be rooted.

So I liked this PhoenixOS! It runs very fast, and the same games that I attempted in Amiduos ran almost flawlessly in Phoenix. Full speed. Very nice.

The problem came when I was testing Phoenix OS, every time I tried to boot back into Windows 10, it seemed to have corrupted Windows 10's startup files (I'm not exactly sure what), I just know that I had to sit there and wait 10 or 15 minutes for Windows 10 repair itself every time.

So I knew it was necessary to get a bootloader going if I was going to take this thing seriously.

Initially I was going to use rEFInd. However I noticed in its instructions for manually installing inside Windows 10, it says that the instructions are based on Windows 8 and don't work for Windows 10. Great.... Google searches didn't reveal anything about how to get it to work in Windows 10.
But, it said the best way to do it was inside Linux. OK, no problem.... Let's set up a Linux bootable USB stick real quick and get this thing done...

So I tried several flavors of Linux, and I couldn't get any of them to boot! ubuntu mini remix, trisquel, I was about to try vanilla Ubuntu, when I realized it's probably not the Linux's, it's probably my computer. I found a thread where someone was having a similar problem of not being able to boot from USB. One guy's suggestion was to upgrade the firmware to one that supports legacy Bios. As I said, that is not available. The other suggestion was to use a USB OTG adapter instead of using the regular USB type A port. OK, whatever I thought, I've got a USB OTG adapter that I know works, so I'll give it a shot. I even formatted it with the RUFUS utility like he said, GPT, Fat32, everything. I tested it inside windows to make sure the files were showing up... Yeah, I could see my Linux installs. But try to boot from it... No go. Eventually I got some kind of error message, I forget exactly what it said but it basically said that USB Booting was not supported on this computer.

Wow. Just wow. Then why is it even an option in the UEFI? Seriously. Bad Acer, bad. But I'm willing to overlook it because it's still an awesome computer at a great price.

So anyway..... Frustrated with not being able to install rEFInd, I looked for an alternative to rEFInd. I came across the utility "Grub2win" which is supposed to be able to easily install Grub2. Tried it out, and while it did install Grub 2, I couldn't figure out how to point it to PhoenixOS. It also threw some error about the fact that it was UEFI only and it couldn't support as many features.

Giving up in frustration on that one, then I tried EasyBCD, which is supposed to easily install "neogrub". Following the tutorial here:
But again, EasyBCD throws an error about my system being UEFI only and it won't have as many features. Then indeed when I get in and try to add a new entry, the options for Neogrub are grayed out. Perfect.

So I'm back to maybe figuring out how to manually install rEFInd.

I was getting intense at this point. Not desperate, just determined. (I had already been working on the issue for many hours, probably 6+ hours straight).

So I figure if I just manually move the rEFInd .efi file onto the EFI partition, I should be able to select it in the UEFI and it will work, right?

Remembering a post I read earlier in the night, I referred back to it...

It highlights some peculiarities about manually accessing your UEFI partition on Windows 10. Even after you taskkill explorer.exe, it still gives an error about accessing the partition.

Someone suggested that you just type the drive letter straight out of task manager, it would work.
 I couldn't get that to work, but fortunately the command line worked.

To make it simpler for this blog, here is what I had to do to access the EFI partition:

open cmd as admin...
sel disk 0
sel part 1
assign letter=b
taskkill /im explorer.exe /f

Then, just open a cmd window as administrator and type the following commands:
cd EFI
mkdir rEFInd

After that, you need to go to the location where you have the rEFInd .efi file. For me it was like this:
cd \
cd 0_home\refind-bin-0.10.3\refind

Yours will of course be different. Then copy the .efi file. I'm using the 32 bit version, but you would need to copy the x64 file if that's what you're using. So the next command would be:
copy refind_ia32.efi b:\EFI\rEFInd\

That just simply copies the file, like we used to do in the DOS days   :) 

The next step is simply to go back to the UEFI and add the rEFInd efi, and hopefully everything boots up and it sees both Windows and PhoenixOS and all is good   :) 

So... Fingers crossed, I added the rEFInd, restarted, and YES, it loaded rEFInd! And it shows Windows 10 and Phoenix OS! Now time to test.

Windows 10 loaded fine. So I came back to rEFInd, and launched Phoenix OS....

Instead of showing a PhoenixOS splash screen like it had been doing, now it was showing some Linux kernel stuff like you'd expect if you were booting up Ubuntu with verbose messages. Then it gets stuck on "Detecting Phoenix OS". I let it run for at least 20 minutes and it didn't seem to do anything.

So next... It's time to read the rEFInd manual. Maybe I'm doing something wrong in pointing it to Phoenix? OK.... It's got a whole section about how secure boot causes problems for bootloaders, and several proposed solutions to fix it. I'm going to try the easier method which involves "preloader".

It involved renaming the rEFInd efi to "loader.efi", and then downloading a "preloader.efi" and "hashtool.efi". I manually loaded them to my EFI partition through the command prompt again, and then I got to this cryptic statement in the tutorial:

register PreLoader.efi with the EFI by using efibootmgr in Linux or bcdedit in Windows.  

OK? So I figured it would be self explanatory. Turns out bcdedit is a command line utility, which I'm usually not scared of, but when I ran bcdedit /?, none of the options had any verbage at all about "register" or "registration". So I thought it must be officially called something else. Google search turned up very little. So I decided to do what I sometimes do in weak spots like this....  Find a GUI version of the utility   :)    So I found "Visual BCD Editor".... The website says it needs some .net framework dependencies, but fortunately it ran for me without adding any .net stuff. 
So I stare at Visual BCD editor for a few minutes, and it becomes apparent that "registering" it means the same thing as "adding a new OS loader" for the preloader.efi. So I did that, everything looks good to go. 

Rebootion time.... I'm feeling pretty good about it all at this point. Certainly something is going to work this time, right? So I add the preloader.efi to the "whitelist", restart, and....  Preloader loads... But...

"This 64-bit application couldn't load because your PC doesn't have a 64-bit processor... etc blah blah"...

Oops, right, I forgot to check whether I got the 64 bit or 32 bit version of the preloader/hashtool, right?

Not quite. I can't find anything at all about a 32 bit version of it. It appears there's just the one release. 

..... Now I'm FINALLY starting to get frustrated, after something like 8 to 12 hours of work. Up until that point, the whole journey has actually been pretty fun. It's like a puzzle to solve.

But no... Now it's just like.........   I gotta take a step back and re-evaluate how I'm going to approach the puzzle and hopefully figure out the most efficient solution   :)

So this is where our story ends for now... Of how ABSOLUTELY NOT to dual boot Windows 10 and Android on an Acer Aspire Switch 10 E.

To be continued, the right way     :)