answer:
change owner of each file of virtual machine
ex:
sudo chown -R ${USER} *
iterator must be released
the element got from IOIteratorNext must be released
ex:
ele= IOIteratorNext(iter)
while(ele != IO_OBJECT_NULL){
IOObjectRelease(ele);
ele = IOIteratorNext(iter);
}
IOObjectRelease(iter);