Since upgrading to Ubuntu 9.10 I’ve noticed poor performance of VirtualBox guests with Intel VT-X hardware virtualisation enabled. This has been noted in a few places, but I didn’t enable VT-x until recently so I can’t be sure that the problem began with Karmic. I can be sure that it is happening to me now.
At the time of this writing, my host OS is Ubuntu 9.10 Karmic 64-bit (actually an Intel Core 2 Duo 2.0 MHZ), with VirtualBox 3.0.10 PUEL edition. I run several 32-bit clients: Ubuntu 6.06 LTS (just in case, we still encounter them at some customer sites), Ubuntu 8.04 LTS, Xubuntu 9.10, and Windows XP SP3 (my actual legal copy that came with the laptop).
I left the Windows XP VM running but idle, and noticed that my keyboard and mouse occasionally skipped, and my CPU worked harder than expected. So I ran a few tests with top in batch mode:
top -b -d 10 -n 10
I then redirected that to a file, waited the 10*10 seconds to finish, and grepped the results. This is with VT-x enabled, and shows only the relevant VM (not the GUI or other VMs):
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND 30763 tyler 20 0 1020m 609m 73m S 10 15.4 0:28.05 VirtualBox 30763 tyler 20 0 1020m 609m 73m S 9 15.4 0:28.98 VirtualBox 30763 tyler 20 0 1020m 609m 73m S 5 15.4 0:29.52 VirtualBox 30763 tyler 20 0 1020m 609m 73m S 6 15.4 0:30.10 VirtualBox 30763 tyler 20 0 1020m 609m 73m S 20 15.4 0:32.06 VirtualBox 30763 tyler 20 0 1020m 609m 73m S 6 15.4 0:32.63 VirtualBox 30763 tyler 20 0 1020m 609m 73m S 10 15.4 0:33.60 VirtualBox 30763 tyler 20 0 1020m 609m 73m S 16 15.4 0:35.18 VirtualBox 30763 tyler 20 0 1020m 609m 73m S 6 15.4 0:35.78 VirtualBox 30763 tyler 20 0 1020m 609m 73m S 4 15.4 0:36.20 VirtualBox
Here is the same data, after rebooting the guest and disabling VT-x:
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND 30217 tyler 20 0 1027m 625m 73m S 4 15.8 2:21.32 VirtualBox 30217 tyler 20 0 1027m 625m 73m R 5 15.8 2:21.79 VirtualBox 30217 tyler 20 0 1027m 625m 73m S 1 15.8 2:21.89 VirtualBox 30217 tyler 20 0 1027m 625m 73m S 11 15.8 2:23.04 VirtualBox 30217 tyler 20 0 1027m 625m 73m S 11 15.8 2:24.17 VirtualBox 30217 tyler 20 0 1027m 625m 73m S 5 15.8 2:24.69 VirtualBox 30217 tyler 20 0 1027m 625m 73m S 2 15.8 2:24.94 VirtualBox 30217 tyler 20 0 1027m 625m 73m S 10 15.8 2:25.94 VirtualBox 30217 tyler 20 0 1027m 625m 73m S 5 15.8 2:26.44 VirtualBox 30217 tyler 20 0 1027m 625m 73m S 13 15.8 2:27.72 VirtualBox
Two conclusions:
- Software virtualisation uses more RAM. The guest is configured with 1 GB of RAM. With VT-x, this uses 1020 M. Without, it uses 1027 M. Whether that represents a memory overhead of 7M per VM or 0.7% of total RAM per VM, I don’t care. It’s small enough.
- Software virtualisation, under these conditions, is more efficient than using VT-x. The average CPU usage with VT-x was 9.2%. Without, it was 6.7%.
Engineering and science students will recall that all experimenters must note potential flaws and sources of error.
- This tests only a guest which is completely idle. However, my general impression when doing actual work in the guest VM supports the idle observation.
- top isn’t the best measure of performance, but it is indicative.
- I only tested a 64-bit Intel host with a 32-bit Windows guest. As always, more data is better.
I also note that my keyboard and mouse no longer skip when the guest OS is busy. Clearly something is up with VT-x and Ubuntu 9.10 hosts. The right thing to do is to perform more tests confirm the initial observations, but I’m not going to spend any more time on this. Software virtualisation, so far, has been plenty fast for me. I’ll just disable VT-x on all guests, and test again after the next upgrade for VirtualBox or the host kernel.
Tags: amd64, karmic, ubuntu, virtualbox
-
Boom!
Thanks. I was on the 32-bit architecture prior to 9.04 which is when I switched to 64-bit. I have been having issues with VirtualBox since. I could almost swear that it was related to the USB implementation, however, the issues were completely intermittent. I didn’t even think about the VT-x stuff, I mean It’s tested hardware right… Thanks, I disabled VT-x and the VM flies again.There is something with USB and VT-x, though. In my tests, copying 9GB of information to an NTFS thumb drive, Karmic would consistently pause every application (only when a VM was running) and my transfer rate for USB2.0 would drop down to mere 400kbps. Now that I’ve disabled VT-x, no problems yet.
Thanks again.
1 comment
Comments feed for this article
Trackback link: https://www.tolaris.com/2009/11/04/poor-virtualbox-guest-performance-with-intel-vt-x/trackback/