Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Switching qemu from SDL to qxl spice Win7 x64 pro guest
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Desktop Environments
View previous topic :: View next topic  
Author Message
jserink
l33t
l33t


Joined: 30 Jan 2004
Posts: 668

PostPosted: Wed Jan 30, 2013 7:38 am    Post subject: Switching qemu from SDL to qxl spice Win7 x64 pro guest Reply with quote

Hello All:

Since moving from WinXP VM to Win7 x64VM and updating my AcadLT to 2013 from 2002 that I ran on XP, Acad and win7 in general have been sluggish.
I have moved to spice using the latest spice tools and hacked my way to get it working, the display experience is VASTLY improved with the qxl display driver.

References:
http://www.linux-kvm.org/page/SPICE
https://plus.google.com/u/0/116431128672707889151/posts/KQaKZNKD2b3
http://www.spice-space.org/download.html
http://www.redhat.com/archives/libvir-list/2011-March/msg00209.html

Ok, here is my calling command before the switch:
export SDL_VIDEO_X11_DGAMOUSE=0
export QEMU_AUDIO_DRV=alsa
qemu-kvm -boot c -hda /home/jserink/VMs/Win_7_Pro.img -cdrom /home/jserink/CDs/virtio-win-0.1-49.iso -m 6291 -smp 2 -usb -net nic,vlan=0,model=virtio,macaddr=52:54:00:00:EE:07 -net vde -rtc base=localtime -no-quit -vga std -name Win7 -monitor telnet:127.0.0.1:12997,server,nowait,ipv4 &
/home/jserink/qemu/qgt-2005-03-02-19/host-linux 192.168.100.1 > /dev/null 2>&1 &
#/home/jserink/qemu/shareclip-linux-12/ShareClip > /dev/null 2>&1 &

You can see that I am using qgt-2005-03-02-19/host-linux as the mouse util and insude windows the guestwin32.exe.

After the switch:
export SDL_VIDEO_X11_DGAMOUSE=0
export QEMU_AUDIO_DRV=alsa
qemu-kvm -boot c -hda /home/jserink/VMs/Win_7_Pro.img -cdrom /home/jserink/CDs/virtio-win-0.1-49.iso -m 6291 -smp 2 -usb -net nic,vlan=0,model=virtio,macaddr=52:54:00:00:EE:07 -net vde -rtc base=localtime -no-quit -vga qxl -global qxl.vram_size=128000 -name Win7 -monitor telnet:127.0.0.1:12997,server,nowait,ipv4 -spice port=5900,addr=127.0.0.1,disable-ticketing -device virtio-serial-pci -device virtserialport,chardev=spicechannel0,name=com.redhat.spice.0 -chardev spicevmc,id=spicechannel0,name=vdagent &
#/home/jserink/qemu/qgt-2005-03-02-19/host-linux 192.168.100.1 > /dev/null 2>&1 &
#/home/jserink/qemu/shareclip-linux-12/ShareClip > /dev/null 2>&1 &

Notice that the host-linux is commented out as am using the windows spice agent and it works a treat.
The qxl display driver and the spice client is buggy when you try and change resolutions, basically you loose the display for about 30 seconds, then it resizes and is black. You have no choice at this stage but to kill qemu.
Work around:
Install the windows telnet server, change the resolution that you want and the display freezes, telnet in and issue a "shutdown /r /f". Wait for a minute or two, the VM is still frozen, kill it. Restart it from the command line and select "Start windows normally" and the new resolution will be there.

Ok, steps to get this done:
First try:
export SDL_VIDEO_X11_DGAMOUSE=0
export QEMU_AUDIO_DRV=alsa
qemu-kvm -boot c -hda /home/jserink/VMs/Win_7_Pro.img -cdrom /home/jserink/CDs/virtio-win-0.1-49.iso -m 6291 -smp 2 -usb -net nic,vlan=0,model=virtio,macaddr=52:54:00:00:EE:07 -net vde -rtc base=localtime -no-quit -vga std -name Win7 -monitor telnet:127.0.0.1:12997,server,nowait,ipv4 -spice port=5900,addr=127.0.0.1,disable-ticketing &
/home/jserink/qemu/qgt-2005-03-02-19/host-linux 192.168.100.1 > /dev/null 2>&1 &
#/home/jserink/qemu/shareclip-linux-12/ShareClip > /dev/null 2>&1 &

