Windows 7 bloody slow in a VM (Virtualbox)

Red Squirrel

No Lifer
May 24, 2003
69,267
13,020
126
www.anyf.ca
Is there a way to speed up Windows 7 in a VM? I am trying to use it in Virtualbox but it's completely unusable. Something as simple as getting a right click menu takes about a minute just for the menu to show up, moving a window takes several minutes etc... Trying to type something is near impossible. It's just completely unusable.

Is there a way to fix this? I usually use XP when I need a windows VM, but it would be nice to use 7. I gave it like 2GB of ram and 1 CPU, is this maybe not enough?

When I manage to get a task manager up, it's hard to make out what's going on as it jitters so much and only updates maybe once every 20 seconds. I can't say there's any one process that is using lot of CPU, it jumps around a lot and each time the window manages to refresh it's a different app. svchost.exe and TrustedInstaller.exe and taskmgr.exe itself seem to be on top often. The rate at which the window draws makes it very unclear though, I know it's normal for stuff to jump around a bit but when you can view it in real time it typically only stays on top for less than a second.

It's actually so bad that I can't even load IE properly to load a web page. It just goes black because it just quits drawing the window.
 
Last edited:

VirtualLarry

No Lifer
Aug 25, 2001
56,570
10,200
126
I never had any issues with running Win7 (I think I used 32-bit) inside a VirtualBox VM, running on Ubuntu as the host OS. Running off of a usb thumb drive even.
 

Red Squirrel

No Lifer
May 24, 2003
69,267
13,020
126
www.anyf.ca
Weird. This is a clean install. Any time that I've tried it in a VM it's bloody slow. Do you do anything special to optimize it?

I'm using iostat and the disk usage of the raid array is 0. Though I'm wondering how accurate that tool is since I had like 5 dd commands going at once and it still shows 0 and none of the numbers changed. Any other tool I can use to measure disk i/o performance/usage? I want to try to rule out a disk i/o starvation issue. Raid is mdadm. All other VMs perform fine though... it's only windows 7 that does this.
 

code65536

Golden Member
Mar 7, 2006
1,006
0
76
I don't have this problem with Windows 7 (32-bit or 64-bit) in VirtualBox...

1) VirtualBox extensions are installed in the guest OS, right?

2) VT-x is enabled, right?
 

Dahak

Diamond Member
Mar 2, 2000
3,752
25
91
Did you install the guest machine extensions? If I forget to install them on my test vm I sometimes experience delays like that.

You could try to disable 3d acceleration in the vm setting also try to disable hardware acceleration inside the vm
Right click desktop -> screen resolution -> advanced Settings -> troubleshooting tab -> change settings button -> set the scroll all the way to the left
 

Mushkins

Golden Member
Feb 11, 2013
1,631
0
0
What else do you have running on your rig? If you're pushing it with a bunch of other stuff or multiple VMs you might not have the resources to allocate for virtualbox which could cause the slowness. I'd also check the 3d acceleration/hardware acceleration settings- Aero in the VM could be causing trouble with your video card.
 

Red Squirrel

No Lifer
May 24, 2003
69,267
13,020
126
www.anyf.ca
Yeah the guest additions are installed.

Tried this on multiple machines and it's always the same experience. The first rig is a core i7 with 12GB of ram and a SSD. The VMs are on a mdadm raid 5 array (via NFS) on my file server which is a Xeon. I've had 7 production VMs running off that array before with no issues, though it was mostly Linux and Windows server 2003. Right now there's only 2 VMs running and they don't really do much IO.
 

Mushkins

Golden Member
Feb 11, 2013
1,631
0
0
Yeah the guest additions are installed.

Tried this on multiple machines and it's always the same experience. The first rig is a core i7 with 12GB of ram and a SSD. The VMs are on a mdadm raid 5 array (via NFS) on my file server which is a Xeon. I've had 7 production VMs running off that array before with no issues, though it was mostly Linux and Windows server 2003. Right now there's only 2 VMs running and they don't really do much IO.

You've got plenty of horsepower, I'd definitely lean towards a configuration issue then. Did you check out those video settings?
 

Red Squirrel

