Advise wanted on optimizing a WinXP guest.

Discussions about using Windows guests in VirtualBox.
Post Reply
gencon
Posts: 36
Joined: 7. Jul 2010, 19:46
Primary OS: Linux other
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Win XP

Advise wanted on optimizing a WinXP guest.

Post by gencon »

My Setup:

Version: VirtualBox 3.2.6 for Linux (Not OSE)
PC Specs: Intel Core 2 Duo CPU E8500 3.16GHz, 3 GB RAM.

Host: Linux / Ubuntu (v. Lucid Lynx)
Guest: Windows XP Pro SP3

Windows XP Guest Setup:
RAM: 1 GB
Processor: 1
Video Memory: 64 MB
Hard Disk: Dynamically Expanding Storage
Guest Additions are installed.
For all files I create I use a shared folder, except for installed software of course.


Firstly I am very impressed with VirtualBox, Win XP running as a guest works very well, VirtualBox is certainly a very impressive piece of software.

I would like some advise on how to optimize Win XP running as a guest please. I run a few processor and file intensive applications on the guest, some video conversion software and such like which Linux does not have viable alternatives for. Now I know that such software is among the worst to run in a virtual environment, but I would really love not to have to have a dual boot Linux/WinXP (which I have at the moment) and use a normal WinXP install for my processor intensive operations because I want to start the processes running in WinXP and then, while it's running, get on with other things in Linux. Obviously I can only do that with VirtualBox (and I don't want to do it the other way around and run Linux as a guest OS on a Win host).

I ran some time tests and, at the moment, some processor intensive tasks (video encoding in this case) take about 3 times longer to run under WinXP as a VirtualBox guest as they do under native WinXP. Now that's quite manageable, not bad at all, but can I optimize my setup to improve it? I have some questions below, but any advise would be greatly appreciated.

1. Multiple processors. In VirtualBox Settings --> System --> Processor Tab I have one CPU set, when I increased this to two a warning indicator was displayed saying 'Non-optimal settings detected'. It sounded ominous so I cancelled it. Is it a good idea to try this or should I obey the warning? Within the System settings there are a number of other options like the Motherboard Extended Features, would any of these increase performance? What about Video Memory, mine is set to 64 MB, would putting this up to the max. of 128 MB help?

2. In the manual there is a section "12.3.8 Long delays when accessing shared folders", which advises making the following changes if accessing shared folders on a Windows guest results in 'long delays'.

"To fix these delays, add the following entries to the file \windows\system32\drivers\etc\lmhosts of the Windows guest:
255.255.255.255 VBOXSVR #PRE
255.255.255.255 VBOXSRV #PRE"

I do NOT have long delays, but might this serve as a performance enhancer anyway?

3. WinXP is bloated!! I read a suggestion somewhere on the web, that said a Win version called TinyXP runs very well as a guest on VirtualBox because it consists of a version of XP with non-essential services turned off, and all kinds of changes to XP so that it will run fast even on limited hardware specs. On investigation TinyXP turned out to be a pirated distribution that someone has created so I'm not interested - I have several genuine licensed copies of XP that I've had bundled with various PCs/Laptops over the years. However as a concept for improving WinXP performance as a VirtualBox guest it seems to me an excellent idea to turn off/disable unnecessary WinXP services. There are 44 'Started' services running on my WinXP guest, but I'm no Windows guru - how do I know which are essential and which I can turn off? Is turning some off likely to give me a performance boost? Which ones (if that's not too hard to answer!)?

4. As a supplement to question 3., are there any other settings I can change on WinXP to increase it's performance running as a VirtualBox guest?

Sorry that this has turned out to be such a long post, I'm a VirtualBox newbie and could find no guide to optimization. Any help and advise would be greatly appreciated.

Many thanks and regards,

GenCon
Perryg
Site Moderator
Posts: 34369
Joined: 6. Sep 2008, 22:55
Primary OS: Linux other
VBox Version: OSE self-compiled
Guest OSses: *NIX

Re: Advise wanted on optimizing a WinXP guest.

Post by Perryg »

First of all TinyXP is illegal, so I would not go that route.
Next the increase of processors to the Windows guest will help some but it would have had to be installed with the multiprocessor kernel to begin with.
You can search for HALu and use that to convert Windows to the multiprocessor kernel.
Next the SATA controller also helps. You need to have the AHCI drivers since they do not come with XP. Search for them on Intel and have them ready when you add the controller (do not change the drive until the drivers are loaded).
Video memory is not using the GPU it is RAM so increasing that more than likely will cause it to slow down instead of run faster.
Keep in mind that all of this is subjective. I see an improvement but there are those that will argue that it does nothing. So YMMV.
fixedwheel
Volunteer
Posts: 1699
Joined: 13. Sep 2008, 02:18

Re: Advise wanted on optimizing a WinXP guest.

