Jump to content

VMware SVGA II display driver for Leopard


20 posts in this topic

Recommended Posts

Attached is a VMware SVGA II display adapter driver for OSx86 Leopard running as a VMware guest.

 

Supported features

  1. Set one of 13 pre-canned display modes from System Preferences/Displays pane.
  2. Hardware cursor support.
  3. Optional EDID injection via Info.plist

Upsupported features

  1. Video overlay
  2. 2D/3D Acceleration
  3. multi-monitor

Please create a snapshot before installing so you can revert if something goes wrong.

 

To use, install VMsvga2.kext in /System/Library/Extensions and reboot.

 

If the driver doesn't work, you can boot in console (-s) or safe-boot (-x) mode and nuke the driver.

 

Source code is attached.

 

kernel boot parameters that apply

  1. vmw_log_fb=number 1 to 5.
    logging level, with 1 (the default) the lowest and 5 the highest.
    logging is done to guest syslog.log and host vmware.log.
  2. vmw_fps=number 1 to 100
    sets framebuffer refresh rate. Default is 20 times/sec.
    The refresh timer is only used if the host doesn't support tracing.
  3. vmw_options=set of flags, useful mostly for development
    setting vmw_options=0 will disable the use of VMware's FIFO. Display mode
    changes will still be available, but no hardware cursor. If the normal
    mode doesn't work for you, try this mode.

The driver was tested with:

Workstation 6.5.2

OSx86 10.5.7 with near-vanilla Darwin 9.7 kernel

 

If you can't use VMware's USB mouse emulation, there's a PS/2 vmmouse driver here.

 

Credits:

The driver is based on a reconstruction of VMwareIOFramebuffer.kext from Fusion 2.0.5.

I added a guest-side refesh timer to preiodically update the framebuffer if the host doesn't support tracing with FIFO enabled. The driver should still work if the host supports tracing (e.g. with a Fusion host), but I haven't tested it.

Also added some code from VMware's reference SVGA implementation found on sourceforge and X.Org's xf86-video-vmware-10.16.6.

 

EDIT [July 14]: uploaded new version - fixed bug in user client.

EDIT [Aug 5]: there's an attachment in post #3 for fit-guest support.

EDIT [sep 25]: removed attachments and linked to newer version.

 

Old Download Counts

VMsvga2_1.0.0_Src.tar.gz - 53 downloads

VMsvga2_1.0.0.kext.tar.gz - 248 downloads

 

Go here for latest version.

Link to comment
Share on other sites

Attached is a VMware SVGA II display adapter driver for OSx86 Leopard running as a VMware guest.

 

Supported features

  1. Set one of 13 pre-canned display modes from System Preferences/Displays pane.
  2. Hardware cursor support.
  3. Optional EDID injection via Info.plist

Upsupported features

  1. Video overlay
  2. 2D/3D Acceleration
  3. multi-monitor

Please create a snapshot before installing so you can revert if something goes wrong.

 

To use, install VMsvga2.kext in /System/Library/Extensions and reboot.

 

If the driver doesn't work, you can boot in console (-s) or safe-boot (-x) mode and nuke the driver.

 

Source code is attached.

 

kernel boot parameters that apply

  1. vmw_log_fb=number 1 to 5.
    logging level, with 1 (the default) the lowest and 5 the highest.
    logging is done to guest syslog.log and host vmware.log.
  2. vmw_fps=number 1 to 100
    sets framebuffer refresh rate. Default is 20 times/sec.
    The refresh timer is only used if the host doesn't support tracing.
  3. vmw_options=set of flags, useful mostly for development
    setting vmw_options=0 will disable the use of VMware's FIFO. Display mode
    changes will still be available, but no hardware cursor. If the normal
    mode doesn't work for you, try this mode.

The driver was tested with:

Workstation 6.5.2

OSx86 10.5.7 with near-vanilla Darwin 9.7 kernel

 

If you can't use VMware's USB mouse emulation, there's a PS/2 vmmouse driver here.

 

Credits:

The driver is based on a reconstruction of VMwareIOFramebuffer.kext from Fusion 2.0.5.

I added a guest-side refesh timer to preiodically update the framebuffer if the host doesn't support tracing with FIFO enabled. The driver should still work if the host supports tracing (e.g. with a Fusion host), but I haven't tested it.

Also added some code from VMware's reference SVGA implementation found on sourceforge and X.Org's xf86-video-vmware-10.16.6.

 

EDIT [July 14]: uploaded new version - fixed bug in user client

 

Thanks for this. It gets around the problem of not loading due to the missing capability of the WKS 6.5 host. I was wondering whether it was possible to allow screen resizing based on the sample code here http://vmware-svga.svn.sourceforge.net/vie...resolution-set/

 

