Linux VirtualBox guest suddenly running extremely slow

Apologies for the very long post, I have posted this on the VirtualBox forums but the activity seems to be quite low and no responses yet so if I may, please bear with me here.

Specs

Host Linux 3.2.6-2-ARCH x86_64 | VirtualBox 4.1.8-2 | Guest CentOS 6.2

Host Windows 7 64 bit | VirtualBox 4.1.8 | Guest CentOS 6.2

Background

I use VirtualBox on my laptop, set up with dual boot Windows 7 and Arch Linux. I have a "data" partition for large files and stuff. Here's what my hard drive looks like in Disk Utility (linux):

Screenshot of Disk Utility in Linux

In LTR order: System Reserved | Windows partition (C:/) "sda2" | Data partition "Data" | ArchLinux partition "sda4"

VirtualBox is installed on both OS's, I keep all my VDI files on the Data partition and point VirtualBox to those VDI files. I have only two virtual machines; a Windows XP and a CentOS machine. I actually have 2 copies of the Windows XP VDI, one for accessing from Windows 7 the other from Linux.

The problem

Everything was running fine until yesterday. I booted up my CentOS VM from Linux host only to find that it was crawling along at an unbelievably slow pace. It takes > 5m to boot up as opposed to the normal 30s or so. All operations on the machine are slow aswell, even just moving the mouse is laggy.

What I've tried (all of which result in the same laggy performance)

  • Deleting all the vbox files, leaving only the .vdi file (on my Data drive) and then recreating the virtual machine using the same .vdi
  • Throwing loads of RAM (2Gb) and video memory (the maximum allowed) at the VM
  • Changing settings I thought would effect the performance
  • Installing the Guest Additions and restarting the VM
  • Creating a new virtual machine with a new disk altogether, then booting up with the same CentOS LiveCD that I used to install it originally
  • Restarting the laptop and doing most of the above from Windows host

I was completely confused. I'd established that the VDI file was not corrupt by creating a completely new one and experiencing the same slowness. I'd eliminated a potential host OS issue because it had the same performance from the Windows host.

The only thing I could think of was that my Data drive was somehow corrupt. So I then tried to prove this, by loading up my Windows XP VM from both Linux and Windows host (remember that the Windows vdi file is on the same partition). Oddly, it was absolutely fine and unchanged.

Now I'm really confused. Not a corrupt VDI. Not a corrupt hard drive. Not a corrupt virtualbox installation (I did do a package reinstall on Linux host but not Windows).

[Getting somewhat agitated now]

Next thought - a corrupt CentOS download which somehow has ruined itself sitting on my CD. Test: boot up laptop with LiveCD I used before. Result: no problem at all, totally smooth.

[Scratches head for about half an hour]

Next stage - I'm going at it guns blazing now - backup Data drive, format it to NTFS with Disk Utility, then try again with a fresh CentOS virtual machine. Result: same slow performance issue.

[Feels like crying]

I have pasted the output of the log file for running CentOS from ArchLinux here. I would really really appreciate some help and am more than happy to provide any more information if this wasn't enough, although I'm sure my waffling has gone on long enough already...


I found the problem, VirtualBox had for some reason reset my VM to 32-bit whereas my .vdi was of a 64-bit OS.

To fix this you need to:

  • delete the virtual machine (keep your .vdi file)
  • create a new virtual machine with the wizard
    • On the very first page when it asks you which OS it is, make sure you select the 64-bit version (if you have a 64-bit OS) (in my case: Linux - Redhat 64 bit)
    • otherwise pick the standard one (e.g. Linux - RedHat)

You do not need to:

  • do what I did!

Have virtual fun...


Change the chipset under System->Motherboard in the settings of your virtual machine to ICH9. The Intel chipset works correctly for Red Hat and its kids. CentOS 6.2 was running like a complete dog until I realized what the problem was. Now runs near real time like it should.

Source: LinuxQuestions.org


at my virtualbox setup (ubuntu 13.04 as host, debian 7 as guest) I changed to ICH9 and increased video memory to 129MB and enabled 3D graphic acceleration and debian now runs smoothly.

Not yet checked if only the video RAM increase would have sufficed.


Having very slow perform when running Ubuntu 12.10 and 13.04 in virtualbox? It’s because Ubuntu can’t use graphics card for acceleration, ubuntu uses CPU for rendering graphics trough LLVMpipe. It makes running ubuntu in virualbox really slow.

To check if your Ubuntu 12.10 or 13.04 guest is using 3D acceleration

/usr/lib/nux/unity_support_test -p

You should see something like this

Not software rendered: no
Not blacklisted: yes
GLX fbconfig: yes
GLX texture from pixmap: yes
GL npot or rect textures: yes
GL vertex program: yes
GL fragment program: yes
GL vertex buffer object: yes
GL framebuffer object: yes
GL version is 1.4+: yes
Unity 3D supported: no

If you see “Not software rendered” and “Unity 3D supported” both say no. This means Unity is using slow LLVMpipe.

To enable 3D supported, fist you will need to update linux-headers

uname -r
sudo apt-get install linux-headers-$(uname -r)
sudo apt-get autoremove
sudo apt-get install build-essential

Now insert vitualbox guest iso from devices and to install manually

cd /media
ls
cd username
ls
cd VBOX*
ls
sudo ./VBoxLinuxAdditions.run

Insert vboxvideo to /etc/modules

sudo nano /etc/modules

Add “vboxvideo” at the end of the file

loop
lp
vboxvideo

Reboot the machine

sudo reboot

source: http://namhuy.net/951/how-to-fix-slow-performance-ubuntu-13-04-running-in-virtualbox.html