Post by fixedwheel »

gencon wrote:1. Multiple processors. In VirtualBox Settings --> System --> Processor Tab I have one CPU set, when I increased this to two a warning indicator was displayed saying 'Non-optimal settings detected'. It sounded ominous so I cancelled it. Is it a good idea to try this or should I obey the warning?
thats the warning about SMP needing to activate IO-APIC that will be done automatic when SMP selected
however, I doubt the benefit of 2 guest CPUs on a 2 core host but YMMV
3. ... it seems to me an excellent idea to turn off/disable unnecessary WinXP services. There are 44 'Started' services running on my WinXP guest, but I'm no Windows guru - how do I know which are essential and which I can turn off?
same applies to me, what i did is open process-mgr (edit: task-manager) and see what exe is running in SYSTEM context and google its name ... sorry i don't remember which ones i deactivated

what i did else: switching to SATA like Perryg wrote; and using "virtio-net" virtual NIC with KVM virtio driver (NetKVM.zip) gives low NIC emulation overhead thanks to paravirtualisation



... but video encoding is what i do on the host using handbrake and codecs from debian-multimedia
gencon
Posts: 36
Joined: 7. Jul 2010, 19:46
Primary OS: Linux other
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Win XP

Re: Advise wanted on optimizing a WinXP guest.

Post by gencon »

Thanks very much for the advise Perryg.
Perryg wrote:First of all TinyXP is illegal, so I would not go that route.
Yes, I understand that and have no intention of using it or anything like it. I only mentioned it because that's where I got the idea of stripping down my XP guest to the bare minimum of what I need it to run.
Perryg wrote:Next the increase of processors to the Windows guest will help some but it would have had to be installed with the multiprocessor kernel to begin with. You can search for HALu and use that to convert Windows to the multiprocessor kernel.
I'll look into trying this over the next few days.
Perryg wrote:Next the SATA controller also helps. You need to have the AHCI drivers since they do not come with XP. Search for them on Intel and have them ready when you add the controller (do not change the drive until the drivers are loaded).
Excellent, excellent, excellent advise. I installed the AHCI SATA drivers and switched my VDI file to it. This has halved my boot time to under 30 seconds and noticably increased performance!! I'll run the same time tests as before and see how much it has improved by.
Perryg wrote:Video memory is not using the GPU it is RAM so increasing that more than likely will cause it to slow down instead of run faster.
Okay I'll steer clear of that then.
Perryg wrote:Keep in mind that all of this is subjective. I see an improvement but there are those that will argue that it does nothing. So YMMV.
Right, I suppose there are just so many possible setups that it's hard to be sure what will be the result of any optimization attemps for any specific setup.

Many thanks again for your help.
gencon
Posts: 36
Joined: 7. Jul 2010, 19:46
Primary OS: Linux other
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Win XP

Re: Advise wanted on optimizing a WinXP guest.

Post by gencon »

Thanks to you as well for the advise fixedwheel.
gencon wrote:1. Multiple processors. In VirtualBox Settings --> System --> Processor Tab I have one CPU set, when I increased this to two a warning indicator was displayed saying 'Non-optimal settings detected'. It sounded ominous so I cancelled it. Is it a good idea to try this or should I obey the warning?
fixedwheel wrote:thats the warning about SMP needing to activate IO-APIC that will be done automatic when SMP selected however, I doubt the benefit of 2 guest CPUs on a 2 core host but YMMV
Ok, I'll bare that in mind and, as I said in my reply to Perryg, I'll look into trying this over the next few days and see if I get any benefit.
gencon wrote:3. ... it seems to me an excellent idea to turn off/disable unnecessary WinXP services. There are 44 'Started' services running on my WinXP guest, but I'm no Windows guru - how do I know which are essential and which I can turn off?
fixedwheel wrote:same applies to me, what i did is open process-mgr (edit: task-manager) and see what exe is running in SYSTEM context and google its name ... sorry i don't remember which ones i deactivated
That sounds like an excellent procedure to follow, I'll try doing exactly that.
fixedwheel wrote:what i did else: switching to SATA like Perryg wrote; and using "virtio-net" virtual NIC with KVM virtio driver (NetKVM.zip) gives low NIC emulation overhead thanks to paravirtualisation
I did already install the SATA drivers, again as mentioned in my reply to Perryg, and that has speeded things up noticably.

About using virtio-net - Would using this just improve my internet connection speed? I'm not particularly bothered about my internet connection speed on my XP guest, it seems pretty fast and I don't need to use it much at all, I use Linux for my internet activities. However I would like to speed up reading/writing to the VirtualBox shared folder that I use with my guest, will virtio-net help with that as well?
fixedwheel wrote:... but video encoding is what i do on the host using handbrake and codecs from debian-multimedia
Yes, handbrake is excellent at what it does. However it doesn't do what I need and I have some excellent propriatry Windows software which I paid a bundle of cash for and which I want to continue using.

