Uninstall Windows and revert your Surface Duo 2 to stock

Edit This Page

Files/Tools Needed 📃

PLEASE READ AND BE SURE TO UNDERSTAND THE ENTIRE GUIDE BEFORE STARTING

If you caused modifications to Android™ system partitions and are not knowingly using Custom Trusted Boot certificates or do not know what we’re talking about here but flashed a dual boot image onto your device, you need to revert this. Please see the dual boot guide for assistance first and foremost. Otherwise below’s steps will brick your device.

What you’ll get 🛒

A normal Surface Duo, with Android™ only. Just like you had it before installing Windows. If you haven’t broke anything else in the meantime.

Android™ will have access to the whole memory back again.

Steps 🛠️

Make sure you have not done any dual boot guide!

If you have followed a guide to use dual boot, please first remove dual boot by following the uninstall section in the dual boot guide, this is important: DualBoot

Going to the Bootloader menu

  • Start by turning on your Surface Duo into Android™, and unlock it

  • Open a command prompt on your PC

image

  • Go to the folder where you extracted the Google Android™ Platform tools using the CD command and the path of the folder, like so:

image

  • Run the following command to ensure your phone is detected by your PC
adb devices

image

  • Run the following command now
adb reboot bootloader

You will be rebooted to Surface Duo’s bootloader.

Surface Duo in Bootloader mode Image of what you should see right now: Surface Duo in Bootloader mode

Booting to TWRP

  • Plug your phone to your PC, open a command prompt and start by typing the following text, but do not press enter just yet
fastboot boot

image

  • Go find the surfaceduo2-twrp.img file you downloaded earlier, right click it, click “Copy as path”

image

  • Then go back to the Command Prompt window we started writing text in previously, and simply, right click on it with your mouse (or long press if you’re on a touch device), you should now see this:

image

  • Now you can press enter

image

You will now boot to TWRP. Reminder that touch doesn’t work on TWRP for now, so you’ll have to work through your PC.

Restoring the original partitions

  • Once booted into TWRP, start by running the following command to make sure everything we do is accepted by the device:
adb shell "setenforce 0"

image

  • Now, let’s copy parted onto the device, first, start by typing the following text, but do not press enter just yet
adb push

image

  • Go find the parted file you downloaded earlier, right click it, click “Copy as path”

image

  • Then go back to the Command Prompt window we started writing text in previously, and simply, right click on it with your mouse (or long press if you’re on a touch device), you should now see this:

image

  • And now, continue to write the rest of the command, like so:
 /sdcard/

image

  • Now you can press enter

image

  • Now let’s install parted correctly onto the TWRP image, by running the following command
adb shell "mv /sdcard/parted /sbin/parted && chmod 755 /sbin/parted"

image

  • Now, let’s open a shell onto the device, by running the following command
adb shell

image

  • Let’s now run parted:
parted /dev/block/sda

image

  • And let’s execute parted’s print command:
print

You’ll get a list of partitions.

  • First, in above print command, locate every partition that exist after the “misc” partition, as we can see, for us, they are esp, win, and userdata, you may have the same ones, but you may also see, esp, win, “other partitions”, and userdata. These other partitions can be the windows recovery environement, but please make sure they aren’t anything else. You should not be seeing partitions named “ssd”, “persist”, “metadata”, “frp”, or “misc” starting from index 8 all the way to the end. If you do, please reach out and do not continue with this guide.

Here’s an example of what we’re keeping an eye on here for our example (remember, for you it may be different but likely not) highlited inside a red rectangle:

All partitions from index 8, to the end here, must be removed, so let’s proceed with removing each, in our case, we want to remove the esp partition (number 8), the win partition (number 9), and the userdata partition (number 10).

  • Let’s start from number 8 (esp)
rm 8
  • Then number 9 (win)
rm 9
  • And lastly, for us, the last index, number 10 (userdata)
rm 10
  • Now that we have removed all partitions from index 8 to the last one, let’s recreate user data.

  • If you have a 128GB Surface Duo model, run the following command:

mkpart userdata ext4 401MB 110GB
  • If you have a 256GB Surface Duo model, run the following command:
TODO: Please file an issue to help us!
  • If you have a 512GB Surface Duo model, run the following command:
TODO: Please file an issue to help us!

In our case we have a 128GB Surface Duo model, so we’re running the first command, like so:

As you can see, parted notifies us the partition may not be aligned for best performance, if you get such warning as well, simply enter i like so:

  • Let’s now run the print command:

Please confirm that you see the exact same thing as we do above, except the total storage capacity. If you do not, your device may permanently be damaged if you reboot or turn it off now. Please reach out as soon as you can to prevent rendering your device a paper weight to telegram for assistance, and remain calm and patient.

  • Let’s now leave parted after confirming we did well previously:
quit

This will get you out of parted and back to the device shell.

  • Now let’s make the userdata partition actually usable:
