Page 1 of 1

copying hard drive image file

Posted: 17. Aug 2011, 15:21
by 2disbetter
When the VM is running is it possible copy the image file in the Host OS provided the VM is not accessing the drive during the copy process?

I am asking because I have a development environment that I have setup in a VM, and when I make changes to files, it's just easier to move an entire hard drive image between the computers I work on than it is to export the entire system. THe hdd is set to be only 5gb in the guest OS, but is only currently taking up 800 meg on the host OS. This is super easy to transfer between computer on the network, instead of transferring the entire VM.

Thank you for any and all feedback.

2d

Re: copying hard drive image file

Posted: 17. Aug 2011, 18:35
by mpack
The host file is opened for writing by the VM, and not necessarily in a self consistent state, regardless of whether it's currently being accessed or not (and I'm not sure how you could know that). The VDI/whatever header may not have been updated properly yet, and then there is the guest filesystem and its own cache to consider. Not recommended.

Re: copying hard drive image file

Posted: 17. Aug 2011, 20:48
by 2disbetter
Thanks for the reply. I assumed as much myself. As far as knowing when the drive is not being accessed, it has to do with the function of the drive. Nothing is on it except for a folder and some source code files. If MS VS is not open, then nothing is accessing the drive. There aren't any cache folders on the drive and indexing has been turned off for the drive in its entirety. While it's not 100% I'd say its about as accurate an assumption as one can make without looking at the os operate through a debugger.

Thank you again for your feedback!

2d

Re: copying hard drive image file

Posted: 18. Aug 2011, 12:01
by mpack
I don't know what a "cache folder" is. Cacheing works at a much lower level than that, however in the circumstances you describe I agree the cache should not be very important.

However, giving the simplicity of your needs, can't you just keep the source files in a shared folder on your host? You can copy the contents of a shared folder any time you like, and cache etc is not relevant. Btw I'm talking about a true network share. I would not rely on a GA shared folder for this.

Re: copying hard drive image file

Posted: 18. Aug 2011, 20:02
by 2disbetter
Thanks for the reply. Originally I tried to use a share. I've found the shared folders between host and guest to be problematic and not as reliable as you would assume. A network share would be easier and ideal, however access to the network share cannot always be guaranteed. One of the main reasons for this VM is for my laptop which is often away from my home network, and while I can ssh in or even vpn in to my home network, an internet connection is not always around, and in most cases when it is, is not fast enough to move the files I need in a timely manner. Instead all I have to do is before I head out in the morning transfer the most current image of the hdd and roll. Transfer of this files takes less than 10 seconds on my home network. And since I can dump the hdd image between the hosts computers without any affect, it has proven to be the best solution so far.

Thanks again!

2d

Re: copying hard drive image file

Posted: 19. Aug 2011, 12:46
by mpack
I was not thinking of an internet connection, I was thinking of a virtual "Host Only Mode" networking connection between host and guest, providing the medium for the network shared folder. This works sufficiently fast IMHO, not being bound by physical ethernet bandwidths.