Here I am basically following the steps from here:
http://www.linux-kvm.org/page/SPICE

I then downloaded spice-guest-tools-0.3.exe from here:
http://www.spice-space.org/download.html

and installed them in windows. I then rebooted and changed my calling command to this:
export SDL_VIDEO_X11_DGAMOUSE=0
export QEMU_AUDIO_DRV=alsa
qemu-kvm -boot c -hda /home/jserink/VMs/Win_7_Pro.img -cdrom /home/jserink/CDs/virtio-win-0.1-49.iso -m 6291 -smp 2 -usb -net nic,vlan=0,model=virtio,macaddr=52:54:00:00:EE:07 -net vde -rtc base=localtime -no-quit -vga qxl -name Win7 -monitor telnet:127.0.0.1:12997,server,nowait,ipv4 -spice port=5900,addr=127.0.0.1,disable-ticketing -device virtio-serial-pci -device virtserialport,chardev=spicechannel0,name=com.redhat.spice.0 -chardev spicevmc,id=spicechannel0,name=vdagent &
#/home/jserink/qemu/qgt-2005-03-02-19/host-linux 192.168.100.1 > /dev/null 2>&1 &
#/home/jserink/qemu/shareclip-linux-12/ShareClip > /dev/null 2>&1 &

Note that the spicea gent stuff is there and the change to the qxl driver.
Upon restart of the VM, the copy paste works but windows refuses to use the qxl driver as its unsigned.
Follow the steps here from a cmd.exe console with admin rights as described:
https://plus.google.com/u/0/116431128672707889151/posts/KQaKZNKD2b3

Restart the VM and the qxl driver loads. Now we start to have fun with the resolution and the display bug described above.

I added this parameter to the call command:
-global qxl.vram_size=128000

It then would boot up into 1024x278.
I then did my trick above with the telnet server and got it to 1600x1050 and it is crisp as crisp. Acad looks great.
the Mickeysoft experience thinggy is still 1 as it measures ONLY if you have 3D accel and not 2D. The qxl driver supplies only 2D but that is a MASSIVE improvement over the sdl driver.

Ok, we're good.

Cheers,
john
Back to top
View user's profile Send private message
Rexilion
Veteran
Veteran


Joined: 17 Mar 2009
Posts: 1044

PostPosted: Sun Apr 07, 2013 11:48 am    Post subject: Reply with quote

I don't know if this is considered 'necromancing of a thread' (pardon me). But I really want to show my appreciation here. I have been fighting with qemu-system-i386 (no kvm) for a while, mostly for doing slipstreaming of Windows XP SP3. After installation you are 'greeted' by approx 125 updates (!).

- I did manage to streamline the image with virtio, even during installation (floppy method).
- I managed to use my tap0 device which has DHCPD and automated networking.
- But I could not VDI to work. But now I did, thanks to you :) .

The below did the trick for me, as mentioned by you:

-device virtio-serial-pci -device virtserialport,chardev=spicechannel0,name=com.redhat.spice.0 -chardev spicevmc,id=spicechannel0,name=vdagent

After second considerations of your references the above snippet looks to be directly taken from here. I missed it because Firefox found it apparently funny to *not* wrap the line :evil: .

I even looked at the difference between spicevmc and spiceport when they were committed. I still don't know the difference though.

Furthermore, qemu should do more documentation. But thanks to you, I won't be suffering from that for a while. Cheers!

EDIT2: In case someone is interested, below is my final qemu cmd:

Code:
/usr/bin/qemu-system-i386 -nodefaults -no-kvm -no-reboot -no-fd-bootchk
-snapshot
-balloon virtio
-m 256
-monitor stdio

