Wednesday, November 30, 2011

Installing WineD3D on WIndows 7 running in VirtualBox

Installing WineD3D on WIndows 7 running in VirtualBox: the easy way

 

As you may know, you can get support for Direct3D in Windows guests running in VirtualBox through the use of Wine's Direct3D OpenGL compatibility layer, WineD3D.
The main problem is getting the installer to work. Even if you know, as I do, how to cross-compile on Linux, I still recommend downloading the pre-compiled binary installer because it helps you to know where all the files go on Windows.

Most seem to be recommending installation in Safe Mode, which only partially works; even Administrator doesn't have permission to overwrite some of the Windows binaries. Rather than beating yourself over the head running the Windows installer, do yourself a favor and download the ISO9660 image, and then, if you don't have one already, obtain a copy of SystemRescueCD, which, if you support Windows machines, you really, really need one of these. Trust me. In this case, you don't have burn it, just download the ISO and put it somewhere convenient.


Okay, here we go.

Launch VirtualBox and edit the settings in your VM. Add the System Rescue CD ISO as one of your CD devices. Add another CD device (if you don't already have two), and then map that one to the WineD3D ISO:

Next, you want to make sure that the boot order is set to boot the CD:

Finally, if you haven't already done so, you need to enable 3D acceleration support. Enabling 2D acceleration support is also a good idea. You need to to set aside at least 32 MB of RAM for video. I 'd go with 64 MB, if possible.

Once you've got all your settings, you need to boot the System Rescue CD. When you (finally) get to a shell prompt, mount your Windows C: drive with something like:
ntfs-3g /dev/sda1 /mnt/windows
Next, mount the WineD3D ISO on /mnt/custom with something like:
mount /dev/sr1 /mnt/custom
Now, change directories somewhere on your NTFS partition, like /mnt/windows/Temp /mnt/windows/Windows/Temp, or you could mount an NFS or CIFS mount somewhere, whatever; you just need somewhere to extract /mnt/custom/wined3d.exe:
mount /path/to/somewhere/writeable /mnt/gentoo # (optional)
cd /mnt/gentoo
mkdir wined3d
cd wined3d
7z x /mnt/custom/wined3d
Now you just copy the contents of $SYSDIR into /mnt/windows/Windows/System32 and the contents of $WINDIR into /mnt/windows/Windows (do not be concerned with the remaining file, $PLUGINSDIR/sm_cleanboot.dll; this is just a plugin for the Nullsoft Installer):
cp '$SYSDIR' /mnt/windows/Windows/System32
cp -r '$WINDIR' /mnt/windows/*
From there, you should manually unmount /mnt/windows before rebooting:


umount /mnt/windows
reboot

No comments: