copy / v86

x86 PC emulator and x86-to-wasm JIT, running in the browser
https://copy.sh/v86/
BSD 2-Clause "Simplified" License
19.38k stars 1.34k forks source link

QEMU config for Windows 98 that will work with v86? #945

Open ericmackrodt opened 7 months ago

ericmackrodt commented 7 months ago

Hello, I've been playing with v86 on a website I'm building and I was using the images from the oldweb.today. Those were working well while loading the state, but I couldn't boot them without the state file.

So I tried to start my own installation of windows 98 from scratch on qemu.

So I created a hard disk image like this: qemu-img create -f qcow2 win98.img 2G

Then I ran the vm like this and installed Windows 98 (originally using drive d to boot):

qemu-system-i386 -cpu pentium3 -m 256 -drive file=win98.img,format=qcow2,media=disk,cache=directsync -drive file=(win98iso).iso,media=cdrom -boot c -soundhw sb16 -device ne2k_pci,netdev=net0 -netdev user,id=net0 -vga std -k en-us -drive file="[path to]/vmdisp9x-1.2023.0.24-driver-only.ima",index=0,if=floppy,format=raw -monitor stdio

After windows was installed, I converted the image to raw like this:

qemu-img convert -f qcow2 -O raw win98.img win98raw.img

Then I went on v86 on my page and tried to boot this image using settings similar to the ones from the oldweb.today and the machine started to boot, I even saw the windows splash screen.

But then the machine hung forever. Same as when I tried to use the oldweb.today image without the saved state.

Does anyone know how I can get Windows 98 booting properly? Are there maybe settings for qemu that make the emulated computer more smiliar to v86 so when I transfer the image it works?

I want to eventually run Windows 98 with backups of ISOs from cd-roms that used to come with magazines. But I need to be able to boot the system first.

I really appreciate any help I can get!

spetterman66 commented 7 months ago

Hello! You could probably use an ISO disk image from https://winworldpc.com. Download at https://winworldpc.com/product/windows-98/98-second-edition. Use this ISO disk image to install Windows 98 in QEMU. Command line would be qemu-system-i386 -cpu pentium -m 256 -hda win98.img -cdrom win98.iso -device newk_pci,netdev=net0 -netdev user,id=net0 -k en-us

ericmackrodt commented 7 months ago

It booted, I managed to get to the desktop. Thank you so much!

I had to change the newk_pci to ne2k_pci, I assume that was a typo?

Now, do you happen to know why I get this error during startup?

Screen Shot 2023-11-22 at 11 01 25 pm

It doesn't seem to affect anything, but it would be nice not to get it.

Anyway, now I need to install the video, the network drivers and see if I can load states with different cd rom images loaded.

ericmackrodt commented 7 months ago

Hmm, strange, it doesn't seem to boot when add the cdrom setting, if I comment it out it boots.

Screen Shot 2023-11-22 at 11 13 54 pm
spetterman66 commented 7 months ago

Make use of these video drivers for high-resolution video on your emulated Windows 98 configuration in Virtual x86: https://bearwindows.zcm.com.au/vbe9x.htm

markostamcar commented 7 months ago

@ericmackrodt This is a known issue, see #225. Progress towards fixing it is being done with #900.

ericmackrodt commented 7 months ago

Hi @markostamcar , thanks for the answer. Yeah, sadly this issue is a blocker for my project. I tried to build this branch: https://github.com/copy/v86/pull/901

But I had no luck. I left a comment there and I wish I could fix this issue but that goes a bit beyond my skill level. Hopefully the author of that PR will finish that work at some point.

copy commented 3 months ago

For what it's worth, the bluescreen is a known issue that has been around for a long time. Several years ago, I spend a few days debugging it and couldn't figured it out.

For my the windows98 state image on the website I reboot until it works, and then save the state.