[Miscellaneous Android Development] evildog1:
BlueStacks 2.2.17.6203 is introducing "VirtualBox VMs".

The filesystems have been changed to "vdi format" (VirtualBox).

For linux experts: if you know how to mount and modify .vdi without VirtualBox, skip to step 9.

Well, let's get started!

First of all, to root BlueStacks this way you need VirtualBox and you have a Linux OS installed. If you just got started, I'll recommended Ubuntu, you can follow the guide installing Ubuntu on BirtualBox. http://www.wikihow.com/Install-Ubuntu-on-VirtualBox

Also, you will need some linux knowledge. It's not necessessary, but I won't provide any support about the part dealing with linux commands. Just follow the instructions and probably you will be able to root it, but it might not be that simple.

The second mandatory stuff you will need is the Android App called SuperSU. At this time, you should be able to find the latest SuperSU. The instructions should be the same with other SuperSU versions.

Here is a direct link http://www.supersu.com/download

This tutorial assumes you already have an installed BlueStacks you wish to root, but make sure Bluestacks and Ubuntu isn't running isn't running. So, let's get started.

In this tutorial i'm using Ubuntu.

1. MAKE A BACKUP OF ROOT.VDI FILE FIRST!

2. To modify Root.vdi, you need to mount it in Ubuntu virtual machine. Select Ubuntu and click Settings -> Storage. Select Controller: SATA and click on the HDD with green plus symbol.

3. A dialog box will appear. Select Choose existing disk

4. Navigate to Bluestacks directory where you installed. Select Root.vdi and Open

ProTip: You can mount Data.vdi and SDcard.vdi to transfer files between guest and VDI.

5. Root.vdi should be added in Storage. Click OK

6. Start Ubuntu on VirtualBox

7. Ubuntu: On your desktop, you should see the grey Hard Drive icon on the right taskbar. Yep, that's root.vdi image file that has been mounted and the disk name should be named 8,6 GB Volume

8. Extract x86 Folder from .zip (Recovery Flashable.zip) archive file and /common/SuperSU.apk somewhere on Ubuntu. Bluestacks is based on Android x86.

8.1. If you already downloaded it on your host computer, Click Devices -> Drag and Drop, Select Bidirectional and you can transfer the file to guest

If you haven't download it yet, download it from http://www.supersu.com/download and click Recovery Flashable.zip

9. Copy the following SuperSU files into your mounted root.vdi

Add file: /x86/su -> (8,6 GB Volume)/android/system/xbin/su

Rename file: /x86/su ---> (8,6 GB Volume)/x86/daemonsu

Add file: /x86/daemonsu ---> (8,6 GB Volume)/android/system/xbin/daemonsu

Add file: /x86/supolicy ---> (8,6 GB Volume)/android/system/xbin/supolicy

Add file: /x86/libsupol.so ---> (8,6 GB Volume)/android/system/lib/libsupol.so

Add file: /common/Superuser.apk ---> (8,6 GB Volume)/android/system/app/Superuser.apk

10. You need to change file permissions in order for SuperSU to work correctly. Open terminal and type the following commands. Type your password when asked

Note: The disk name might be different. You can check it by right click on 8,6 GB Volume and select Properties

ProTip: Type sudo chmod xxx in terminal and drag a file to get the full path like below. Press UP ARROW on your keyboard to show the last command you used.

sudo chmod 755 '/media/test/<disk udid>/android/system/xbin/su'

sudo chmod 755 '/media/test/<disk udid>/android/system/xbin/daemonsu'

sudo chmod 755 '/media/test/<disk udid>/android/system/xbin/supolicy'

sudo chmod 644 '/media/test/<disk udid>/android/system/lib/libsupol.so'

sudo chmod 644 '/media/test/<disk udid>/android/system/app/Superuser.apk'

Files should be owned by root:root. No need to change it on Ubuntu.

11. Now we need to start "daemonsu" on every reboot. BlueStacks init procedure is quite simple. Seems like there is only android/system/etc/init.sh. So, open android/system/etc/init.sh in your preferred linux text-editor, go at the bottom of the file and search for:

init|"")
do_init
;;
esac

Add this

init|"")
do_init
/system/xbin/daemonsu --auto-daemon &
;;
esac

I'd say we're done now! Shutdown your Virtualbox

12. Now you can start your BlueStacks. When it's booted, launch SuperSU via Play Store.

You will be prompted about a SuperSU update. Choose the "normal" way and after the update, restart your BlueStacks.

13. That should be it. Now your BlueStacks is rooted.

To be certain you should open your PlayStore and install your preferred RootChecker.

An additional task you might want to do would be using some apps like "/system/app Mover" and "System App Uninstall" and change the SystemDefaultAppLauncher and SystemDefaultAppBrowser.

I usually install Nova Launcher.

Also, as Root FileExplorer, I install X-Plore.

You might want to install a CatLog too!

Hope you enjoyed this tutorial

Hope you will enjoy you newly rooted BlueStacks.

Tweak your Bluestacks and share your .vdi files to everyone.

Credit goes to rumbla (mybot.run) for the original tutorial how to modify root.fs

And me for this new tutorial