-drive id=hd,if=virtio,file=/home/secure/ronald/Documenten/qemu/windows_xp.img

-vga qxl -nographic
-spice port=5000,addr=127.0.0.1,ipv4,disable-ticketing,image-compression=auto_lz

-device virtio-serial
-device virtserialport,chardev=sc0,name=com.redhat.spice.0
-chardev spicevmc,id=sc0,name=vdagent

-d unimp,guest_errors -D /home/secure/ronald/Documenten/qemu/windows_xp.log

-device virtio-net,netdev=tap
-netdev tap,id=tap,ifname=tap0,script=,downscript=,vnet_hdr=off

_________________
fs/super.c: "Self-destruct in 5 seconds. Have a nice day...\n"
Back to top
View user's profile Send private message
jserink
l33t
l33t


Joined: 30 Jan 2004
Posts: 668

PostPosted: Wed Apr 10, 2013 1:36 am    Post subject: Reply with quote

Rexilion wrote:
But thanks to you, I won't be suffering from that for a while. Cheers!



Cheers then! :)

The next hurdle is to shift everything over to "Virtual Machine Manager" which entails grotesque xml files rather than the qemu-kvm CLI calls with lots of switches...I prefer the command line calls but to each their own.

Spice-gtk's spicy client is not officially supported by the development team (for testing only so they say) so the crashing of the client when I do certain microsoft things in my windows 7 VM are not really being responded to, they want everyone on virtual machine clients....the xml crap.

I'm using spice-gtk 0.16 eventhough there is a 0.18. The 0.18 won't even bring the VM up in a window and crashes the VM so am stuck at 0.16. It has minor annoyances but works. Crashing of spicy is not an issue as the VM is still there when I run the client again.

i need to get motivated to move to the xml mush but am hesitant....too many tenders to work on.

Cheers,
john
Back to top
View user's profile Send private message
Rexilion
Veteran
Veteran


Joined: 17 Mar 2009
Posts: 1044

PostPosted: Wed Apr 10, 2013 5:26 am    Post subject: Reply with quote

So you are actually saying that you are diving in the .xml mess just to get a proper working spice client? If yes, you have my sympathy.

To make matters worse, qemu has it's own (different!) config system. The .xml-system generate a qemu commandline, which is done by "Virtual Machine Manager" (virt-manager I think). I have seen some of those generated qemu commands based on those .xml files, that did not make me happy.
_________________
fs/super.c: "Self-destruct in 5 seconds. Have a nice day...\n"
Back to top
View user's profile Send private message
vaxbrat
l33t
l33t


Joined: 05 Oct 2005
Posts: 620
Location: DC Burbs

PostPosted: Thu Apr 11, 2013 9:24 pm    Post subject: agree on spice/qxl but virt-manager makes it easier Reply with quote

I just did a fairly massive update on my desktop box at work where I've had my "official" work desktop (WinXP) banished to live as a kvm guest being managed by virt-manager since around 2008. I switched from vnc/vga to spice/qxl following these two links pretty much:
http://www.linux-kvm.org/page/SPICE and http://www.linux-kvm.com/content/rhev-spice-guest-drivers-released-windows with the downloads for windows client at http://www.spice-space.org/download/windows/spice-guest-tools/spice-guest-tools-0.52.exe.

I usually have sysinternals process explorer running in the guest so the first thing I noticed besides much snapper performance was a huge reduction in the number of hardware interrupts and deferred system calls getting logged and much better idle times. Since I had already been using virtio drivers for network and disk since around 2010, this has to be due to the vga driver switch.

The other really nice thing was the clipboarding support added by the new spice viewer, channels and the agents on the windows side. That was one of the things that a VMWare snob could hold against me in the past.

One thing I ran into immediately though is one of the corporate enterprise gui's. If anybody else out there is using SAP, beware that the thick client gui (version 7.2something here) reliably freezes my qxl accelerated WinXP desktop without fail when I try to start it. Since I'm not a bean counter and only use it to enter time sheets, I have a web interface I can fall back on in a browser.
Back to top
View user's profile Send private message
vaxbrat
l33t
l33t