(BTW - the Fusion video driver does work correctly on the beta of Workstation 7, including auto-sizing the guest)

Link to comment
Share on other sites

I was wondering whether it was possible to allow screen resizing based on the sample code here http://vmware-svga.svn.sourceforge.net/vie...resolution-set/

There's a simpler way. The Darwin VMware Tools in Fusion 2.0.5 have a utility called vmware-tools-guestd that supports autofit-guest (it implements the functionality of the resolution-set sample). The reason it doesn't work with my driver is because of the class name change VMwareIOFramebuffer --> VMsvga2.

I patched the utility with a hex editor to use the correct driver class name. It's attached below.

The utility should be placed in

/Library/Application Support/VMware Tools

 

Keep a copy of the original if you replace it.

 

I did a superficial test to see if autofit-guest works, and it seems ok. Please report any problems here and I'll try to fix bugs in the user client.

 

Edit: (11/8/2009): attachment removed, search here for the latest patches.

 

vmware_tools_guestd.zip Download Count: 106

Link to comment
Share on other sites

There's a simpler way. The Darwin VMware Tools in Fusion 2.0.5 have a utility called vmware-tools-guestd that supports autofit-guest (it implements the functionality of the resolution-set sample). The reason it doesn't work with my driver is because of the class name change VMwareIOFramebuffer --> VMsvga2.

I patched the utility with a hex editor to use the correct driver class name. It's attached below.

The utility should be placed in

/Library/Application Support/VMware Tools

 

Keep a copy of the original if you replace it.

 

I did a superficial test to see if autofit-guest works, and it seems ok. Please report any problems here and I'll try to fix bugs in the user client.

 

Will test it in a day or so as pretty busy with work. One thing if you are feeling brave is to see if it is possible to compile VMware open tools and come up with an independent installer. I did start with this but not enough experience of Mac builds.

Link to comment
Share on other sites

The driver works great :P thanks. Just what i was looking for. Also the autofit thing works well! Also is it possible for 2d/3d acceleration to be implemented? I can understand if it can't as no one else has been able to do it before...

Link to comment
Share on other sites

Also is it possible for 2d/3d acceleration to be implemented? I can understand if it can't as no one else has been able to do it before...

And there's a good reason for that... Apple doesn't properly document how to write graphics accelerators for Mac OS X. In order to support acceleration it's necessary to write four types of plugins

  1. A CFPlugin for the blitter interface in IOGraphicsLib.
  2. An IOAccelerator object to implement the IOAccelSurfaceControl object in IOGraphicsLib.
  3. An OpenGL plugin
  4. A video rendering plugin.

Acceleration support drivers for existing video adapters are huge (over a megabyte of machine code each), so even partly decoding them in order to understand what they do is difficult. Source code for IOGraphicsLib is available, so that helps a little.

 

Another issue is that VMware have deprecated their 2D acceleration API in favor of their Direct3D passthrough support. So in order to support just the 2D accelerator, it's necessary to figure out how to translate it to Direct3D.

 

So I'm not promising anything, but I'll probably look into it some time.

 

One thing if you are feeling brave is to see if it is possible to compile VMware open tools and come up with an independent installer. I did start with this but not enough experience of Mac builds.
The Mac OS X driver model is radically different from Linux or FreeBSD driver models, so it's not possible to port a driver by just recompiling. The driver needs to be re-engineered to comply with Apple's model.

 

