VHD works on MiSTer, but can't be mounted on my PC?

scott64
Posts: 6
Joined: Mon Sep 20, 2021 6:13 am
Has thanked: 1 time

VHD works on MiSTer, but can't be mounted on my PC?

Unread post by scott64 »

I'm using the 'MiSTer AO486 Win98 SE VHD' uploaded by fpgafan. It works great, and comes setup with drivers and such. The problem is, my Windows 10 PC is unable to mount it, I get an error that says 'the disc image file is corrupted'. This is a problem because I want to increase the size of the VHD. Windows Disk Management can't open it either. In fact, the only way I can open it on my PC is using 7zip. But 7zip can't resize it.

All of the VHDs uploaded by fpgafan seem to have this problem. I don't know if they're some unusual format or something. Has anyone else had this issue with these VHDs? Is there a program out there capable of resizing them?
Stupid Dufus
Posts: 152
Joined: Sun Aug 30, 2020 12:04 am
Has thanked: 87 times
Been thanked: 46 times

Re: VHD works on MiSTer, but can't be mounted on my PC?

Unread post by Stupid Dufus »

Can confirm the issue.

Just tried the mount the W98SE VHD in Win10 and got the game error message. Tried mounting it by double clicking the icon as well as attaching it through Windows Disk Management. No luck.

Other VHDs I have work fine. No idea what's causing the issue.
witinhalf
Posts: 14
Joined: Thu Jan 28, 2021 12:31 am
Has thanked: 11 times
Been thanked: 5 times

Re: VHD works on MiSTer, but can't be mounted on my PC?

Unread post by witinhalf »

I tried to inspect a fpgafan vhd in Hyper-V and I get errors as well. I don't have time to try, but you could use a hex editor and compare the headers and footers of a mountable vhd to a fpgafan vhd. I'm guessing that the mister might skip some of the header when mounting.
jca
Top Contributor
Posts: 1911
Joined: Wed May 27, 2020 1:59 pm
Has thanked: 145 times
Been thanked: 454 times

Re: VHD works on MiSTer, but can't be mounted on my PC?

Unread post by jca »

What do you call headers and footers for a VHD? It is just a raw disk image.
zakk4223
Posts: 270
Joined: Sun May 24, 2020 10:55 pm
Been thanked: 107 times

Re: VHD works on MiSTer, but can't be mounted on my PC?

Unread post by zakk4223 »

jca wrote: Mon Sep 20, 2021 6:52 pm What do you call headers and footers for a VHD? It is just a raw disk image.
There's a 512-byte footer that contains some meta data and the geometry of the virtual disk.
Bas
Top Contributor
Posts: 518
Joined: Fri Jan 22, 2021 4:36 pm
Has thanked: 60 times
Been thanked: 225 times

Re: VHD works on MiSTer, but can't be mounted on my PC?

Unread post by Bas »

Maybe gparted will work? It's free from gparted.org and runs on Windows, Mac and Linux. I'm just not sure if it'll work on image files like VHD.
witinhalf
Posts: 14
Joined: Thu Jan 28, 2021 12:31 am
Has thanked: 11 times
Been thanked: 5 times

Re: VHD works on MiSTer, but can't be mounted on my PC?

Unread post by witinhalf »

I use 010 Editor. It has a 30 day trial. Open a mountable vhd and compare it to one that won't mount. It makes me wonder if fpgafan used a compression tool or something.
jca
Top Contributor
Posts: 1911
Joined: Wed May 27, 2020 1:59 pm
Has thanked: 145 times
Been thanked: 454 times

Re: VHD works on MiSTer, but can't be mounted on my PC?

Unread post by jca »

This is really bizarre. I downloaded the 3 vhds from fpgafan. None can be attached under windows. I used HxD hex editor to have a look but it is difficult to see what is wrong without detailed analysis on what is in there. Searching the internet I found a few things:
Use Diskpart. It did not work, I guess Disk Management uses Diskpart so no surprise.
Use DISM. On Win7 DISM does not support mounting VHDs, I will have to try on Win10.
7zip can open VHDs. here I made some progress: I can open all 3. On osr2-300m and 98se I can see everything. On 95osr25 I only see a file named AOLCODE.AOL.
Next I did a quick and dirty job: I created a 400MB vhd and copied the contents of the osr2-300m 7zip archive to it. I am not close to my MISTer at the moment so I created a VirtualBox machine. When I tried to boot it it said BOOTMGR missing, but as I said it was a quick and dirty job. It looks like using 7zip could solve the problem.
scott64
Posts: 6
Joined: Mon Sep 20, 2021 6:13 am
Has thanked: 1 time

