Linux VirtualBox guest suddenly running extremely slow

virtualbox

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…

Best Answer

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...

Related Question