No Lifer
May 24, 2003
69,267
13,020
126
www.anyf.ca
Yeah they're both enabled (2D and 3D acceleration). I unchecked them and it's slightly better but still bloody slow.

Also it's not activated, does that matter? I'm trying to get it activated but it's just unusably slow.

For fun I'm reinstalling it on my VM server on the raid 10 but it's not looking too good there either, it's been at "expanding files" for the last 10 minutes and it's only at 24%. There are no other VMs on that raid 10 so it has it all to itself.

According to stuff I'm finding on Google lot of people have this slowness issue running 7 in a VM but there are no answers.
 
Last edited:

Red Squirrel

No Lifer
May 24, 2003
69,267
13,020
126
www.anyf.ca
Fully allocated. I set it to 15GB. I managed to activate it, and now I'm installing Firefox, but I just have an hour glass that's been there for the past 5 minutes. Nothing is usuable and even the simplest of task like getting the right click menu takes several minutes. Then it jumps and goes fast for a while, then slow again. The installation on a totally different server/raid array is slow too. It's still at expanding files.

There seem to be something with the windows 7 engine and vms that don't act well together.

I don't see any signs of IO starvation on the storage server, though I'm not really sure how to look. iostat's data is completely useless, the numbers don't change at all no matter what I do to the disk. Ex: I tried to run 10+ dd commands at once and the disk utilization is still 0%. So I don't know if there's a better command I can use to measure IO.
 

code65536

Golden Member
Mar 7, 2006
1,006
0
76
Well, VirtualBox does have a disk activity indicator. It's not that useful, but sustained disk flashing might be indicative of I/O bottlenecks (throughput isn't as important as latency for an OS, so even if the MB/s isn't that high, latency could still bite). Also, Process Explorer in either the guest or host OS can shed some light on disk access.

Right now, I'm leaning towards two things.

1) I/O. Have you tried copying the virtual disk to a local, non-RAID disk and testing out a local run just to rule that out as a possible problem?

2) Windows Updates. I always disable automatic updates for my VMs and then manually check them only when I'm good and ready, because even the process of checking for and installing updates can be a bit intensive on I/O, CPU, and RAM. (And yes, 2GB of RAM and 1 CPU should be enough, since that's exactly what I use for most of my Win7 VMs.)
 

Red Squirrel

No Lifer
May 24, 2003
69,267
13,020
126
www.anyf.ca
The new VM I just made *seems* to actually be ok, it's on the raid 10. Have not tried locally yet but will try that after. This one may in fact work though, the other VM was slow from the get go, and this one seems fairly usable. Not sure what's different, I just go with the default settings VirtualBox puts when I select the OS. I'll wait and see what happens. I wonder if it's some kind of process in Windows that causes that.

The disk activity indicator is always flashing though, so seems 7 may be an IO intensive OS compared to others, maybe I was just tipping the raid 5 over the edge.

I'll wait and see what happens.
 

Red Squirrel

No Lifer
May 24, 2003
69,267
13,020
126
www.anyf.ca
New VM is getting slow too, though not as bad as the other. I guess 7 is just that much more of a heavyweight OS so it needs more resources. It was probably designed for SSDs in mind so raid 10 with 4 drives just barely cuts it when you add the overhead of being in a VM.
 

hhhd1

Senior member
Apr 8, 2012
667
3
71
Red Squirrel's signature said:
486dx2 @66Mhz turbo, 8MB ram, 512MB HDD, sound blaster 16 + 2x cdrom, Trident 1MB video card @ 640*480, 56k high speed modem.
I do not think that hardware would run windows 7 very well ...

Anyway,
From my experience, trying to run a windows 7 vm on a network storage is not a good idea unless you disable the pagefile, the added latency to accessing that file could result in terrible slowness.
Virtual disk files are already slower than normal drives without the addition of the network latency.
 

TerryMathews

Lifer
Oct 9, 1999
11,464
2
0
Is there a way to speed up Windows 7 in a VM? I am trying to use it in Virtualbox but it's completely unusable. Something as simple as getting a right click menu takes about a minute just for the menu to show up, moving a window takes several minutes etc... Trying to type something is near impossible. It's just completely unusable.

Is there a way to fix this? I usually use XP when I need a windows VM, but it would be nice to use 7. I gave it like 2GB of ram and 1 CPU, is this maybe not enough?

