How to use fixed virtual HDD file with nox app player (how to prevent “aging” problem)

What to do

change variable-size virtual hdd file with fixed-size one.

Requirement

virtualbox, vboxmanage.exe (included in virtualbox) Minitool Partition Wizard (or other partition management tool), ubuntu live cd, notepad++ (other text editor)

Instructions

note: If you think 32GB(=declared size of source) is good for fixed-size disk, just clone source disk to fixed-size one. Then skip 2-12 steps.

  1. clone default user storage file using vboxmanage.exe, and name it “copy.vhd”. the file is located in bin\data\system\base-disk2.vdi
    vboxmanage.exe clonemedium nox-data.vdi d:\copy.vhd --format vhd
  2. create linux virtual machine in virtualbox.
  3. add copy.vhd and ubuntu live cd to VM, and start it.
  4. In VM(=ubuntu), find last partition in copy.vhd. it might take 32GB. shrink it much as possible. you might use Gparted for this step.
  5. turn off VM.
  6. create fixed-size hdd file using vboxmanage.exe. name it “fixed.vhd”. memo its uuid.
    vboxmanage createmedium --filename d:\fixed.vhd --size 6000 --variant fixed --format vhd
  7. In Host(=windows) mount 2 vhd files from above. use windows disk management console for this step.
  8. copy 3 partitions to fixed.vhd file from copy.vhd using Partition Wizard. (important: be sure to copy them as Primary partition, though default value is logical. if you copy them as logical, nox will fail to start)
  9. dismount 2 vhd files.
  10. add fixed.vhd to VM and start it again.
  11. In VM(=ubuntu), expand last partition of fixed.vhd to maximum size.
  12. turn off vm.
  13. copy fixed.vhd to your nox instance location. it might be found in <nox installation|appdata>\BignoxVMS\nox
  14. open nox.vbox with notepad++.
  15. edit vhd uuid, location(=filename), format(=VHD) in “VirtualBox\Machine\MediaRegistry\HardDisks\HardDisk”
  16. edit uuid in “VirtualBox\Machine\StorageControllers\StorageController\AttachedDevice\Image”
  17. save nox.vbox file.
  18. jobs done! now start nox.

Documentations

VboxManage manual

Backgrounds

The nox app player gets “older” when times passes. It takes bigger hard disk space, but player gets slower and more laggy. Although reinstall resolves this, it’s a big pain to do setup again.

Why this happens? Because nox uses variable-size virtual hard disk.

Variable-size disk is good to start, as it takes small amount compared to its declared disk size. but it is not good in long term, because it never “recycle” space. it stacks up all changes(kinda log), and never delete contents once it wrote. Every modification in virtual disk requires additional space in physical disk. So the filesize of variable-size disk grows without limitation. Also it degrades performance because every access to disk causes to sum-up all changes, as it is a huge overhead.

On the other hand, Fixed-size disk is good to run stable system. All spaces in virtual drive are mapped to physical drive, so there is little overhead to use it.

But why the instruction is so complicated? I think 32GB is too big for nox. So I wanted to resize it. But the problem was: vboxmanage does not support shrink. To resolve this, I had to:

Partition cloning: Partition Wizard. but it does not support resize for non-windows partitions.

Partition resizing: Gparted. but it cannot copy 2nd partition in source drive.

Disk Mount: Disk management console for Partition Wizard, Virtualbox for Gparted.

Disk creation/cloning: Vboxmanage.exe.

Edit VM configuration: notepad++

Whoa. that was a quest.

how to use 3rd party launcher in nox app player

all credits go to video.

open file browser, and navigate to “system/app/”. root permission required.

rename launcher_*_signed.apk, like launcher_apk.bak. then it will not be installed since next boot.

additionally, you can remove other builtin apps, like facebook lite(com.facebok.lite.apk), ES explorer(EStrongs.apk), etc. by removing these unused apps you can expect shorter boot time, since they will not be deployed any longer.