Arch Linux - Qemu not booting WinXP with PCI Passthrough

Page 1 of 1 [ 7 posts ] 

dcj123
Veteran
Veteran

User avatar

Joined: 2 Sep 2009
Gender: Male
Posts: 10,796

26 Jan 2016, 10:53 am

Hey guys,

For some reason Qemu is not working with Windows XP on my host Arch Linux system, I can't seem to boot off an iso and I have a feeling the solution is very simple but I can't see it. First off I am booting my VMs using commands much like the one found on the Arch Linux's Wiki. The problem is while its suppose to boot off the cd I get the UEFI Interactive Shell and can't boot into anything. I suppose the obvious question is can you boot into Windows XP with UEFI?

Anyway here is the command I launching with,

Code:
qemu-system-i386 -enable-kvm -m 2048 -cpu host,kvm=off -smp cores=4 -device vfio-pci,host=09:00.0 -device vfio-pci,host=00:12.0 -drive if=pflash,format=raw,readonly,file=/usr/share/edk2.git/ovmf-x64/OVMF_CODE-pure-efi.fd -drive if=pflash,format=raw,file=/tmp/my_vars.fd -soundhw ac97 -cdrom ~/Windows\ XP/WinXP.iso -hda windowsxp.qcow


I'll explain this the best I can,

m 2048 - gives the VM 2GB of ram
cpu host - emulates my native CPU
kvm=off - fixes a bug Nvidia has with PCI Passthrough
smp cores=4 - number of cores emulated
device vfio-pci,host=09:00.0 - Passthrough of my graphics card
device vfio-pci,host=00:12.0 - Passthrough of a USB controller
drive if=pflash,format=raw,readonly,file=/usr/share/edk2.git/ovmf-x64/OVMF_CODE-pure-efi.fd - my bios file
drive if=pflash,format=raw,file=/tmp/my_vars.fd - This is the only thing I am not sure on, I am following the wiki here
soundhw ac97 - Sound driver
cdrom ~/Windows\ XP/WinXP.iso - Windows XP image
hda windowsxp.qcow - Path to virtual hard drive

So this command should boot into Windows XP's installer but instead I get this

Image

I am booting Windows 10 just fine with this command, and installed it by adding -cdrom /path/to/file as well, why is one working and not the other?

Code:
qemu-system-x86_64 -enable-kvm -m 16384 -cpu host,kvm=off -smp cores=7 -device vfio-pci,host=09:00.0 -device vfio-pci,host=00:12.0 -drive if=pflash,format=raw,readonly,file=/usr/share/edk2.git/ovmf-x64/OVMF_CODE-pure-efi.fd -drive if=pflash,format=raw,file=/tmp/my_vars.fd -soundhw ac97 -hda windows10.qcow



Edenthiel
Veteran
Veteran

User avatar

Joined: 12 Sep 2014
Age: 56
Gender: Female
Posts: 2,820
Location: S.F Bay Area

27 Jan 2016, 7:07 pm

From MS:
"Given the advent of mainstream 64-bit computing and the platform costs previously discussed, Microsoft determined that vendors would not have any interest in producing native UEFI 32-bit firmware. Microsoft has therefore chosen to not ship support for 32-bit UEFI implementations."

So, assuming 32-bit WinXP, I'd say it won't work (IIR, the 64-bit won't either, but I've not tried it. I just changed the BIOS to MBR on physical machines some years back).

However, it should work if you can set QEMU to use a MBR (non-UEFI) firmware image (ie system BIOS) as QEMU had no problem running XP before UEFI was introduced.

Update: using an old pre-UEFI version of QEMU, I just booted an XP .ISO and a Win3.11WFW HDD image on a UEFI machine. So one way or another, it is doable.

Update #2 Also, this from the Ubuntu forums:

"qemu is packaged with seabios which is "non uefi" as in Legacy BIOS.
http://www.seabios.org/SeaBIOS "

That last might do the trick?


_________________
“For small creatures such as we the vastness is bearable only through love.”
―Carl Sagan


dcj123
Veteran
Veteran

User avatar

Joined: 2 Sep 2009
Gender: Male
Posts: 10,796

27 Jan 2016, 7:55 pm

So it turns out that all I had to do was remove

Code:
-drive if=pflash,format=raw,readonly,file=/usr/share/edk2.git/ovmf-x64/OVMF_CODE-pure-efi.fd -drive if=pflash,format=raw,file=/tmp/my_vars.fd


from the command line and it booted straight into this,

Image

However since UEFI is used in the PCI Passthrough wiki page on Arch Linux's main web site, I don't know if the devices that I have pass through to the guest will work. I don't know if the wiki paged used UEFI because thats the stranded now or if its needed for PCI passthough. I admit I feel a bit dumb for not seeing the 64-bit bios on qemu-system-i386 :roll:

Thanks for the information though, you have at least got the ship sailing but I don't know if hardware passthrough will work.



dcj123
Veteran
Veteran

User avatar

Joined: 2 Sep 2009
Gender: Male
Posts: 10,796

27 Jan 2016, 10:22 pm

Ok....

I am obviously not thinking this through clearly, I don't know why I thought a Geforce 980 would work on Windows XP. What I am trying to do is run old 16-bit code that are not dos executables. Would a 32-bit version of Windows 7 or 10 accomplish this? I am thinking that Windows XP might be too old for my needs.



Edenthiel
Veteran
Veteran

User avatar

Joined: 12 Sep 2014
Age: 56
Gender: Female
Posts: 2,820
Location: S.F Bay Area

27 Jan 2016, 11:10 pm

16-bit support was dropped with the move to 64-bit Windows. 32-bit versions of Windows OS (desktop) through 8 & 32-bit Windows Server through 2008 can run 16-executables (including Windows 3.0 Program Manager, as I recently discovered), however it does so using a virtual machine (see thunking, shims & Windows on windows, or "WOW").

What sort of code are you trying to run, please, and what OS's do you have at your disposal?


_________________
“For small creatures such as we the vastness is bearable only through love.”
―Carl Sagan


dcj123
Veteran
Veteran

User avatar

Joined: 2 Sep 2009
Gender: Male
Posts: 10,796

28 Jan 2016, 12:21 am

Various 16-bit games I suppose, namely exile here. Their web site says it will work on 32-bit Windows 7 but I was wanting to run other 16 bit apps and games so I might shoot for a windows 95 install and just emulate the processor and video card instead of using native hardware. Everything I plan to run is old enough that might work, I am also going to try wine and just use that if it works.

I have

Windows 95
Windows XP
Windows 7 64-bit
Windows 10 (Upgrade only)



dcj123
Veteran
Veteran

User avatar

Joined: 2 Sep 2009
Gender: Male
Posts: 10,796

28 Jan 2016, 12:54 am

Okay I think wine will work actually, no problems yet though I dislike wine due to its numerous bugs.

Image