Windows Loopback Alternative: Difference between revisions
[unchecked revision] | [unchecked revision] |
(→Use) |
m (addcat) |
||
Line 1: | Line 1: | ||
{{Rating|1}} |
|||
It is a well known fact that Windows doesn't support [[Loopback Device|loopback devices]] but there is an alternative available for Windows 7 users. |
It is a well known fact that Windows doesn't support [[Loopback Device|loopback devices]] but there is an alternative available for Windows 7 users. |
||
Windows 7 has a support for so called Virtual Hard Disks which are just plain bin files with data. |
Windows 7 has a support for so called Virtual Hard Disks which are just plain bin files with data. |
||
Line 46: | Line 48: | ||
[[Category:Disk Image Utilities]] |
[[Category:Disk Image Utilities]] |
||
[[Category:Windows]] |
Revision as of 23:41, 9 September 2018
Difficulty level |
---|
![]() Beginner |
It is a well known fact that Windows doesn't support loopback devices but there is an alternative available for Windows 7 users. Windows 7 has a support for so called Virtual Hard Disks which are just plain bin files with data. Windows 7 also includes the interface for creation and management of those VHD files.
Creating a VHD
To create a VHD you must first open the Computer Management window, which is most easily accessed by right clicking My Computer and selecting Manage.
http://i40.tinypic.com/favcj8.png
Then go to Storage - Disk Management.
http://i43.tinypic.com/2ywzk8h.png
Right clicking Disk Management and selecting Create VHD will guide you through the creation of a VHD file.
Attaching a VHD
By right clicking Disk Management, and selecting Attach VHD, you can attach any VHD ( Possibly any binary file) and mount it to a specific drive.
Use
You can setup your IDE ( I have used Visual Studio) to automatically detach a VHD after compilation and run the OS in a emulator, such as QEMU. Here is how you can achieve such behavior.
Windows contains a command line program called diskpart which is used for mounting of the VHDs, but you need to supply a script for it in order to work.
c:\os\harddrive.vhd shows the location of the VHD file used.
Script for attaching (Saved as VHDScriptAttach.txt) :
select vdisk file=c:\os\harddrive.vhd attach vdisk
Script for detaching (Saved as VHDScriptDetach.txt) :
select vdisk file=c:\os\harddrive.vhd detach vdisk
After that you need to setup your IDE/Compiler to run this batch script after compilation/on debug.
diskpart -s VHDScriptDetach.txt qemu.exe -hda C:\OS\Harddrive.vhd diskpart -s VHDScriptAttach.txt