12.04 Ubuntu is extremely slow

Discussions about using Linux guests in VirtualBox.
DNS
Posts: 107
Joined: 2. May 2011, 00:16
Primary OS: MS Windows 7
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: xp win7

Re: 12.04 Ubuntu is extremely slow

Post by DNS »

Tried to go ahead and try that with NetBSD, but wasn't so lucky.

Full error which could help:

Code: Select all

fatal trace trap in supervisor mode
Trap type 5 code 0 eip cs 8 eflags 42506 cr2 0 ilevel 1
Stopped in pid 0.17 (system) at netbsd:Xspllower+0x12: aas
db{0}>
and at other times:

Code: Select all

fatal page fault in supervisor mode
trap type 6 code 0 eip c0100d27 cs 8 eflags 10047 cs2  0ilevel 8
kernel: supervisor trap page fault, code=0
stopped in pid 016 (system) at netbsd:Xspllower+0x17 addb %al,0(%eax)
db{0}>
It is always a problem with these two cpu instructions. Is that enough info to help? will it be relativly simple to tweak them?
michaln
Oracle Corporation
Posts: 2973
Joined: 19. Dec 2007, 15:45
Primary OS: MS Windows 7
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Any and all
Contact:

Re: 12.04 Ubuntu is extremely slow

Post by michaln »

DNS wrote:I can confirm that it was because IOAPIC wasn't enabled by default all along! When it is, OpenBSD functions normally without VT-x.
Interesting. From my own experience I can say that some other OSes also can't deal with this, and usually don't have any kind of useful error reporting. They just assume that the I/O APIC must be present because... er... it just has to :)
vushakov
Oracle Corporation
Posts: 29
Joined: 18. Sep 2012, 16:13

Re: 12.04 Ubuntu is extremely slow

Post by vushakov »

DNS wrote:Tried to go ahead and try that with NetBSD, but wasn't so lucky.
There are several problems with running NetBSD under raw mode. Attached is the patch for NetBSD/i386 that I use.

The patch to i386/i386/spl.S is the most important one.

I think that instead of the patch to x86/x86/patch.c you can just compile the kernel with -fno-optimize-sibling-calls, but I'm not 100% sure. "When in doubt, use brute force".

The rest of the patch moves cpu_info::ci_tss to a page of its own which improves performance dramatically - otherwise all curcpu accesses has to be trapped by VBox since the rest of curcpu is on the same page with the TSS that VBox shadows.
Attachments
netbsd-vbox-raw-mode.zip
NetBSD patch (kludge) to make NetBSD work under VBox raw mode.
(1.4 KiB) Downloaded 16 times
rschmied
Posts: 18
Joined: 5. Jan 2010, 11:42
Primary OS: Ubuntu other
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: various
Location: Germany

Re: 12.04 Ubuntu is extremely slow

Post by rschmied »

wanted to point you guys to

https://www.virtualbox.org/ticket/9756

I have a similar sounding problem where Linux w/ 2.6.18 runs as expected on older / non VT-x CPUs but newer Kernels are extremely slow. Interestingly, newer BSD kernels don't show the issue. I think this is caused by the timer calibration which is way off for newer kernels and even causes the kernel to show a stack trace / OOPS during boot up / timer calibration with the latest CentOS 6.3 kernels. CentOS 5.8 w/ 2.6.18 works perfect on the same hardware.
michaln
Oracle Corporation
Posts: 2973
Joined: 19. Dec 2007, 15:45
Primary OS: MS Windows 7
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Any and all
Contact:

Re: 12.04 Ubuntu is extremely slow

Post by michaln »

If you can understand Linux timers, we'd love to get some help... unfortunately the Linux folks seem to change their mind every month or so on which time source they should be using, which makes supporting Linux a lot harder and more fiddly than Windows/Solaris/whatever.

If it's really an issue from a specific time source, you may be able to convince Linux to use a different one. That might help with figuring out what exactly is wrong.
rschmied
Posts: 18
Joined: 5. Jan 2010, 11:42
Primary OS: Ubuntu other
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: various
Location: Germany

Re: 12.04 Ubuntu is extremely slow

Post by rschmied »

Unfortunately, I don't. However, if Linux timer calibration is really an issue in general, I'd highly recommend to adapt the solution mentioned in ticket #9756 (detect_hypervisor_vendor). If done right, Linux can transparently get the correct TSC frequency direct from the Hypervisor and doesn't have to do any sort of calibration which apparently seems to be error prone and changes every month or so, as you said :) That should not be too hard if you guys have a similar API available that is accessible from within the VM (assuming that guest additions use such an API to communicate with the Hypervisor). hypervisor.c allows for easy extension and already has code for VMware, Hyper-V and Xen. Apparently, VirtualBox is missing...
nonix66
Posts: 1
Joined: 15. Nov 2012, 10:37

Re: 12.04 Ubuntu is extremely slow

Post by nonix66 »

I have installed Ubuntu 12.04 32bit Desktop as guest on Windows XP (32bit) host, using VB 4.2.4. The install was done mostly with default settings on either end. After installing guest additions and enabling the 3D video acceleration the system slowed down with rate more then 10x.

Disabling the 3D acceleration helped to restore the performance.
Post Reply