mke2fs -t ext4 /dev/block/sda8
  • As you can see, mke2fs notifies us, the previous partitions (esp) is here, simply confirm by answering “y” like so:
  • And leave the device shell
exit
  • Once it is done, you can reboot your phone using adb reboot. You will be able to boot to Android™ and your phone should work normally. In case it doesn’t you likely messed up something above.
  • You should now be seeing the Android™ Out of Box Experience (OOBE). Setup your phone to confirm it works correctly if you need it.

Android™ - OOBE

  • Once your phone is confirmed working, congratulations, you successfully uninstalled Windows from your device.

You may however want to also relock the bootloader of the device, please note that you cannot relock the bootloader of your device if you flashed a custom rom as well as installed Windows before, or modified the boot partition for dual boot, or other purposes. Please look into undoing such changes before proceeding forward.

In order to relock the bootloader

  • Start by turning on your Surface Duo into Android™, and unlock it

  • Using the Microsoft Launcher, find the settings app

A1 Android™ - Open Settings

  • Open the Android™ Settings app

A2 Android™ - Settings Opened

  • Scroll down to the about section, and open it

A3 Android™ - Settings About

  • Scroll all the way down til you see the Build Number field

A4 Android™ - Settings About Down

  • Press the Build number field 7 times consecutively, you should first start to see a popup after 3 taps

A5 Android™ - Settings About Down Tap Dev

  • Once done tapping 7 times, you should be seeing this popup instead

A6 Android™ - Settings About Down Tap Dev Done

  • Now go to the System section, you should see a new Developer options section like shown below

A7 Android™ - Settings System with Dev

  • Go to the Developer options section

Android™ Settings System Dev Options

  • Turn on the “OEM unlocking” option as shown above, then, scroll all the way down til you see the “USB debugging” option

Android™ Settings - Dev - Debugging Option

  • And turn on the “USB debugging” option

Android™ Settings - Dev - Debugging Option Confirmation

Assuming your Surface Duo is booted to Android™, plugged to your PC:

  • Open a command prompt on your PC

image

  • Go to the folder where you extracted the Google Android™ Platform tools using the CD command and the path of the folder, like so:

image

  • Run the following command to ensure your phone is detected by your PC
adb devices

image

  • Run the following command now
adb reboot bootloader

image

  • Your phone will ask for permission to authorize your computer to execute commands, accept it:

Screenshot_20230811-024721

  • Now run the following command again, it should now work properly:
adb reboot bootloader

You will be rebooted to Surface Duo’s bootloader.

Surface Duo in Bootloader mode Image of what you should see right now: Surface Duo in Bootloader mode

  • From there:
fastboot flashing lock
  • Confirm that you want to relock the bootloader using your device side buttons, your device will erase itself and restart into the Android™ Out of box Experience Again. If your device doesn’t go into Android™ but the bootloader menu, this means you performed additional modifications to your device previously, and you must undo them. You need to reunlock your device now using “fastboot flashing unlock”, and undo them according to the instructions you or someone else provided you)

  • You should now be seeing the Android™ Out of Box Experience (OOBE). Setup your phone to confirm it works correctly.

Android™ - OOBE

Congratulations, you successfully relocked your bootloader.

Now, you may want to forbid unlocking the bootloader again for additional security and peace of mind

In order to turn off the ability to unlock the bootloader of the device

  • Start by turning on your Surface Duo into Android™, and unlock it

  • Using the Microsoft Launcher, find the settings app

A1 Android™ - Open Settings

  • Open the Android™ Settings app

A2 Android™ - Settings Opened

  • Scroll down to the about section, and open it

A3 Android™ - Settings About

  • Scroll all the way down til you see the Build Number field

A4 Android™ - Settings About Down

  • Press the Build number field 7 times consecutively, you should first start to see a popup after 3 taps

A5 Android™ - Settings About Down Tap Dev

  • Once done tapping 7 times, you should be seeing this popup instead

A6 Android™ - Settings About Down Tap Dev Done

  • Now go to the System section, you should see a new Developer options section like shown below

A7 Android™ - Settings System with Dev

  • Go to the Developer options section

Android™ Settings System Dev Options

  • Turn off the “OEM unlocking” option as shown above, then turn off the developer options toggle at the very top

🎉 Congratulations, your Surface Duo is back to factory settings.


Š 2020-2024 The Duo WOA Authors

Snapdragon is a registered trademark of Qualcomm Incorporated. Microsoft, the Microsoft Corporate Logo, Windows, Surface, Surface Duo, Windows Hello, Continuum, Hyper-V, and DirectX are registered trademarks of Microsoft Corporation in the United States. Android is a registered trademark of Google LLC. Miracast is a registered trademark of the Wi-Fi Alliance. Other binaries may be copyright Qualcomm Incorporated and Microsoft Surface.

Limited emergency calling

Running Windows on your Surface Duo is not a replacement for a proper phone operating system and does not have emergency calling capabilities.

Hello from Seattle (US), France, Italy.