Re: VHD works on MiSTer, but can't be mounted on my PC?

Unread post by scott64 »

I also tried using 7zip to move the files onto a new VHD and couldn't get it to boot. This is a little outside of my expertise I'm afraid.
Solskogen
Posts: 89
Joined: Mon May 25, 2020 5:33 am
Has thanked: 11 times
Been thanked: 6 times

Re: VHD works on MiSTer, but can't be mounted on my PC?

Unread post by Solskogen »

Where's the VHD located? I was not able to mount the VHD when it was on the MiSTer, but I copied it to my PC and then back. All of a sudden I was able to mount it.
jca
Top Contributor
Posts: 1911
Joined: Wed May 27, 2020 1:59 pm
Has thanked: 145 times
Been thanked: 454 times

Re: VHD works on MiSTer, but can't be mounted on my PC?

Unread post by jca »

Solskogen wrote: Tue Sep 21, 2021 10:15 am Where's the VHD located? I was not able to mount the VHD when it was on the MiSTer, but I copied it to my PC and then back. All of a sudden I was able to mount it.
Are you using the fpgafan images? Contrary to what you experienced it seems that that these images can be mounted on MISTer but not attached under Windows.
In my case I can boot osr2-300m and 98se and I did not try 95osr25 but none of them can be attached under Windows.
witinhalf
Posts: 14
Joined: Thu Jan 28, 2021 12:31 am
Has thanked: 11 times
Been thanked: 5 times

Re: VHD works on MiSTer, but can't be mounted on my PC?

Unread post by witinhalf »

This topic really interests me. You can't just copy the files from one vhd to another and have it boot. The new vhd will not be setup to be bootable. The new vhd needs a mbr (master boot record). I won't be able to try anything until Wednesday or Thursday night. These are the steps I would try:
1. Create new VHD
2. Format the new VHD using fdisk. Do this with a Windows 98 boot disk. You could also use the Windows 98 wizard to format, you would just need to quit after the drive was done being formated. This could be done with the VHD mounted on the mister, but I would probably just use Virtualbox.
3. Test the new VHD on Windows 10. Does it mount?
4. Extract fpgafan VHD. Copy over all the files to the new VHD. Make sure hidden files are visible.
5. Test the new VHD on mister.
fraggore@sky.com
Posts: 43
Joined: Wed Feb 03, 2021 7:52 pm
Has thanked: 8 times
Been thanked: 7 times

Re: VHD works on MiSTer, but can't be mounted on my PC?

Unread post by fraggore@sky.com »

use Imdisk works with everything i had the same issue.
ash2fpga
Posts: 237
Joined: Tue May 26, 2020 6:20 pm
Has thanked: 62 times
Been thanked: 28 times

Re: VHD works on MiSTer, but can't be mounted on my PC?

Unread post by ash2fpga »

It looks like the vhd is 400mb, not 500mb as stated.

I tried creating a new 400mb vhd, then copying the footer from it and appending it to the 98se vhd. Windows didn't like it (much) either. It showed up as an uninitialized disk.
scott64
Posts: 6
Joined: Mon Sep 20, 2021 6:13 am
Has thanked: 1 time

Re: VHD works on MiSTer, but can't be mounted on my PC?

Unread post by scott64 »

So I tried downloading ImDisk. It does allow me to mount the VHDs in Windows but I can't seem to expand the VHD without reformatting it.. Am I overlooking something?

I tired expanding it to 7GB and moving all the files back onto it once it had been formatted but it doesn't work. AO486 hangs on 'Booting from Hard Disk'.
jca
Top Contributor
Posts: 1911
Joined: Wed May 27, 2020 1:59 pm
Has thanked: 145 times
Been thanked: 454 times

Re: VHD works on MiSTer, but can't be mounted on my PC?

Unread post by jca »

