What Bad Toro said will work, with some changes. First, forget about how to create the image, that's not important here. The mount command is what is important. The problem is that the offset for the mount command can be different depending on how the VHD file was partitioned to start with.
To find out which offset, first run:
Code: Select all
fdisk -l /media/fat/games/MSX/boot.vhd
For me it outputs:
Code: Select all
Disk /media/fat/games/MSX/boot.vhd: 2 GiB, 2147484160 bytes, 4194305 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0xebd96125
Device Boot Start End Sectors Size Id Type
/media/fat/games/MSX/boot.vhd1 128 4188287 4188160 2G e W95 FAT16 (LBA
From that output, there are only two parts that are important for us. One is where it says: "Units: sectors of 1 * 512 =
512 bytes" - that tells you that each unit listed is 512 bytes. The other is under "Start", which says "
128". You have to multiply these two quantities, in this case 512 and 128, which results in 65536. Therefore, in this case the offset should be 65536 and the mount command should be:
Code: Select all
mount -o loop,offset=65536 /media/fat/games/MSX/boot.vhd /mnt/
That 65536 is valid for that image, therefore you don't have to run fdisk -l every time, just the mount command with the right offset (using the numbers you've found with fdisk) when you begin, and the umount command when you finish.
Very important: Do not forget to run 'umount /mnt' before starting the core. You could damage the VHD otherwise.