📜 ⬆️ ⬇️

Almost native Direct3D in VirtualBox

A great open-source virtual machine from InnoTek / Sun / Oracle (underline the right one) was recently updated (among other things, VirtualBox 3.0 announced more or less intelligible support for DirectX 8/9 at the level of the virtual graphics driver in the Windows guest-machine. For good, it should have meant that the idiot gamer’s dream came true: you can drive to any win-toys without performing random home jumps with a tambourine and dried chicken foot. In fact, everything naturally turned out to be not so easy, a micro-howto is offered under the cut, which allows you to run DirectX-toys in a virtual machine

UPD: Thanks for the karma, transferred to the Linux blog for everyone


So, what we need:
')
- Linux box
- VirtualBox 3.0
- WineD3D
- Windows distribution (experiments were performed on XP SP2)
- Distribution of your favorite wind-up toy (executions were performed on Myst V: End of Ages)

The installation process for VBox should not cause any special difficulties: download, run from under the root (su and sudo to help) a binary installer, like this:

root@localhost:[~]# wget dlc.sun.com/virtualbox/3.0.0/VirtualBox-3.0.0-49315-Linux_x86.run
root@localhost:[~]# ./VirtualBox-3.0.0-49315-Linux_x86.run


If nothing abnormal happened and we were happily informed about the successful completion of the installation, then proceed to the next part - that is, the launch of VirtualBox and the installation of Windows in a virtual machine.

It happens that the installer cannot correctly determine the distribution, in connection with which it starts to panic and refuses to assemble the nuclear module. However, it is treated quite simply:

root@localhost:[~]# cd /opt/VirtualBox/src
root@localhost:[/opt/VirtualBox/src]# ls
Makefile vboxdrv vboxnetadp vboxnetflt
root@localhost:[/opt/VirtualBox/src]# make


Next, make sure that the nuclear module is loaded:

root@localhost:[/opt/VirtualBox/src]# lsmod |grep vboxdrv
vboxdrv 107720 0
root@localhost:[/opt/VirtualBox/src]#


If not, then:

root@localhost:[/opt/VirtualBox/src]# modprobe vboxdrv

OK, we assume that we have a VBox. Then everything is simple, we create a virtual machine, not forgetting to go to “Properties” after creation and tick off “Enable IO APIC”, and “Enable 3D acceleration”. Video memory allocate at least 32 megabytes, then connect the image or the physical CD / DVD-drive and put your favorite build Windows.

After installation, we boot and begin to shaman. In fact, at this stage we already have support for 3D acceleration, but the problem is that only OpenGL can speed up the driver. This can be easily verified by running dxdiag.exe. It is logical to assume that if DirectX (9c for example) is missing you need to install it. That is, at the stage when we start installing Guest OS Addons, DirectX should already be present in the system.

Next, actually perform the installation Guest Addons - Devices> Install Add-ons Guest OS. We answer the provocative questions of the wizard “Continue installation anyway”. Reboot.

Now you need to install WineD3D - a set of DLLs from the wine distribution kit, which will replace the native DirectX DLLs. This is necessary in order for DirectX requests to be broadcast in OpenGL (as it happens when we launch toys under Vine). You can download it here - download.savannah.nongnu.org/releases/wined3d/latest/wined3d.exe

The only note relates to the fact that the freshly exe exec needs to be started in safe mode, for which you will have to reboot again.

Well, now you can try to put toys. On the integrated Intel graphics, Myst V shamelessly braked and painted artifacts, but with the increase in the amount of virtual video memory to 128 MB, the situation has noticeably changed for the better. There were no other toys at hand, so unsubscribe about the successful and not-so-great attempts to play that or the game in VBox.

Total: certainly not a panacea, but already something ... We are waiting for further driver improvements.

Ps. Do not judge strictly - this is my first habrapost

Source: https://habr.com/ru/post/63534/


All Articles