Ubuntu – How to improve the performance of the VirtualBox guest

performancevirtualboxvirtualization

I run a guest ubuntu 12.04 on a host ubuntu 12.04, with VirtualBox, and the guest is much, much slower than the host (ALT+TAB takes 4-5 secs). I had a look around and I found contradicting opinions on VirtualBox versus VMware (free); so I thought to keep the former.

Both systems are updated, I installed the additions on the guest and I evenly split memory and video memory (64MB) between guest and host. I am running a Toshiba m200 laptop with 4GB ram and shared video memory. The host bios does not include a configuration option for machine virtualization. I have 2 cpus and I can't give them both to the virtual machine.

Is there anything I overlooked that could solve my problem?

Feel free to ask for more info, and thank you for any help.

EDIT
Idling with the system monitor open the (single) guest cpu never gets below 55% and could rise to 80 – 90% just by moving the mouse around. Opening Firefox will cause the system monitor to show cpu usage 100% in the guest, while the host shows that both cpus are evenly working around 60%.

My cpu is Intel® Core™2 Duo CPU T5450 @ 1.66GHz × 2.

If this is not a configuration problem, does it mean my machine is too weak for virtualization?

Best Answer

I don't know much about Player, but Vbox defaults are not good for Ubuntu releases that prefer a real GPU.

  • On spinning HDDs, pre-allocate the entire virtual disk. On SSDs, it doesn't matter. VDI / qcow2 sparse allocations do reduce performance, but the reductions involved appear to be less than 10% since 2015. Weigh the performance vs convenience.
  • Allocate only the storage you need. Keep large files elsewhere, outside the vStorage.
  • Never allocate more CPUs or RAM than you should. 1 vCPU is probably enough.
  • Leave 1GB of RAM for the HostOS. Do not over commit RAM.
  • Use the VirtIO drivers for Storage and Networking. Modern Linux guests support this. For Windows guests, use the SATA (storage) and Intel PRO/1000 (network) drivers. It is possible to use virtio drivers under Windows, it is just a little harder.
  • Enable ACPI and AHCI for all guests from 2003, WinXP and later.
  • Desktop VMs should get all 128MB of display vRAM
  • Server VMs should stay with 9MB of vRAM; don't waste it.
  • Avoid 2D and 3D accel settings, until you have everything else working the way you like. I'm serious. Ubuntu does bad things when this is enabled. It can bring a Core i7 to the ground.

For more details: http://blog.jdpfu.com/2012/09/14/solution-for-slow-ubuntu-in-virtualbox