QubesOS / qubes-issues

The Qubes OS Project issue tracker
https://www.qubes-os.org/doc/issue-tracking/
541 stars 48 forks source link

Can't install windows 7 (BSOD 0x0000007E) #6084

Open d2po opened 4 years ago

d2po commented 4 years ago

Qubes OS version R4.0

Affected component(s) or functionality Installation of windows 7

Brief summary When I try installing windows 7, I get a BSOD.

When using a system install disk that came with an older computer, I am able to run through the first phase of the installation where the files are initially loaded onto the hard drive, but the second boot from the hard drive fails with this error.

When I boot directly from the iso downloaded from microsoft, I get this error on the first attempt at booting.

To Reproduce

Steps to reproduce the behavior:

  1. qvm-create --class StandaloneVM --label red --property virtmode=hvm win7
  2. qvm-prefs win7 memory 8192
  3. qvm-prefs win7 maxmem 0
  4. qvm-prefs win7 kernel ""
  5. qvm-prefs win7 qrexec_timeout 300
  6. qvm-features win7 video-model cirrus
  7. qvm-volume extend win7:root 30GiB
  8. qvm-prefs win7 netvm ""
  9. qvm-start --cdrom "untrusted:/home/user/Downloads/win7x64-ultimate.iso"

Expected behavior A bootable windows system.

Actual behavior BSOD with stop error:

0x0000007E (0xFFFFFFFFC0000005,0xFFFFF8000D382295,0xFFFFF880009A9678,0xFFFFF880009A8ED0)
It does not mention a .sys file or a human readable error code.

output of guest-win7-dm.log (during the crash):

dumping mfns: n=301, w=640, h=480
configure msg, x/y 1400 505 (was 1400 505), w/h 1024 768
Issued domain 34 reboot

entire logs: https://pastebin.pl/view/f4b8d1a9

Additional context

Solutions you've tried

Relevant documentation you've consulted

Related, non-duplicate issues none

easydozen commented 4 years ago

qemu: pin_memory_cacheattr failed: Operation not permitted

Maybe, something memory related. Have you tried to attach iso from dom0? qvm-start --cdrom "dom0:/home/user/Downloads/win7x64-ultimate.iso"

iamahuman commented 4 years ago

If you do not mind disclosing your hardware and Windows installation (plus possibly some configuration data), you can post the MEMORY.DMP crash dump file from Windows so that the crash can be analysed.

GWeck commented 4 years ago

Did you disable memory balancing?

qvm-prefs win7 maxmem 8192

That seems to be more plausible than 0, as memory balancing does not work well with Windos.

iamahuman commented 4 years ago

@GWeck I'm afraid it may not make any difference, since setting maxmem=0 is the same as setting memory and maxmem to the same value from the hypervisor's point of view. maxmem=0 also disables the meminfo-writer service request to the VM as well (although this is unlikely to make a difference in a Windows VM unless Qubes Windows Tools is installed, since this is specific to Qubes). You can observe this behaviour by unchecking the "Include in memory balancing" checkbox in Qubes Manager for a VM, and querying its property. This should really be documented somewhere, though.

d2po commented 4 years ago

I did maxmem=0. I also noticed that this didn't uncheck the box in the GUI when I went in there to check the settings (not sure if it was working anyways) so I unchecked it and tried again (forgot to add that part to the repro steps)

zellchristensen commented 4 years ago

@d2po It might be an issue with Windows 7 and hardware support with some of your newest hardware. Usually a WindowsVM in Qubes will show the actual CPU information, and I don't think Ryzen 9 is officially supported. I don't know if there's any other hardware that's passed through directly by default. Are you sharing any additional Devices in the Devices list?

Alternatively, maybe an issue with an OEM install disc expecting certain devices or lacking drivers for something. Which official ISO did you try from Microsoft?

I tried with an unofficial (or possibly corrupted) win7 Ultimate ISO and couldn't even get through installation, but I have no problems installing with a MSDN ISO, "en_windows_7_ultimate_with_sp1_x64_dvd_u_677332.iso" ( MD5:C9F7ECB768ACB82DAACF5030E14B271E SHA1:36AE90DEFBAD9D9539E649B193AE573B77A71C83 ) on an older Intel i5 laptop with only 512mb of Memory allocated. Works alright with 1 or 2 VCPUs. I did not change qrexec_timeout or do anything via the terminal/command line.

Screenshot_2020-09-24_03-19-33 Screenshot_2020-09-24_03-19-58

d2po commented 4 years ago

Still working on retrieving a MEMORY.DMP file. My understanding is I need to extract this from the page file. I've got a working windows 10 VM up, so going to give this a shot today.

When booting direct from the ISO, I'm using the one shown here: https://github.com/elliotkillick/qvm-create-windows-qube/blob/master/windows-media/isos/download-windows.sh#L107

The OEM disc allows me to at least get a system installed to disk, which I think is a prereq for getting a memory dump on the disk (unless there's some trick to getting the install disc to dump memory to disk when crashing on initial boot). Hopefully this crash is caused by the same thing in both cases though.

zellchristensen commented 4 years ago

@d2po Using that ISO file you linked, 7601.24214.180801-1700.win7sp1_ldr_escrow_CLIENT_ULTIMATE_x64FRE_en-us.iso ( MD5:8CE237E3D43CCFB41BFE32CCD4420E10 SHA1:7CC76B0015220DE956328FB934D61B710A94293D ) I was able to successfully install Win7 in a Qube with the same settings as the photos I posted earlier, 2048/20480 private/system storage, 512mb memory, I notice it uses a lot more storage space than the other ISO and has a LOT of windows updates installed by default.

Make sure you have memory balancing UNCHECKED or you can keep it checked but make sure both Minimum and Maximum Memory are equal. Having Memory Balancing CHECKED with the values different would always give me problems and cause a Qube to not even be able to start. Installing the Windows Tools causes the option to become checked automatically after a successful start and reboot (See https://github.com/QubesOS/qubes-issues/issues/6065 ).

Otherwise, it may just be an issue with Ryzen 9 and Win7, but I have no way to test that at the moment.

d2po commented 4 years ago

When I take the memory that low, I get:

IRQL_NOT_LESS_OR_EQUAL STOP: 0x0000000A (0x20,0x2,0x0,0xFFFFF80002721800)

If it is expected to be able to boot windows 7 with the memory this low, it might be useful to work around this IRQL issue. I'm currently blocked on getting a MEMORY.DMP because my memory size is larger than the 512MB swap file that I have on this half-installed system, so I think the dump is getting truncated.

What are the options for live-debugging while booting?

d2po commented 4 years ago

Going to try to boot this ISO onto the bare metal to see if the issue is between win7 and the Ryzen 9 with virtualization turned on, will update later when I find out.

d2po commented 4 years ago

The MS ISO that crashes on initial boot in qubes was able to boot and show the language selection on the machine itself. I also tried booting the system from an iso on the dom0 filesystem as mentioned by @easydozen but I get the same crash as I do when the file is inside of another qube.

kenleejl commented 1 year ago

Hi there any updates? I face the same issue!