A utility to mount hard disk and optical disc images in DOSBox.
Note: You can use Disk Explorer to copy files and folders to/from images (but not to delete them or DOSBox will consider the images corrupted! Read the aforementioned link for more info).
- 1 Command line parameters
- 2 Optical disc images
- 3 Hard disk images
Command line parameters
IMGMOUNT DRIVE [imagefile] -t [image_type] -fs [image_format]
-size [sectorsbytesize, sectorsperhead, heads, cylinders -u DRIVE]
- Drive name (letter) the image will use
- a for the drive letter a:\ or
- b for the drive letter b:\ etc...
- Location of the image files to mount in DOSBox. The location can be on a mounted drive inside DOSBox, or on your real disk. It is possible to mount multiple (e.g.
"~/images/CD1.cue ~/images/CD2.cue [...] ~images/CDn.cue") optical disc images (ISOs or CUE/BIN) as well, if you need CD swapping capabilities specify all images in succession. The CDs can be swapped with CTRL-F4 at any time.
- The following are valid image types:
- Specifies a floppy image or images. DOSBox will automatically identify the disk geometry (360K, 1.2MB, 720K, 1.44MB, etc).
- Specifies an optical disc iso image. The geometry is automatic and set for this size. This can be an iso or a cue/bin.
- Specifies a hard disk image. The proper CHS geometry must be set for this to work.
- The following are valid file system formats:
- Specifies the ISO 9660 optical disc format.
- Specifies that the image uses the FAT file system. DOSBox will attempt to mount this image as a drive in DOSBox and make the files available from inside DOSBox.
- DOSBox will make no attempt to read the file system on the disk. This is useful if you need to format it or if you want to boot the disk using the BOOT command. When using the "none" filesystem, you must specify the drive number (2 or 3, where 2=master, 3=slave) rather than a drive letter. For example, to mount a 70MB image as the slave drive device, you would type:
"imgmount 3 d:\test.img -size 512,63,16,142 -fs none"(without the quotes). Compare this with a mount to read the drive in DOSBox, which would read as:
"imgmount e: d:\test.img -size 512,63,16,142".
- The Cylinders, Heads and Sectors specification of the drive. Only required to to create bootable hard disk images. This means it is not required for either loading a regular hard disk image or optical disc images.
- unmount an image.
- e.g. if an disk image was mounted to be the disk drive a:\ type:
"imgmount -u a"
Optical disc images
Loading an ISO image
An example in Windows
Z:>mount c "c:\images" Z:>imgmount d "C:\MyISO.iso" -t iso Z:>d: D:>
Other example in Windows (more than one image)
Z:>mount c "c:\images" Z:>imgmount d c:\mr2_cd1.iso c:\mr2_cd2.iso -t iso Z:>d: D:>
An example in Unix
Z:>mount c "/tmp" Z:>imgmount d "/tmp/MyISO.iso" -t iso Z:>d: D:>
Loading a CUE image
An example in Windows
Z:>mount c "c:\images" Z:>imgmount d "C:\cdimg.cue" -t iso -fs iso Z:>d: D:>
An example in Unix
Z:>mount c "/tmp" Z:>imgmount d "/tmp/cdimg.cue" -t iso -fs iso Z:>d: D:>
Note: make sure to use CUE and not BIN for Mixed Mode CDs
You can mount bin/cue type CD images with the imgmount command, and it will 'sort of' work if you specify the .bin file as the file to mount. However, it will not mount the audio tracks of the CD correctly if you do this. Specifying the associated .cue file will load all tracks correctly.
Hard disk images
The "-size" parameter (required to to create bootable hard disk images)
Didn't understand the "512,63,16,142" part?
All you really need to know is that the formula is always:
X is the number of "cylinders" in the image. It's based on the image's size. If you create the image through Bochs, then it would tell you the number of cylinders.
If you want to understand a little more, here's a more detailed explanation than the official one on the numbers.
Now, let's say you created a 70M image using the bximage program from Bochs. You will then get the following details:
I:> bximage.exe ======================================================================== bximage Disk Image Creation Tool for Bochs $Id: bximage.c,v 1.32 2006/06/16 07:29:33 vruppert Exp $ ====Example==== <pre> Z:>mount d c:\images Z:>d: D:>imgmount c "70mb.img"
Loading a regular hard disk image
Z:>mount d c:\images Z:>d: D:>imgmount c "70mb.img"
Bootable hard disk images
Format the partition with "format"
Start DOSBox again and type:
Z:>mount d c:\images Z:>d: D:>imgmount 2 "70mb.img" -size 512,63,16,142 -t hdd -fs none D:>boot "msdos622.img" (Opening and booting from image file: msdos622.img) ... A:\>format c: /s
The hard disk image is now bootable! See Loading a bootable hard disk image.
Loading a bootable hard disk image
From now on, whenever you want to boot from drive C:, start DOSBox and type, for example:
Z:>mount d c:\images Z:>d: D:>imgmount c "70mb.img" D:>boot -l c (Opening and directly booting from image file: 70mb.img) C:>