Skip to content

Instantly share code, notes, and snippets.

@Efreak
Created January 2, 2016 01:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Efreak/706ac0735354d16fb97b to your computer and use it in GitHub Desktop.
Save Efreak/706ac0735354d16fb97b to your computer and use it in GitHub Desktop.
1. Make a copy of the vhd file for your android device called image.orig.vhd or some such, for use as a backup. Temporarily rename the original vhd file to image_2.vhd or some such, so you can use it later (a vhd can only be on one virtual machine).
2. Open an administrator command prompt in windows
3. Run `diskpart`
4. in diskpart, `select vdisk file="C:\path\to\image.vhd"`
5. in diskpart, `expand vdisk maximum=XXXXX`
- XXXXX is a number of megabytes. This is the maximum size that you want your android virtual machine to take up. I resized mine to 100gb max.
6. in diskpart, `detach vdisk` to make sure the system doesn't reserve it (this may have happened because I was looking at it in diskmgmt, not sure)
7. Open Hyper-V manager (if you've got the microsoft android emulator installed, this is installed too. You can find it under administrative tools)
8. Either create a new virtual machine or edit an existing linux virtual machine. It has to be [i]generation 1[/i], not 2, and has to be connected to the network; the rest doesn't matter much.
9. Add an [i]IDE[/i] hard drive to the virtual machine, and select your renamed vhd file.
10. Boot the vhd and install the OS. Only minimal GUI (ie, the xinit package of ubuntu minimal) is required. Install gparted.
11. After installing the OS and rebooting into it, run startx if necessary to start the GUI.
12. run gparted
13. Move the 4th partition to the end of the disk
14. Resize the 3rd partition to fill the disk
15. Click apply.
16. Shut down the virtual machine (gracefully--use `sudo shutdown now`, not `poweroff` or the hyper-v 'turn off' button)
17. Move/rename the android vhd file back to image.vhd in the original directory.
18. Start the android emulator
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment