Page 1 of 1

VirtualBox sometimes fast, most of time slow

Posted: 23. Sep 2008, 21:56
by countercraft
Hi people, there's something very weird with my VirtualBox. I'm trying to install Windows XP on it, but it's too slow. But it's weird because two times, when I tried to install windows again, Virtualbox was very very fast! So I decided to make some tests: I reinstalled Arch Linux AMD64 (the distribution that I'm using as host), and then started to install windows on VirtualBox. Surprise: it was slow again. So I installed Fedora 9 AMD64 on my note, and tried to install windows again. And VirtualBox was very fast again! So I reinstalled Fedora with the same configurations as before, and VirtualBox was slow again! I tried too with Debian AMD64, Arch Linux i686 and Slackware, but VirtualBox was slow too.
Now I'm with Arch Linux AMD64 as host, and tried to install windows xp again, but it was too slow...
I tested VMware, and it flies like VirtualBox did few times...
So anyone know why VirtualBox has this weird behaviour? I want to use it, but I need to solve this problem first.

I tested with VirtualBox 2.0.2, both closed and OSE versions.

My notebook's specs:
Celeron M 530 1.73 GHz
1 GB RAM
HD SATA 100 GB

Thanks in advance.

Posted: 24. Sep 2008, 20:38
by Sasquatch
Did you use the exact same settings for the Guest? Was the Host using the same amount of memory and not swapping?

Posted: 27. Sep 2008, 08:10
by countercraft
Yes, I used exactly the same settings for the host, and the host wasn't swapping. I have 1 GB RAM, and left 450 MB for the guest, and I was in LXDE, so the host wasn't consuming more than 150 MB RAM.

Re: VirtualBox sometimes fast, most of time slow

Posted: 21. Jun 2009, 15:58
by countercraft
Sorry to be raising this topic, but I finally found the solution for my problem. It's caused by the audio driver of the VM. If set to ALSA or PulseAudio, the VM gets very slow (I mean really really slow). Furthermore, if the audio driver is set to OSS or None, the VM gets very fast (nearly native performance). But using OSS driver I have some troubles, like the soundcard being locked by VirtualBox (the VM has audio, but the host not), or being locked by host (the host has audio, but the VM not). It would work perfectly if I could use ALSA driver. Does anyone knows how to solve this?

Thanks in advance.

Re: VirtualBox sometimes fast, most of time slow

Posted: 4. Jul 2009, 20:23
by mrmoney
hey, thanks for posting this. I came on here looking for solutions/explanations to my (INCREDIBLY!) slow Virtualbox performance, and your post solved my troubles. It is the Audio settings absolutely... I can live without sound if that is what it takes

Re: VirtualBox sometimes fast, most of time slow

Posted: 4. Jul 2009, 22:18
by Sasquatch
Jaunty has problems with PulseAudio if you use 6 channels (5.1surround). Either use a different setup, or install a newer PulseAudio version. Check Launchpad.net for bug reports, I wrote in one with a solution.

Re: VirtualBox sometimes fast, most of time slow

Posted: 5. Jul 2009, 12:23
by Runaway1956
OK, first off, I'm no Linux guru. I solved the sound problems, but I'm such a dumbass that I can't document all the steps. Google is your friend, though. ;)

Uninstall Alsa and Pulse. Completely uninstall, purge them, you don't want ANYTHING left on your system - no libraries, nada.

Install OSS4. Yes, that is OSS4. OSS shows up in many repositories and distros as being deprecated, and that is true. OSS version 3.x is indeed deprecated, and it was closed source anyway. OSS4 is open source and it works fine.

Almost every how-to I read insists that after installing OSS4 you need to reboot. Maybe not, but I did so when I ran into difficulties.

I had hell getting VBox to recognize and use the OSS4 drivers. You need to edit a couple configuration files to make it all work together. Again, I'm not a Linux guru, so I'm not even going to list the files - Google will take you to people who KNOW what they are talking about. ;)

The root problem with sound, is timing. Using Alsa and/or Pulse, the sound goes through to many layers before it finally hits the hardware. Using OSS4, sound goes directly from the guest to the soundmixer, to the hardware. I now have good sound from the guest, AS WELL AS simultaneous sound from the host. It's sweet.

OSS4 is currently at version 4.1 build 1052 for Linux, Solaris, FreeBSD and SCO OSR5.

http://4front-tech.com/forum/viewtopic.php?t=3133

Good luck!!

Re: VirtualBox sometimes fast, most of time slow

Posted: 5. Jul 2009, 12:58
by TerryE
Not sure what OSS4 brings to this party.

Re: VirtualBox sometimes fast, most of time slow

Posted: 26. Jul 2009, 08:41
by Runaway1956
Sorry, haven't checked in here, in some time.

OSS offers mixing from multiple sources, primarily. Many people have noted that when using ALSA, only one source of audio can be heard at any given time. Many posts, on different forums have complained that if, for instance, VLC is playing, there will be no sound in a flash presentation in Firefox. Likewise, if the host operating system is using ALSA for any purpose, then the guest OS has no sound.

Allow me to stress, that the OSS available in Ubuntu's repositories, and probably most other OS' repositories, just doesn't do the trick. OSS3 is closed source, with all that implies. OSS4 is opensource, and it works beautifully.

All audio applications, both inside and outside the VM are audible, at the same time using OSS4, all at normal speed.

Re: VirtualBox sometimes fast, most of time slow

Posted: 26. Jul 2009, 10:29
by Sasquatch
ALSA can handle multiple sources and has no problems with playing them at the same time. I've made a mistake when I was using Linux for only a few days, but I soon learned I selected the wrong output source, namely the hardware directly. My laptop uses ALSA and I can let a VM play music, have Audacious play my radio stream and watch videos on YouTube, all with audio. And I haven't changed a think in my set up. All you have to do, is make sure that IF you can select multiple sources for output, you don't select the hardware itself, but the ALSA device (like Default, instead of hw0,0). If you do select the hardware, it will be locked and ALSA won't be able to access it anymore.