Page 1 of 1

creating image from SD card and using it with VM

Posted: 20. Oct 2012, 20:55
by mans
I want to create an image from a SD card and using it inside a VM. Is it possible to do this?
I want somthing similar to the way that I can create an ISO image from a CD and then mount it on a VM.

Re: creating image from SD card and using it with VM

Posted: 20. Oct 2012, 23:59
by BillG
It is most unlikely that the vm will see an SD card in the host. A vm sees only its own emulated devices, not the physical devices in the physical machine. A vm can only use the physical devices in the host machine if the virtualization software (VirtualBox in this case) can pass data between the physical and virtual devices (as it does for the mouse and keyboard, for instance).

Re: creating image from SD card and using it with VM

Posted: 21. Oct 2012, 00:06
by mans
Thanks for reply. So how can I use a SD card in VM?

Re: creating image from SD card and using it with VM

Posted: 21. Oct 2012, 11:58
by mpack
You can image an sd card in the same way you can image any other disk. Mention what the host OS is and we might even be able to recommend some tools to do it with.

Alternatively if you have a removable USB reader for the card then you shoud be able to mount it directly in the VM.

Re: creating image from SD card and using it with VM

Posted: 21. Oct 2012, 21:10
by mans
I am using VM on a wondows 7 (x64) and I installed Linux on VM.
I am trying to follow this setup:
http://processors.wiki.ti.com/index.php ... VirtualBox
but i am not able to mount the sd card on linux.

Re: creating image from SD card and using it with VM

Posted: 22. Oct 2012, 14:47
by mpack
On a Windows host you should be able to create a virtual image of a disk using Disk2VHD, then mount the VHD in a VM.

For Linux host users: you would clone the disk using CloneZilla, then convert the resulting raw image drive to VDI format using CloneVDI with the "Compact" option enabled (using VBoxManage convertfromraw will also work, but result in a humungous VDI).

Re: creating image from SD card and using it with VM

Posted: 22. Oct 2012, 15:54
by mans
Thanks.
This application can not see my SD card. The windows can see it since I can read and write to it, but Disk2VHD can not see it as an attached drive.

Re: creating image from SD card and using it with VM

Posted: 22. Oct 2012, 16:34
by mpack
mans wrote:Disk2VHD can not see it as an attached drive.
Well, that's a surprise: you are quite correct, though I can't think why Disk2VHD would have this limitation - I checked whether it simply disliked FAT formatted drives or sdcards, but no, it ignores NTFS formatted USB thumb drives too.

In that case, a less user friendly method which I've just confirmed does work is to use CloneVDI (see link in previous message) to clone a physical drive to a VDI (remember to tick the "Compact" box). The source filename field in CloneVDI must be "\\.\PhysicalDriveN", where N is a placeholder for the drive number (0,1,2 etc). You can get the drive number from My Computer | Manage | Disk Management. Although it works, CloneVDI is not really designed for cloning physical drives, a main symptom of which is that its default "destination" filename is all wrong, and the browse button beside it will not work. You must manually type in a correct filename (for the destination file) "blind" as it were.

Re: creating image from SD card and using it with VM

Posted: 22. Oct 2012, 17:15
by scottgus1
Do you need to write to the disk image after making it? If not, try making a .iso out of the contents of the SD card, and mount the .iso like it's a CD. ImgBurn does this on Windows. See http://www.imgburn.com/index.php?act=download, mind which link you're clicking to download, there's a lot of ads on the site. I use ImgBurn, no problems.

Re: creating image from SD card and using it with VM

Posted: 22. Oct 2012, 17:46
by mans
imgburn has the same limitation as disk2vhd as it can not see sd card and hence can not create iso from sd card.

Re: creating image from SD card and using it with VM

Posted: 23. Oct 2012, 12:28
by mpack
mans wrote:imgburn has the same limitation as disk2vhd as it can not see sd card and hence can not create iso from sd card.
I believe ScottGus intended that you would use ImgBurn to compile an ISO containing the normal contents (files and folders) from the sd card. He was not suggesting imaging a disk.

Re: creating image from SD card and using it with VM

Posted: 23. Oct 2012, 12:47
by mans
Unfortunately I cannot do that as the SD card has a partition in Linux that cannot be read in Windows and hence I don't have access to its files.

Re: creating image from SD card and using it with VM

Posted: 23. Oct 2012, 14:23
by mpack
Then we are back to the CloneVDI suggestion I made in my last but one message.