Qemu the right way.
I have been using Qemu in the past about 8 years ago or so to run legacy windows software.
I installed the latest qemu and noticed a lot changed and cant find conclusive answers online.
I am writing this post to find what is the right way to start to set up qemu with a windows 7 pro guest. I want to try and eliminate the iterations and find out what is really possible for the guest.
Hardware used"
24 Core AMD rackserver.
Host OS Debian 9 Stretch
Guest Windows 7 Pro 32 bit
Requirements:
1) I need to be able to run at least 4 processors in the guest. Is this possible with qemu as hosts ?
2) I need to at least have sound working from applications in the guest with pulseaudio on the Debian host. Is it possible ?
3) USB, what is the level of support 2.0 3.0 ?
( However windo$ 7 cannot really do USB3. so usb-3 is moot anyway)
4) What kind of devices can be run through usb ?
The answers to 1-4 will be really helpful to decide if I should even be using it. The documentation is schetchy about all this.
I tried Virtualbox, but it is just a nice looking empty promisebox yielding nothing. Since Qemu helped me a lot in the past I will have better chances here.
5) I am currently installing win7pro guest with command $] qemu-system-x86_64 -boot c -cdrom /dev/cdrom -m 2048M
and left out all the network card and sound driver switches as I have no clue what I should choose. Can they be configured afterwards ?
Thanks
Quoted 10 lines · On 2018-12-25 23:46, [email protected] wrote:
I have been using Qemu in the past about 8 years ago or so to run legacy windows software.
I installed the latest qemu and noticed a lot changed and cant find conclusive answers online.
I am writing this post to find what is the right way to start to set up qemu with a windows 7 pro guest. I want to try and eliminate the iterations and find out what is really possible for the guest.
Quoted 8 lines
Hardware used"
24 Core AMD rackserver.
Host OS Debian 9 Stretch
Guest Windows 7 Pro 32 bitRequirements:
1) I need to be able to run at least 4 processors in the guest. Is this possible with qemu as hosts ?
Try to run QEMU with "-smp 4".
Quoted 2 lines
2) I need to at least have sound working from applications in the guest with pulseaudio on the Debian host. Is it possible ?
Should be possible. Run the configure script before compiling with
--audio-drv-list=pa
and then make sure to give a soundcard to the guest (e.g. with the -soundhw option).
Quoted 2 lines
3) USB, what is the level of support 2.0 3.0 ?
( However windo$ 7 cannot really do USB3. so usb-3 is moot anyway)
QEMU supports both, e.g. with "-device usb-ehci" for a USB 2.0 controller or with "-device nec-usb-xhci" for a USB 3.0 controller.
Quoted 1 line
4) What kind of devices can be run through usb ?
Do you mean emulated devices? You can get a list with:
qemu-system-x86_64 -device help | grep usb
Or do you want to pass-through a real device from the host?
Quoted 6 lines
The answers to 1-4 will be really helpful to decide if I should even be using it. The documentation is schetchy about all this.
I tried Virtualbox, but it is just a nice looking empty promisebox yielding nothing. Since Qemu helped me a lot in the past I will have better chances here.
Quoted 6 lines
5) I am currently installing win7pro guest with command $] qemu-system-x86_64 -boot c -cdrom
/dev/cdrom-m 2048Mand left out all the network card and sound driver switches as I have no clue what I should choose.
Can they be configured afterwards ?
I don't have much clue about Windows, but I think you can change it afterwards - it's like you're changing PCI cards of a real system in that case.
HTH,
Thomas
Quoted 4 lines
Try to run QEMU with "-smp 4".
Thomas thank you for your reply.
I will try each of your suggestions in turn.
-smp 4 did help and this time i could configure 2 cpus in windows.
Now for a very important question.
If hardware virtualization was not switched on in bios will qemu refuse to create more cpus? I just want to know if there are not bogus software cpus or cores created by qemu and that it actually checks it can get real cores from the machine and make it available to the host.
Second question. In the past qemu was lightning fast. However with this newer qemu windows 7 is very slow. It takes about 1 minute to open an application. What can slow it dow so much ? This happens with or without the smp switch. It seems there is some polling botlleneck if i move the mouse in circles in the windows guest, it would freeze for four seconds and then work for about 6 seconds then freeze again etc. What is that about.?
What is the official posting rules in this forum, top post or bottom post ? Thanks
I now move on to sound.
I could get sound working as you instructed. I chose to load all sound cards and see if I can find one that works.
Sound does work but it ios very intermittent, seemingly the same as what happens to the mouse as if there is a timeshare going on.
Any idea what that can be.
Please not that I am running AVLinux which has a real time kernel as I can remember. Maybe qemu has trouble with realtime kernels ? Or what can the reason be for the intermittent sound. Sound on for 2 seconds off for a seconds etc, Note that I did not compile a new version yet and just used the deb version. I will do that now
Is the sound problems due to not following your advice below ? What does --audio-drv-list=pa actually do ???
For reference
My string now looks as follows.
qemu-system-x86_64 -soundhw all -smp 4 -m 2048M -boot d -cdrom /dev/cdrom -drive format=raw,file=hd.img
Quoted 11 lines · Thomas Huth
Quoted 3 lines
2) I need to at least have sound working from applications in the guest with pulseaudio on the Debian host. Is it possible ?
Should be possible. Run the configure script before compiling with
--audio-drv-list=pa
and then make sure to give a soundcard to the guest (e.g. with the -soundhw option).
Quoted 3 lines
Try to run QEMU with "-smp 4".
Thomas thank you for your reply.
I will try each of your suggestions in turn.
-smp 4 did help and this time i could configure 2 cpus in windows.
Now for a very important question.
If hardware virtualization was not switched on in bios will qemu refuse to create more cpus? I just want to know if there are not bogus software cpus or cores created by qemu and that it actually checks it can get real cores from the machine and make it available to the host.
Second question. In the past qemu was lightning fast. However with this newer qemu windows 7 is very slow. It takes about 1 minute to open an application. What can slow it dow so much ? This happens with or without the smp switch. It seems there is some polling botlleneck if i move the mouse in circles in the windows guest, it would freeze for four seconds and then work for about 6 seconds then freeze again etc. What is that about.?
What is the official posting rules in this forum, top post or bottom post ? Thanks
Quoted 11 lines · Thomas Huth
Quoted 3 lines
2) I need to at least have sound working from applications in the guest with pulseaudio on the Debian host. Is it possible ?
Should be possible. Run the configure script before compiling with
--audio-drv-list=pa
and then make sure to give a soundcard to the guest (e.g. with the -soundhw option).
I now move on to sound.
I could get sound working as you instructed. I chose to load all sound cards and see if I can find one that works.
Sound does work but it ios very intermittent, seemingly the same as what happens to the mouse as if there is a timeshare going on.
Any idea what that can be.
Please not that I am running AVLinux which has a real time kernel as I can remember. Maybe qemu has trouble with realtime kernels ? Or what can the reason be for the intermittent sound. Sound on for 2 seconds off for a seconds etc, Note that I did not compile a new version yet and just used the deb version. I will do that now
Is the sound problems due to not following your advice below ? What does --audio-drv-list=pa actually do ???
For reference
My string now looks as follows.
qemu-system-x86_64 -soundhw all -smp 4 -m 2048M -boot d -cdrom /dev/cdrom -drive format=raw,file=hd.img
Sound is rickety but at least I can see that it is possible as in my previous post which is already way better than virtualbox.
Turning to networking;
I can configure windows tcp/ip very well, but for some reason qemu fails at a network connection. Windows report the qemu provided network card as Intel 1000.
However it fails when configured.
The dns and gateway is assigned correctly and known to route correctly from the other machines on the network.
So, I then try to explicitly add a switch to see if there is maybe a misreported mac or something and explicitly add the -nic network switch in the startup command
I work from this manual.
https://qemu.weilnetz.de/doc/qemu-doc.html
The string used is
qemu-system-x86_64 -nic user,ipv6=off,model=e1000,mac=52:54:98:76:54:32 -soundhw all -smp 4 -m 2048M -boot d -cdrom /dev/cdrom -drive format=raw,file=hd.img
The network switch used above fails with
qemu-system-x86_64: -nic: invalid option
Cant figure out why as it is what is used in the manual as is!
[Qemu-devel] Usb device disappears from linux after Qemu starts
In reply to Thomas HuthBelow is the string I use:
I use lsb to search for the the hostaddr of the usb device i want to connect to qemu. Qemu when it starts with this hostaddr then removes the device from the acticve usb list. Running lsusb after qemu starts shows the device disappeared.
Is this a bug ? as I cannot see a device just disappearing when qemu starts.
sudo qemu-system-x86_64 -usb -device usb-host,hostbus=1,hostaddr=42 -device piix3-usb-uhci -enable-kvm -soundhw all -smp 4 -m 2048M -boot d -cdrom /dev/cdrom -drive format=raw,file=hd.img