How do I capture image from a Virtual Machine?

Clanger

Moderator
Staff member
How do i capture an image from from Virtual Box?
Which format/type is best to create the virtual drive? i know virtual box gives me options which type to use during creation.
Is there anything i need to disable during creation, like host networking and shared folders?
 
Last edited:
might not be helpful cos I use hyper-v:
i choose vhd not vhdx because the env i set
like small ramdisk
and getting bigger Slower then vhdx when copying files or installing
probably more reasons that i dont remember now i will update if i do

i use dism to capture the after i mounted the vhd
 
mount the vhd, how? ive only done basic stuff with VB up to now.
nuhi put me onto VB and i capture with (G)imagex. abbodi86 said that dism doesnt set the flag but imagex does.
 
7 Pro(eol). im in the mood to try it straight away and it will save me setting up the test pc in the kitchen, lack of room here :(
 
1) Simply create VirtualBox machine with VHD.
2) VHD can be mounted using DiskPart, you can also use VHDMount / VHDUnmount scripts from SendTo menu.
Code:
https://www.howtogeek.com/51174/mount-and-unmount-a-vhd-file-in-windows-explorer-via-a-right-click/

3) Then capture it.

u need win8 at least to mount vhd
mb there a way around out there in the net
VHD can be mounted in 7 using DiskPart without problem

For capturing image on 7 must be used DISM from 8 or newer. Or use old imagex to achieve it.
 
schmucky question time. if you remove hyper v you wont be able to mount a vhd, what 3rd party tools like virtual clone drive etc can mount a vhd?
found this at raymondcc. think sysinternals have something to deal with vhd's.
 
Last edited:
I guess i forgot about that sry :oops:

"what 3rd party tools"
winmount i think not sure cos i use it long ago
 
Last edited:
thanks George. i always use imagex because of the flag issue. all seems simple enough.

For setting flag and all WIM atributes is best to use WimLib

Code example
Code:
call :SetImageInfo "%~dp0_output\sources\install.wim" 39 "UltimateN" "Windows 7 Ultimate N " "Windows 7 Ultimate N " "Windows 7 Ultimate N " "Windows 7 Ultimate N " >nul

:SetImageInfo
"%~dp0apps\WimLib\%PROCESSOR_ARCHITECTURE%\wimlib-imagex.exe" info "%~1" %~2 --image-property FLAGS="%~3"
"%~dp0apps\WimLib\%PROCESSOR_ARCHITECTURE%\wimlib-imagex.exe" info "%~1" %~2 --image-property NAME="%~4"
"%~dp0apps\WimLib\%PROCESSOR_ARCHITECTURE%\wimlib-imagex.exe" info "%~1" %~2 --image-property DESCRIPTION="%~5"
"%~dp0apps\WimLib\%PROCESSOR_ARCHITECTURE%\wimlib-imagex.exe" info "%~1" %~2 --image-property DISPLAYNAME="%~6"
"%~dp0apps\WimLib\%PROCESSOR_ARCHITECTURE%\wimlib-imagex.exe" info "%~1" %~2 --image-property DISPLAYDESCRIPTION="%~7"

schmucky question time. if you remove hyper v you wont be able to mount a vhd, what 3rd party tools like virtual clone drive etc can mount a vhd?
If you have enough space, simply extract it using 7-zip.
 
i saw 7zip on the list. space is never an issue and i have 165gb unpartitioned for testing purposes.
 
Back
Top