Handling Virtual Hard Disk for Host (diskhandler)

The pyti.diskhandler modules helps in transferring data from the host machine to the guest and viceversa. Its main objective is to upload the distributions to the guest for testing and download the raw data on the host (after the tests are conducted in the guest i.e the VM).

DiskOperations class

To initialize DiskOperations object we need to include the disk_path of the virtual hard disk which we want to access along with the two mount points (one for fusing the virtual hard disk onto the host to a recognizable format and another for actually mounting the virtual hard disk)

Example

The following example mounts a partition from the disk , uploads a file to the disk , also downloads a file from the disk:

>>> from diskhandler import *
>>> d = DiskOperations('/home/yeswanth/a.vdi', '/mnt/fuse', '/mnt/guest')
>>> d.upload("/home/yeswanth/a.txt", "/home/pyti/a.txt")
>>> d.download("/home/pyti/b.txt", "/home/yeswanth/b.txt")
>>> d.close_connection()