Anyhow, as for the drivers themselves

  • The most important one is vmhgfs which has already been ported by VMware, is available in the darwin VMware tools and works (although the fmask and dmask settings don't seem to work right).
  • vmxnet is redundant, since VMware supports emulating the Intel E1000 card which has an Apple-supplied driver.
  • The other drivers perform useful back-end functions, but I'd rather focus on front-end functions like video and audio.

Link to comment
Share on other sites

And there's a good reason for that... Apple doesn't properly document how to write graphics accelerators for Mac OS X. In order to support acceleration it's necessary to write four types of plugins

  1. A CFPlugin for the blitter interface in IOGraphicsLib.
  2. An IOAccelerator object to implement the IOAccelSurfaceControl object in IOGraphicsLib.
  3. An OpenGL plugin
  4. A video rendering plugin.

Acceleration support drivers for existing video adapters are huge (over a megabyte of machine code each), so even partly decoding them in order to understand what they do is difficult. Source code for IOGraphicsLib is available, so that helps a little.

 

Another issue is that VMware have deprecated their 2D acceleration API in favor of their Direct3D passthrough support. So in order to support just the 2D accelerator, it's necessary to figure out how to translate it to Direct3D.

 

So I'm not promising anything, but I'll probably look into it some time.

 

The Mac OS X driver model is radically different from Linux or FreeBSD driver models, so it's not possible to port a driver by just recompiling. The driver needs to be re-engineered to comply with Apple's model.

 

Anyhow, as for the drivers themselves

  • The most important one is vmhgfs which has already been ported by VMware, is available in the darwin VMware tools and works (although the fmask and dmask settings don't seem to work right).
  • vmxnet is redundant, since VMware supports emulating the Intel E1000 card which has an Apple-supplied driver.
  • The other drivers perform useful back-end functions, but I'd rather focus on front-end functions like video and audio.

 

Understand and I know that the drivers do work, as have been building VMware setups for 18 months now.

Link to comment
Share on other sites

Understand and I know that the drivers do work, as have been building VMware setups for 18 months now.
Ok, sorry, I got the impression from a cursory look that it's just Linux, Solaris & FreeBSD drivers in there. I'll look at it when I get the time, but the svga driver is priority, and I've unrelated work :)
Link to comment
Share on other sites

Tried the driver and it works great - thanks!

 

One issue I have which is rather annoying is that it has made the mouse pointer disappear unless it is currently being moved. In other words I see the pointer if I am actually moving the mouse around but it disappears if I stop.

 

Any ideas??

Link to comment
Share on other sites

One issue I have which is rather annoying is that it has made the mouse pointer disappear unless it is currently being moved. In other words I see the pointer if I am actually moving the mouse around but it disappears if I stop.
I couldn't reproduce the problem with any mouse driver I have, but try the attached version and see if it makes a difference. I made a modification to the refresh code that may help. It syncs the FIFO every 1/2 second.

 

[Edit 9/25]: Attachment removed, see the link in post #1 for latest version of the driver.

Link to comment
Share on other sites

Thanks, but I can't seem to download it at the moment to try. I think it must be a general problem with the forums though.

 

Any chance of uploading it somewhere else or emailing it to me if it doesn't get fixed soon?

Link to comment
Share on other sites

OK - Downloaded successfully today.

 

Still the same issue with the flickering mouse but I managed to fix it by installing your VMWare mouse driver that you mentioned in the original post. It must be a problem with the default VMWare USB mouse emulation

 

Thanks for your help.

Link to comment
Share on other sites

Zenith432, I have iATKOS v7 installed in VMWare Server 2.01 and I have downloaded the last kext you have posted for the VMWare SVGA II driver. When OSX boots I get the error "System extension cannot be used. The system extension "/System/Library/Extensions/VMsgva2.kext" was installed improperly and cannot be used. Please try reinstalling it, or contact the product's vendor for an update".

 

I installed it by unpacking the downloaded file with Archive Utility and copied the resulting VMsvga2.kext to the System/Library/Extensions folder. Should I have done anything differently or additionally?

 

Thanks!

 

 

 

Zenith432, I have iATKOS v7 installed in VMWare Server 2.01 and I have downloaded the last kext you have posted for the VMWare SVGA II driver. When OSX boots I get the error "System extension cannot be used. The system extension "/System/Library/Extensions/VMsgva2.kext" was installed improperly and cannot be used. Please try reinstalling it, or contact the product's vendor for an update".

 

I installed it by unpacking the downloaded file with Archive Utility and copied the resulting VMsvga2.kext to the System/Library/Extensions folder. Should I have done anything differently or additionally?

 

Thanks!

 

OK, found an tool to correct that error (Kext Helper b7), but I can't change the resolution....

Link to comment
Share on other sites

  • 2 weeks later...

First of all thanx for sharing this

 

"I installed it by unpacking the downloaded file with Archive Utility and copied the resulting VMsvga2.kext to the System/Library/Extensions folder. Should I have done anything differently or additionally?"

 

i have done the same thing, but i am not able to change the resolution of the screen. i usually go in system preferances and then displays......but there is only one resolution setting 1024*768. i want to have different once.

 

Let me know if you can help...( guest mac os user on windows using VMware workstation)

Link to comment
Share on other sites

"I installed it by unpacking the downloaded file with Archive Utility and copied the resulting VMsvga2.kext to the System/Library/Extensions folder. Should I have done anything differently or additionally?"

yes, you need to install the kext with kexthelper or osx86tools. otherwise they are not installed correctly and hence your problem.

Link to comment
Share on other sites

I have installed the VMsvga2.kext using the KextHelperB7 tool and i can see it in System/Library/Extensions but when i reboot it seems to do nothing :

 

a. System Profiler shows a Type: Display in Hardware > Graphics / Displays and "No Kext Loaded"

 

b. System Preferences > Display shows same single resolution of 1024 x 768

 

How can i tell if the driver has loaded ?

 

What am i doing wrong ?

 

I am running a vanilla Leopard 10.5.6 install on VMWare Workstation 6.5.2

Link to comment
Share on other sites

 Share

×
×
  • Create New...