Thanks again for your help.
gencon
Posts: 36
Joined: 7. Jul 2010, 19:46
Primary OS: Linux other
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Win XP

Re: Advise wanted on optimizing a WinXP guest.

Post by gencon »

Another couple of questions:

1. I was wondering why I can not move my DVD drive on the IDE controller to my new SATA controller? Would this also give increased performance? Can it be done or was I doing something wrong when I tried to do this in my guest's VirtualBox storage settings? What about VBoxGuestAdditions.iso, can or should that be moved from the IDE controller to the SATA controller?

2. I've been using a VirtualBox shared folder for my video conversion and editing video files - obviously this is file read/write intensive. Would I be better off (speed wise) creating a new virtual hard disk VDI file, attaching that to the SATA controller, and using that instead of the shared folder for the video files? Or is there another setup I could use which would be even faster?

Thanks again all.
Perryg
Site Moderator
Posts: 34369
Joined: 6. Sep 2008, 22:55
Primary OS: Linux other
VBox Version: OSE self-compiled
Guest OSses: *NIX

Re: Advise wanted on optimizing a WinXP guest.

Post by Perryg »

2. I've been using a VirtualBox shared folder for my video conversion and editing video files - obviously this is file read/write intensive. Would I be better off (speed wise) creating a new virtual hard disk VDI file, attaching that to the SATA controller, and using that instead of the shared folder for the video files? Or is there another setup I could use which would be even faster?
Yes. Shared folders are slow. Network shares are faster but still slower then direct access. Add the VDI and set to SATA and see how much faster it is.
fixedwheel
Volunteer
Posts: 1699
Joined: 13. Sep 2008, 02:18

Re: Advise wanted on optimizing a WinXP guest.

Post by fixedwheel »

gencon wrote:About using virtio-net - Would using this just improve my internet connection speed? I'm not particularly bothered about my internet connection speed on my XP guest, it seems pretty fast and I don't need to use it much at all, I use Linux for my internet activities. However I would like to speed up reading/writing to the VirtualBox shared folder that I use with my guest, will virtio-net help with that as well?
the benefit of virtio-net should be reduced CPU cycles for any network activities as there is no need for the host to emulate complex hardware and the guest driver doesn't have to deal with this complex hardware

shared folders ... as of samba share: it might be a gain to set up a second NIC for the guest with "host-only" as this connection is software only - whereas "bridged" connections between host and guest use the hosts NIC hardware
OTOH VBox shared folders is independent from VBox networking AFAIK
mpack
Site Moderator
Posts: 39134
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Mostly XP

Re: Advise wanted on optimizing a WinXP guest.

Post by mpack »

I'm a bit late contributing to this thread, but if you found that switching to SATA made a difference that that implies that I/O time is a significant factor (hence not a CPU bound process after all). ... In which case you could also try cloning the drive using the CloneVDI tool, with the compact option set. This is especially useful if you have first gone through and deleted unwanted junk and then defragged. Among another thing CloneVDI will defragment the VDI block order, and arrange things so that 4K disk clusters in the guest OS coincide with 4K clusters in the host OS - both steps should boost performance.
roadSurfer
Posts: 75
Joined: 10. Jan 2009, 19:04

Re: Advise wanted on optimizing a WinXP guest.

Post by roadSurfer »

I just tried the changes mention here (SATA, paravirtualisation) and my findings appear to be contrary.
1) SATA caused the host CPU usage to rise 40-50% range (with IDE with will usually stay below 20%)
2) Paravirtualisation had no effect (I had hoped this would cure the problems is MS Office Communicator maxing out the guest).

Unless of course I'm doing things wrong, which is highly probable.
lovespell88
Posts: 1
Joined: 21. Jan 2011, 15:34
Primary OS: OpenSolaris 11
VBox Version: OSE self-compiled
Guest OSses: 9.9.9

Re: Advise wanted on optimizing a WinXP guest.

Post by lovespell88 »

You can optimize your Windows XP by using the classic theme and disabling or deleting any useless process that starts with Windows. You can use a CCleaner but you can also use any speedypc to manage your Windows Startup. Then, you may also want to run a disk defragmenter and disable visual effects.
Last edited by lovespell88 on 30. May 2011, 10:07, edited 1 time in total.
Lurk before you leap...
mpack
Site Moderator
Posts: 39134
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Mostly XP

Re: Advise wanted on optimizing a WinXP guest.

Post by mpack »

lovespell88 wrote:You can optimize your Windows XP by using the classic theme and disabling or deleting any useless process that starts with Windows.
IMHO, if someone asks on this site how to optimize Windows XP - or any other OS - it will generally be assumed that all the normal optimizations will have been done (and in any case here is not the place to ask about them), and it's the potential for VM optimizations which is being asked about.
Post Reply