When I manage to get a task manager up, it's hard to make out what's going on as it jitters so much and only updates maybe once every 20 seconds. I can't say there's any one process that is using lot of CPU, it jumps around a lot and each time the window manages to refresh it's a different app. svchost.exe and TrustedInstaller.exe and taskmgr.exe itself seem to be on top often. The rate at which the window draws makes it very unclear though, I know it's normal for stuff to jump around a bit but when you can view it in real time it typically only stays on top for less than a second.

It's actually so bad that I can't even load IE properly to load a web page. It just goes black because it just quits drawing the window.

Inside the VM, are you running 32 bit or 64 bit?
 

Ketchup

Elite Member
Sep 1, 2002
14,558
248
106
... From my experience, trying to run a windows 7 vm on a network storage is not a good idea unless you disable the pagefile...

Sooo, let me make sure I(we) have something clear. Is this vm in the local machine, or is it running through a network connection?
 

hhhd1

Senior member
Apr 8, 2012
667
3
71
Sooo, let me make sure I(we) have something clear. Is this vm in the local machine, or is it running through a network connection?
The vmdk/vmx files are hosted on another computer, and accessed via network share \\192.168.0.x\myvms\win7\
 

Ketchup

Elite Member
Sep 1, 2002
14,558
248
106
Well, I would say that is your problem. XP does ok on a network, but with Vista on up we are talking a lot more data.
 

Red Squirrel

No Lifer
May 24, 2003
69,267
13,020
126
www.anyf.ca
Inside the VM, are you running 32 bit or 64 bit?

64 bit, I think... I don't remember being asked when installing but pretty sure it is 64 bit. There is two program files directories, if that's any indicator.

The storage is NFS, so ti's on a raid array on another server. (1gig link)

Never thought about the page file, I will try disabling it to see how that goes.

I also disabled superfetch and other stuff like that and it seems to be doing a bit better. The HDD usage indicator in vbox is not flashing as much anymore.
 

TheRyuu

Diamond Member
Dec 3, 2005
5,479
14
81
Fully allocated. I set it to 15GB.

I'm not sure that's enough.

64 bit, I think... I don't remember being asked when installing but pretty sure it is 64 bit.

The Windows install media is seperate so it won't ask you. You can check under control panel -> system.

Never thought about the page file, I will try disabling it to see how that goes.

You shouldn't have to.

I also disabled superfetch and other stuff like that and it seems to be doing a bit better. The HDD usage indicator in vbox is not flashing as much anymore.

Superfetch really should not have any negative impact on performance. I suppose in a VM it sort of loses some of its benifits (e.g. the boot prefetch stuff/file rearranging) but still, for a traditional hard drive I find it hard to believe it would make it slower.

Couple of things, just for the install I would give it more stuff than it needs or you want to give to it (e.g. 4GB, 2 CPU's), same with the updates as well. I would disable automatic updates so you can knock it out when that'll be the only thing running (after activation, etc). I would update before installing anything virtualbox related.

What kind of virtual storage adapter are you using for the HDD? It might be worth it to try SCSI, I've had problems with the default SATA one it uses.

And last, if everything you tried doesn't work well... we are talking about VBox here which isn't exactly known for it's great performance and flawless operation.
 

Red Squirrel

No Lifer
May 24, 2003
69,267
13,020
126
www.anyf.ca
Wow is 7 that much of a pig, figured 15GB of space would be enough. I only have 8GB of ram on that server so I can't give it more ram (completely taxed in terms of ram) but eventually I will build a new VM server so I'll be able to give it more. If 7 is that much heavier than XP I might just stick to XP/2003 for windows stuff. There's lot of stuff that does not work well or at all in wine so I just use VMs.

It seems semi usable now so I'll leave it at that and wait till I build a better VM server, and probably use something better than virtualbox. Probably Proxmox or Xen or something.
 

coolpurplefan

Golden Member
Mar 2, 2006
1,243
0
0
If you were really desperate for XP, I know you can find new old stock on eBay compatible with XP. But some manufacturers like Gigabyte still have XP drivers for Ivy Bridge motherboards. Z77 motherboard selection is getting more scarce however.