witinhalf wrote: Tue Sep 21, 2021 3:14 pm This topic really interests me. You can't just copy the files from one vhd to another and have it boot. The new vhd will not be setup to be bootable. The new vhd needs a mbr (master boot record). I won't be able to try anything until Wednesday or Thursday night. These are the steps I would try:
1. Create new VHD
2. Format the new VHD using fdisk. Do this with a Windows 98 boot disk. You could also use the Windows 98 wizard to format, you would just need to quit after the drive was done being formated. This could be done with the VHD mounted on the mister, but I would probably just use Virtualbox.
3. Test the new VHD on Windows 10. Does it mount?
4. Extract fpgafan VHD. Copy over all the files to the new VHD. Make sure hidden files are visible.
5. Test the new VHD on mister.
I agree with you that we have to do magic for it to work. Regarding what I did:
My first try was a quick and dirty job as I said and I did not really expect it to work without more tweaking. When I created the vhd I used Disk Management from Win7 and selected MBR, simple volume and activated the partition. I realized I made a big mistake: when I formatted it I just clicked OK and it formatted it in NTFS. I redid it, without much expectation, using FAT16. Now I get "Remove all disks and press the space bar to restart" like in the old days when you tried to boot and a data floppy was left in the drive. The problem is that everything is setup correctly except the boot-loader does not know what to boot. I don't remember if there was some kind of repair tools for Win95.
Next I tried, without much expectation, a variation of the method you describe as it uses retro tools, not the modern tools which ditched WIN95 a long time ago.
I based it on osr2-300m.vhd to create a 400MB disk as the initial post indicated that the goal was to increase the size of the disk. I mounted osr2-300m.vhd as disk 0 and the new vhd as disk 1. After booting I opened a DOS window, used fdisk to create one partition, rebooted to be able to format the drive. I could not set the partition as active as the c: partition is already active so I did it by booting a DOS6.22 floppy. Next I wanted to copy all files from C:\ to D:\. I could not use XCOPY from the DOS floppy as it does not support /H like in XCOPY C:\ D:\ /S /H. I had to do it from WIN95 (or WIN98) but using a different boot disk so as not trying to copy open files.
98se.vhd as drive 0, osr2-300m.vhd as drive 1 and the new vhd as drive 3. XCOPY D:\ E:\ /S /H.
As expected the resulting drive does not boot so we have to find a way to repair the drive. I wonder if by first making a basic installation of WIN95 on the drive and overwriting it with the same XCOPY procedure would work.

I also noted 2 things when doing this:
I was unable to unmount the floppy, backspace did not seem to work.
In also tried to reset the configuration in the OSD but the drives were still there.
witinhalf
Posts: 14
Joined: Thu Jan 28, 2021 12:31 am
Has thanked: 11 times
Been thanked: 5 times

Re: VHD works on MiSTer, but can't be mounted on my PC?

Unread post by witinhalf »

I got it to work last night.
1. Created a new VHD on Windows 10.
2. Copied the new VHD to the mister.
3. Copied Window98 ISO and boot floppy IMG to mister. I got them from WinWorldPC.
4. Mounted the new VHD, win98 ISO and win98 boot floppy IMG.
5. Reset ao486. Booted into win98 installer. Formatted the new VHD with the installer. Quit installer during the scan disk process. I stopped the scan disk because I did not want the installer to start copying over Windows 98 files.
6. Copied the new VHD back to WIndows 10.
7. Mounted both the new VHD and the fpgafan VHD with imDIsk.
8. In Windows I had to make two changes for viewing files in File Explorer. I had to show hidden files and not hide system files.
9. Copied all the files from the fpgafan VHD to the new VHD.
10. Copied the new VHD back to the mister. Unmounted everything but the new VHD.
11. Reset ao486 and it booted just fine.

I also tested the new VHD again in Windows 10. It mounts just fine in Disk Management and Hyper-V.
jca
Top Contributor
Posts: 1911
Joined: Wed May 27, 2020 1:59 pm
Has thanked: 145 times
Been thanked: 454 times

Re: VHD works on MiSTer, but can't be mounted on my PC?

Unread post by jca »

Congrats and thanks.
So when I said "I wonder if by first making a basic installation of WIN95 on the drive and overwriting it with the same XCOPY procedure would work." was not far off as you did not even did a basic install, just started it and ended it up during the scan disk.
jca
Top Contributor
Posts: 1911
Joined: Wed May 27, 2020 1:59 pm
Has thanked: 145 times
Been thanked: 454 times

Re: VHD works on MiSTer, but can't be mounted on my PC?

Unread post by jca »

@ witinhalf
Do you use a boot floppy because the CD is not bootable, MISTer cannot boot from CDs or any other reason?
witinhalf
Posts: 14
Joined: Thu Jan 28, 2021 12:31 am
Has thanked: 11 times
Been thanked: 5 times

Re: VHD works on MiSTer, but can't be mounted on my PC?

Unread post by witinhalf »

My Windows 98 ISO did not boot without the boot floppy.
scott64
Posts: 6
Joined: Mon Sep 20, 2021 6:13 am
Has thanked: 1 time

Re: VHD works on MiSTer, but can't be mounted on my PC?

Unread post by scott64 »

I finally got around to trying the windows 98 iso/boot disk method and it worked perfectly. :mrgreen:
Post Reply