How To: Switch a VirtualBox Windows Guest Hard Drive from IDE to SATA Mode

By default, any Hard Drives you create for your Virtual Machines use a virtual IDE controller, which takes more CPU to operate and is slower in operation than a virtual SATA controller. So, it’d be nice to just flick a switch and say Use a virtual SATA controller instead and get instantly higher disk performance, right? Only Windows will BSOD on you if you try that, so you have to do a bit of tweaking first for it to work.

1.) While Vista and Windows 7 come pre-installed with SATA drivers, XP does not – so if your virtual guest OS is XP you’ll need to go get the Intel Matrix Storage Driver from here. Note: Please see the bottom of this article for Windows 7 IDE to SATA instructions.

Update: Some people have reported that Intel have changed the version of the Matrix Manager and it no longer works with VirtualBox (see comments), so instead, why not try this, which is the version of the Intel SATA Matrix Manager driver I used when I did this originally. Launch the installer and slap Next/Next/Finish until it’s installed.

Install Intel Matrix Storage Driver

2.) Next we need to remove our current IDE/ATAPI Drive Controllers from the Device Manager, so right click on My Computer and select Manage from the pop-up menu, then click on Device Manager in the left pane of the Computer Management window and expand the IDE ATA/ATAPI controllers section in the right pane.

Manage My Computer

IDE ATA/ATAPI Controllers

3.) You should see Primary and Secondary IDE Channels, plus some other bits as pieces as shown in the screenshot above – now it’s time to delete them by selecting each one in turn and then pressing the delete key on the keyboard. It might look like a dodgy thing to do, but trust me – I found this trick out while working as a Subsystem Integration bod. If you’ve got one build running on one piece of hardware, and you want to transfer the entire build (via ghost or whatever you want) to another piece of hardware with different controllers, you’ll get a BSOD unless you first delete the drive controllers like this, backup your build, and then ghost it to your new hardware setup.

After you delete each one Windows will say you need to reboot for changes to take effect – don’t. Get rid of as many device controllers as you can, and don’t worry if the Primary IDE controller comes back on its own as soon as you’ve removed it, it’s just there to keep things ticking over until you finally do reboot.

Remove IDE Controller

Don't Reboot Windows Yet

4.) Power off (not suspend) your Virtual Machine then click on the Settings button with the machine you’re working on selected. Then, under the Storage item of the left pane remove your virtual machines hard drive from the IDE Controllers section, add a New Controller and choose SATA Controller, then add your virtual hard drive to the new SATA Controllers section as shown below:

Switch Virtual Hard Drive From IDE to SATA

5.) Boot up your virtual machine and once logged in let it thrash around setting up your new devices. Once it’s done that, it’s gonna be rather keen to reboot. Let it.

Windows is keen to reboot

6.) After you’ve rebooted from the above step, hover your mouse cursor over the drive activity icon and you’ll see it’s running under a SATA controller; lower cpu usage and faster disk throughput is deservedly yours :)

VirtualBox running SATA controller

Note: VirtualBox will set SATA Controllers 0 through 4 to work in IDE compatibility mode by default, so you might want to switch to SATA Controller port 5, or anything higher than 4 to run in true SATA mode, only when I tried this (after first leaving it as port 0 and booting, admittedly) the machine couldn’t find the drive if I switched it to 5. Could be try that before rebooting after IDE -> SATA controller change, but I’m not in the mood to go through all that again.

If you want more info, try: Understanding and Configuring Virtual Box Hard Disks

Cheers!

Credits: Article based on and adapted from Matt Bottrell‘s IDE -> SATA changeover technique found here.

Update for Windows 7 IDE to SATA migration: If you want to switch a drive from a IDE controller to a SATA controller in Windows 7, then you need to perform the following steps:

  1. Make sure that both a SATA and your current controller are being presented to Windows. The SATA controller doesn’t need to have any disks attached to it. Once you have done so boot up Windows.
  2. Remove the IDE controller as described in the above URL [which is Step 2 in this article -r3dux]. Shutdown Windows from inside the guest.
  3. Move the image over to the SATA controller by removing it from your current controller and adding it to the SATA controller
  4. Boot up Windows again and it should boot into Windows, detect the changes and prompt you to restart when done as per the above instructions

Props to NetMusician.org for the Win 7 adaptation!

How To: Use a Wired XBox 360 controller in Linux

Just in-case ya wanna, and because it took me ages to get it working the other week….

To check if the driver is there when you plug the controller in use:

If the device is detected you’ll see something like:
info.product = ‘Microsoft X-Box 360 pad’  (string)
input.product = ‘Microsoft X-Box 360 pad’  (string)

xbox360-linux

Now… The left analog stick will grab the mouse cursor – it’s a known bug. Excellent thread on it (where I eventually found solution): https://bugs.launchpad.net/ubuntu/+source/xorg-server/+bug/274203

If you’re using KDE, you can look in System Settings | Joystick (sudo apt-get install joystick if that option isn’t available) to see if you can get input/move stuff, if you can only move cursor w/ left analogue but buttons don’t register (joystick should be /dev/input/js0 btw) then you need to grab: sudo apt-get install xserver-xorg-input-joystick

In Gnome, there isn’t a joystick app available with the default install, so just run jstest (part the above installed joystick package) from the command line to see if the joystick’s registering.

To stop the mouse cursor being grabbed by the joystick, edit /etc/X11/xorg.conf and add the following lines near the beginning:

Section “ServerFlags”
Option “AutoAddDevices” “False”
EndSection


Also, for calibration don’t use jscalibrator or jstest – they just frack things up (in my experience) – use the kde system settings one. This obviously assumes you have KDE installed, which I do… so good stuff ;)

MAME on! =D

Bonus xmame hint: If a game will run close to full speed and you want to give it a bit off a boost – turn off automatically adjust frameskip and set it to 0 to speed things up – should hit full whack. Those frameskip adjusting algorithms are cpu intensive.

Update: I’ve switched from KDE to Gnome, and in Jaunty 9.04 64-Bit you can just plug the controller in and it’ll work without grabbing the mouse cursor and knackering stuff to the point you need to tweak your xorg.conf. Jolly good.