hatching / vmcloak

Automated Virtual Machine Generation and Cloaking for Cuckoo Sandbox.
483 stars 120 forks source link

Option to change installation directory #110

Open Hullgj opened 7 years ago

Hullgj commented 7 years ago

I was looking around the code for a place to change the installation directory of the virtual machine. Currently it places the instance in the home directory, which is problematic for me as I have limited space <30GB and want to install it on another drive. In version 0.2 I believe there was an option to specify the output, but don't quote me on that. Could you point me in the right direction, or file, where the output location is set.

It is also noteworthy to determine whether a configuration script is needed to locate external images. So, if one was to import a machine, they could link it with VMCloak. @jbremer Let me know if this is possible.

Hullgj commented 7 years ago

The path to where the .vdi is saved comes from repository.py that sets variable image_path for creating the skeleton of vmcloak. In main.py def init(): all command options are processed and after that image_path is used as the root to the .vdi image and it set in the field hdd_path. If you want to set the installation directory just modify def init() with a parameter such as image_place_path, create a conditional in case it is not set or invalid, setting the hdd_path based on that criteria. It should also be conditionally set in def clone():, but in this function it would be better to get the path from the repository.db database.

Hullgj commented 7 years ago

In response to the external images. This can be set in the repository.db using SQLite3. Just copy an existing image table and populate it with the credentials of the new virtual machine and its location.

razuz commented 7 years ago

I'm not sure if I understand your issue exactly however ... to be precise then you can freely move around user home dir with normal linux options which will basically of give you what you want as far as I can understand what you want to achieve. Cause home is home and it really doesn't matter where it sits at. As example the config that I use in normal situation is that home for user that is using the VM-s (cuckoo to be precise) sits at /srv/cukoo and this is another partition/disk mounted. In case you need to move around tmp dir (which is actually much harder concern usually) then for that there is option --tempdir available.

Dumping the images to a different path can also be done however I don't think there's much need for that as one will be wasting some space somewhere and it could be home dir on another partition/path.

Again - maybe there is a good point to implement that which I don't follow - let me know and I'll try to do that.