Joined: 05 Oct 2005
Posts: 620
Location: DC Burbs

PostPosted: Thu Apr 11, 2013 9:31 pm    Post subject: need xml hack switching back to vga from qxl Reply with quote

One problem with virt-manager currently (0.9.4) that I noticed is that qxl adds a new ram attribute along with the vram one in the xml entry for the guest's display. The gui allows you to switch from vga to qxl without any problems but will error out and not allow you to "apply" the change to switch back to vga. You need to hack the xml as follows and then reload:

Code:
<model type='qxl' ram='65536' vram='65536' heads='1'/>


vs

Code:
<model type='vga' vram='9216' heads='1'/>
Back to top
View user's profile Send private message
Rexilion
Veteran
Veteran


Joined: 17 Mar 2009
Posts: 1044

PostPosted: Fri Apr 12, 2013 5:38 am    Post subject: Re: need xml hack switching back to vga from qxl Reply with quote

vaxbrat wrote:
One problem with virt-manager currently (0.9.4) that I noticed is that qxl adds a new ram attribute along with the vram one in the xml entry for the guest's display. The gui allows you to switch from vga to qxl without any problems but will error out and not allow you to "apply" the change to switch back to vga. You need to hack the xml as follows and then reload:

Code:
<model type='qxl' ram='65536' vram='65536' heads='1'/>


vs

Code:
<model type='vga' vram='9216' heads='1'/>


And this is why I prefer to use qemu directly:

Quote:
ronald@Alpha ~ :) $ qemu-system-i386 -device qxl,help
qxl.ram_size=uint32
qxl.vram_size=uint32
qxl.revision=uint32
qxl.debug=uint32
qxl.guestdebug=uint32
qxl.cmdlog=uint32
qxl.ram_size_mb=uint32
qxl.vram_size_mb=uint32
qxl.vram64_size_mb=uint32
qxl.vgamem_mb=uint32
qxl.surfaces=int32
qxl.addr=pci-devfn
qxl.romfile=string
qxl.rombar=uint32
qxl.multifunction=on/off
qxl.command_serr_enable=on/off


Maybe one of these options alleviates your problem?
_________________
fs/super.c: "Self-destruct in 5 seconds. Have a nice day...\n"
Back to top
View user's profile Send private message
centr-o
n00b
n00b


Joined: 02 Jun 2013
Posts: 2

PostPosted: Sun Jun 02, 2013 1:05 pm    Post subject: Re: agree on spice/qxl but virt-manager makes it easier Reply with quote

vaxbrat wrote:

One thing I ran into immediately though is one of the corporate enterprise gui's. If anybody else out there is using SAP, beware that the thick client gui (version 7.2something here) reliably freezes my qxl accelerated WinXP desktop without fail when I try to start it. Since I'm not a bean counter and only use it to enter time sheets, I have a web interface I can fall back on in a browser.


I stumbled upon this, too. After a lot of things I tried, I found the culprit: it's the SAP GUI theme. I changed the theme to Classic, and now it starts okay :)
Back to top
View user's profile Send private message
centr-o
n00b
n00b


Joined: 02 Jun 2013
Posts: 2

PostPosted: Sat Sep 07, 2013 10:25 pm    Post subject: Re: agree on spice/qxl but virt-manager makes it easier Reply with quote

centr-o wrote:
vaxbrat wrote:

One thing I ran into immediately though is one of the corporate enterprise gui's. If anybody else out there is using SAP, beware that the thick client gui (version 7.2something here) reliably freezes my qxl accelerated WinXP desktop without fail when I try to start it. Since I'm not a bean counter and only use it to enter time sheets, I have a web interface I can fall back on in a browser.


I stumbled upon this, too. After a lot of things I tried, I found the culprit: it's the SAP GUI theme. I changed the theme to Classic, and now it starts okay :)


The problem is fixed with the new qxl-0.1-18 driver. The Signature theme doesn't hang Windows anymore.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Desktop Environments All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum