VirtualBox非官方中文论坛

 

 

搜索
VirtualBox非官方中文论坛 广场 VirtualBox文档 Fix (Workaround, really) VirtualBox High CPU Load wi ...
查看: 2533|回复: 0
go

[Debian] Fix (Workaround, really) VirtualBox High CPU Load with Ubuntu 9.10 Host

Rank: 8Rank: 8

UID
帖子
106 
VirtualBoxChina币
301 分 
活跃积分
0 点 
技术积分
0 ° 
注册时间
2009-5-17 
最后登录
2010-12-9 
VirtualBoxChina 发表于 2010-3-3 22:21 |显示全部帖子

您是本帖的第2533个浏览者


Updated to Karmic the other day, and all is well and good with the world, but VirtualBox is determined to use a heap of CPU time even when the guest OS is idling. This sucks, and from what I’ve read is related to CPU affinity.

I tried changing the affinity from 3 down to 1 with sudo taskset -p 1 31540 from the terminal, where 31540 was the PID (Process ID) of VirtualBox at the time – and did it work? Um, no…

After some further reading I found a quirky, but totally working fix workaround:
- Create a new virtual machine, call it “Dummy” or something
- Assign it as little resources as you can, like 4MB RAM, use a 10MB HD image etc
- Start this dummy virtual machine, skipping any virtual hard drive formatting
- That’s it! Just leave the dummy machine running at the screen saying “FATAL: No bootable medium found! System halted”

With the dummy machine running, VirtualBox sorts out its own processor affinity properly, and the CPU usage of your actual VM guest drops waaaaaaay down and becomes snappy & responsive again.

The joyz…

Update: This problem’s been recurring for me (as you can see in the comments below), but I think I’ve cracked it: With an XP guest running on a single core of a Core 2 Duo, if I run the following command in bash I can get the CPU usage down to negligible levels:

sudo suecho 2 > /proc/sys/kernel/perf_counter_paranoidexit

If this works for you and you want it to be applied at every boot, just edit the file /etc/sysctl.conf and add the line kernel.perf_counter_paranoid = 2 at the bottom.

Additional Information: Although perf_counter_paranoid 2 seems to work reasonably well – we can still do a bit better. With an XP guest, once you’ve set XP to use multiple processors, it’s going to keep trying to use multiple processors, even if you’ve told VB to only allow it access to a single CPU. To fix this you can grab yourself a copy of of HALuand change your XP CPU setup from ACPI Multiprocessor PC to ACPI Uniprocessor PC. With that in place, CPU usage for your linux host drops down a little further, and doesn’t ramp back up too far under minimal guest load. Or you could just use the dummy VM… FFFFFFUUUUUUUUUUUUUUUUUUU…. =P


文章来源:  http://r3dux.org/2009/11/how-to-fix-virtualbox-high-cpu-load-with-ubuntu-9-10-host/

plugin_name


VirtualBox非官方中文论坛 - 论坛版权

VirtualBox非官方中文论坛 百度GG

GMT+8, 2012-2-6 08:10 , Processed in 0.027466 second(s), 19 queries , Gzip On.

Powered by Discuz! X1.5

© 2001-2010 Comsenz Inc.