Changing disk controller in virtualbox with linux guest

With virtual box, you can easily change the disk controller from IDE to SATA. This is nice because SATA is supposed to be faster than IDE even in virtualization.

But after that change, your linux VM will no longer boot because grub (in my case) still refers to IDE (/dev/hda1). In order to boot , press e on grub screen and replace /dev/hda1 by /dev/sda1. This will let you boot.

If you want to make this change persistent, edit /boot/grub/menu.lst, then :

Update current config :
At the very end of the file, there are your boot configurations.

title Debian GNU/Linux, kernel 2.6.26-2-486
root (hd0,0)
kernel /boot/vmlinuz-2.6.26-2-486 root=/dev/hda1 ro quiet
initrd /boot/initrd.img-2.6.26-2-486

Make the change here. This will make the change persistent until the next kernel upgrade. THIS IS NOT ENOUGH : be sure to do the last step.

Update default config
Locate the comment line (starting with #) containing the default boot options (including the device : /dev/hda1). For my box, this is :

# kopt=root=/dev/hda1 ro

Make the change here too. This line is used to regenerate menu.lst each time apt-get dist-upgrade updates the linux kernel.