joncampbell123 / dosbox-x

DOSBox-X fork of the DOSBox project
GNU General Public License v2.0
2.53k stars 371 forks source link

DBX not mounting Windows created VHDs of 8,16,24,32,40, and 48MB? #4958

Closed italiangrandma closed 2 months ago

italiangrandma commented 2 months ago

Describe the bug

Title. If I create VHDs with sizes of either 8,16,24,32,40, or 48MB, DBX will not mount the VHD and gives an error of "Cannot create drive from file."

Steps to reproduce the behaviour

  1. Go to Windows Disk Management > Action > Create VHD
  2. Create a VHD with a size of 8,16,24,32,40, or 48MB, set to VHD and Fixed Size
  3. Initialize the drive as MBR
  4. Create a new simple volume, assign a drive letter, and do a quick format
  5. Unmount the drive from Windows
  6. Go to dosbox-x and type "imgmount [driveletter] path/to/my.vhd -t hdd"

DBX will echo a message of "Cannot create drive from file."

Expected behavior

The expected behavior is that DBX mounts the VHD to your chosen drive letter.

What operating system(s) this bug have occurred on?

WIndows 10 Pro 22H2

What version(s) of DOSBox-X have this bug?

2024.03.01

Used configuration

No response

Output log

No response

Additional information

No response

Have you checked that no similar bug report(s) exist?

Code of Conduct & Contributing Guidelines

maxpat78 commented 2 months ago

@italiangrandma I'll check it.

@joncampbell123 Note from console LOG:

LOG: VHD DEBUG: part. CHS=(0,2,3) - LBA=36864, heads=228, sectors=35
LOG: CHS and LBA partition start differ, choosing LBA
LOG: VHD image detected SS,S,H,C: 512,35,228,2
LOG: VHD is a fixed image
LOG: FAT: Partition type is MBR (IBM PC)
LOG: Release
LOG: drive_fat.cpp: Sanity checks failed

It seemed to me that the weird thing of sanity checks was circumvented some times ago... perhaps some sort of regression?

maxpat78 commented 2 months ago

image

maxpat78 commented 2 months ago

IMGMAKE fixed.vhd -t hd -size 8 in DosBox-X gives good results (a different CHS geometry is applied).