VMware Communities > VMTN > Desktop Products > VMware Fusion > Documents

A Power User's Guide to VMware Fusion

VERSION 20 Published

Created on:Sep 24, 2007 8:29 PM by etung - Last Modified:  Jun 15, 2008 6:10 PM by etung

Disclaimer: This is a personal document and is not official or endorsed by VMware. Feedback, suggestions, and edits are welcome.

This document is primarily intended for people who have used Fusion for a while and are curious about how to do more advanced things. People who have used other VMware products may be interested in this as a reference for where to find settings. This document describes configurations which have no UI settings and are not supported, but are still useful. This document assumes you are familiar with A Beginner's Guide to VMware Fusion.

Important: Whenever you do file operations (move, copy, edit, delete, etc.) to a VM, make sure it is powered down and Fusion isn't running. You don't want to change the data out from under Fusion.

If you want to be notified of changes and additions to this document, you can use the "Receive email notifications" action in the sidebar on the left. Please use the comments below only for things specific to this document; general questions are better off in the discussion section.

A tool you may find handy is VMX Extras, which is a GUI way to change some of these settings.

Fit Full Screen

When you switch to fullscreen mode in a guest without tools installed or a guest which changes the screen resolution, you might notice black borders around the screen since the host resolution remains the same. You can tell Fusion to scale the guest to the host's resolution by editing /Users/yournamehere/Library/Preferences/VMware Fusion/preferences to include the line
pref.autoFitFullScreen = "fitHostToGuest"

If the preferences file doesn't exist, create it as a plain text file. If the autoFitFullScreen line exists, replace it or comment out the old line.

Note: This setting doesn't currently work in 2.0b1. I think it has to do with the changes for multiple monitors in the guest.

Boot Delay

Fusion's BIOS flashes by very quickly - this is good for normal use (optimize the common case!) but annoying if you want to change a BIOS setting. You can slow down the boot process by adding the following line to the .vmx:
bios.bootDelay = "3000"

You can of course change this number; the units are on the order of milliseconds (e.g. "3000" adds approximately 3 seconds delay).

Scripting

vmrun does not exist in Fusion 1.x, but you can get some similar functionality by using Applescript's UI scripting, for example like Re: Fusion's handling of Fullscreen is driving me INSANE!.

Additionally, you can tell Fusion to take action on certain signals by adding either (or both) option to the .vmx (for just that VM) or ~/Library/Preferences/VMware Fusion/config (for all your VMs):
signal.suspendOnHUP = "TRUE"
signal.powerOffOnTERM = "TRUE"


You might also be interested in the guest power scripts, which depend on Tools being installed and are run inside the guest when it powers on/powers off/suspends/wakes from sleep. To see where these scripts are, open the Tools and select the Scripts tab.

Headless Mode

As the Beginner's Guide said, the vmware-vmx process does the real work of running the virtual machine while the Fusion UI process handles input and drawing. If you don't need the UI process, you can kill the UI process after you start the VM (e.g. ctrl-option-clicking the Fusion Dock icon and Force Quitting). The vmware-vmx process should continue to run in the background. You can reconnect to it by starting Fusion again and opening the VM.

In Fusion 2.0, an easier way is to run the following command in a Terminal Window:
defaults write com.vmware.fusion fluxCapacitor -bool YES

This will add a View menu item, "Headless". If you use this option, you probably should also use the signal config options mentioned in the Scripting section of this document to allow you to safely shut down the physical machine without having to reconnect to the virtual machine.

I believe the VM continues running even if you log out, since the vmware-vmx process is root-owned.

Networking

Dave Parsons has written a good guide to custom network settings: How to modify Fusion network settings whitepaper

Share Guest Internet Connection With Host

WoodyZ has written a good guide for setting this up: Share Windows XP Guest Internet Connection with OS X Host HOWTO

Static DHCP Mapping

You might want a particular guest to always receive the same IP address via DHCP: Re: DHCP reservations please

Arbitrary MAC address

Fusion 2.0 allows you to use arbitrary MAC addresses, not just the range assigned to VMware. In addition to changing the MAC address in the .vmx file to the one you want, you also need to add the following line:
ethernet0.checkMACAddress = "FALSE"


VNC Server

Like Workstation, Fusion has a built-in VNC server. This allows you to connect to the guest without having a VNC server installed in the guest - useful if a server doesn't exist for the guest or if you need access some time when a server would not work (say during the boot process). It's also good in conjunction with Headless Mode.
The VNC server is set up on a per-VM basis, and is disabled by default. To enable it, add the following lines to the .vmx:
RemoteDisplay.vnc.enabled = "TRUE"
RemoteDisplay.vnc.port = "5901"


Note Previous revisions of this document incorrectly mentioned RemoteDisplay.vnc.password. I'm not sure what medication I was on when writing about it, since that option does not exist. Apparently RemoteDisplay.vnc.key does exist and has similar functionality, but it's an encrypted version of the password and so probably is not something you can generate by hand.
If you want more than one VM set up in this manner, make sure they have unique port numbers.
To connect, use a VNC client pointing at host-ip-address:port. If you connect from a different computer, you may have to open a hole in the OS X firewall. If you use Leopard's Screen Sharing.app on the same computer as Fusion, don't use port 5900 (since Screen Sharing refuses to connect to that).

Swap Alt (a.k.a. Option) and Windows (a.k.a. Command) keys

Mac and PC keyboards have different positions for the Alt/Option and Windows/Command keys. If you're using a PC keyboard or have years of PC muscle-memory, you can tell Fusion to swap these keys by adding the following line to ~/Library/Preferences/VMware Fusion/config
mks.keyboard.swapAlt = "TRUE"


If the config file doesn't exist, create it as a plain text file.

USB HID

You might have noticed that some USB devices, such as keyboards and mice, do not show up in the Virtual Machine menu or in the status bar. By default, Fusion screens out Human Interface Devices (HID) because if you attach your mouse/keyboard to a VM, you may have no way to get back out (shutting down the guest may work, and if you've configured Fusion to not automatically connect, unplugging/replugging should work, but if you don't have this set and the guest crashes, you're out of luck). A similar problem exists if you use a Bluetooth mouse/keyboard and attach the Bluetooth adapter to the guest - don't do that either!

This masking is a problem for other devices such as tablets or mice with lots of buttons, since they are also HID and therefore don't appear in the list. If you want to use pressure sensitivity or other advanced features, you need to attach the device to the guest. To get HID entries to appear, add the following line to the .vmx:
usb.generic.allowHID = "TRUE"

If you use this setting, I would recommend disabling Virtual Machine > Settings > USB > Automatically Connect USB Devices so that you have some way to get a mis-connected device back (unplug and replug). Remember not to connect your only keyboard/mouse to the guest!

Example instructions for using a tablet with an Ubuntu guest: Instructions: enable wacom pressure sensitive tablet in Ubuntu 7.10, Leopard & VMware Fusion 1.1

"Two" computers in one

By now you know that Fusion lets you run multiple OSes at once, but it's limited because only one person can be using them at a time. What if you could separate them even more so that the host and the guest could be used by different people simultaneously? You can combine the USB HID setting with software cursor rendering to do this! While you could achieve a similar effect by combining VNC/headless mode, this method does not require additional physical computers as clients. Major caveats include:
  • The host is still in control (so if OS X goes to sleep, the virtual computer will not be usable, Exposé will affect the guest window, etc.)
  • You will need enough hardware resources to handle both host and guest
  • The guest cursor isn't quite as smooth as normal (but is still quite usable)

To use this tip, you'll need a second keyboard/mouse for the guest and preferably have a second monitor. I would recommend disabling Virtual Machine > Settings > USB > Automatically Connect USB Devices so that you have some way to get a mis-connected device back (unplug and replug). Start by adding the following lines to the guest:
svga.noHWCursor = "TRUE"
usb.generic.allowHID = "TRUE"

Connect the second keyboard/mouse to the guest, and optionally move the guest to the secondary monitor and go fullscreen. Since the host mouse can still wander over to the guest (get back out with ctrl-cmd on the host keyboard), if you use a second monitor, I suggest telling OS X that the monitors are offset so it's harder to do, e.g. go to System Preferences > Displays > Arrangement and drag the displays so they are arranged as follows:
monitors.png
You can extend this for even more virtual computers, though your hardware requirements will go up too.

Paravirtualization

VMware proposed the VMI specification as a vendor-independent method for hypervisors to talk to guests about certain things common to all hypervisors. As far as I know, 32-bit Ubuntu 7.04 and newer are so far the only OS to implement this spec. Enabling VMI gives a slight increase in speed/responsiveness. To do this, add the following line to the .vmx:
vmi.present = "TRUE"


With 32-bit Ubuntu 7.04, if you've done this correctly, the dmesg output should contain the line "Booting paravirtualized kernel on vmi" instead of "Booting paravirtualized kernel on bare hardware"

GDB Server

Like Workstation, Fusion has a built-in GDB server. This allows you to debug the guest without having to run kdb or recompile your kernel (I think this is for Linux guests, or at least guests you can use GDB with). You will need a kernel with symbols for your distro and be familiar with how to use gdb. There is also untested support for record/replay, which lets you do interesting things like stepping backward through a program.

Depending on the guest, add the appropriate line to your .vmx:
32-bit guests 64-bit guests
debugStub.listen.guest32 = "TRUE"
debugStub.listen.guest64 = "TRUE"

Once you've gotten to the guest to where you want to debug, use gdb to connect from the host (or other computer) with
32-bit guests 64-bit guests
target remote yourmachost:8832
target remote yourmachost:8864

Note yourmachost can be localhost.

In GDB, load up the kernel with symbols:
file yourkernelfilehere

(substituting the appropriate file, e.g. vmlinux-2.4.21-27.EL.debug) and you're ready to debug the kernel. Debugging applications takes a little more work, see the following links for more details:

http://stackframe.blogspot.com/2007/04/debugging-linux-kernels-with.html
http://stackframe.blogspot.com/2007/04/workstation-60-and-death-of.html
http://stackframe.blogspot.com/2007/09/application-debugging-with-recordreplay.html
http://stackframe.blogspot.com/2007/10/configuring-application-debugging-with.html
Tags: faq
Average User Rating
(5 ratings)




Sep 25, 2007 4:07 PM Yaztromo  says:

You should note in the Paravirt section that it's only the 32-bit Ubuntu 7.04 which supports paravirt -- the 64 bit version currently does not (although this is supposed to be remedied in the next release IIRC).

The USB HID section currently ends in "However, this is a problem for other devices such as tablets, since", with no further text.

Sep 25, 2007 4:35 PM etung  VMware  says: in response to: Yaztromo

Thanks for pointing those out, I'm not sure what I was thinking when I posted. It is (currently) an open wiki, though, so you can make changes yourself :)

Sep 25, 2007 4:40 PM Yaztromo  says: in response to: etung

Silly me -- I didn't even notice. I admittedly haven't taken in all the new functionality of the new forums software, so I never even noticed it was Wiki-ized :P.

Sep 26, 2007 2:57 PM mykmelez  says:

The "Fit Full Screen" section says to set autoFitFullScreen to "fitHostToGuest" and that "other valid values" are "fitHostToGuest" and "none". Presumably one of those "fitHostToGuest" references should be a reference to "fitGuestToHost", but I don't know which one (I still don't understand the functionality of this pref, despite having read about it and its possible values on several occasions).

Oct 18, 2007 4:22 PM Stokestack  says:

Thanks for this info, but I can't find an important piece: Where is the .vmx file? I don't see it alongside the vmwarevm file or Library/Preferences/VMware Fusion.

Oct 19, 2007 7:15 AM etung  VMware  says: in response to: Stokestack

See A Beginner's Guide to VMware Fusion: Where to Find Things. The .vmx file is inside the .vmwarevm bundle.

Nov 23, 2007 11:54 AM WoodyZ  says:

The UI scripting link under Scripting is dead.

Nov 27, 2007 7:23 AM BP9906  says: in response to: WoodyZ

Can we add information about Alt and Windows key swapping in the VM? Its useful to know since I tell OSX to swap the keys on my Windows keyboard.

Nov 29, 2007 1:30 PM uruiamme  says:

One thing that I find smart is this... I don't see any other such tips, so here goes:
DISABLE Windows native ability to smooth LCD Screen fonts using its ClearType trick. This is a subtle trick that relies on the fact that LCDs are full of red, then green, and then blue pixels (left to right, RGB displays). Mac OS uses a similar technology called Font Smoothing. Well, hopefully you know how to turn off Windows' ClearType if you are using it, because the instant that I did so while running Fusion, I instantly got a better looking Windows XP desktop. It would appear that using both OS's smoothing ends up with some red and blue edges on text so don't do both!! See http://en.wikipedia.org/wiki/Clear_Type.

Dec 23, 2007 3:19 PM yuhong  says:

Many of these features can also be configured by opening it in VMware Workstation 6.

Feb 27, 2008 5:50 PM bwbeach  says:

Thanks for posting these useful hints! I'm using VMware/Fusion for the first time today, and already I have a Red Hat development system up and running.

I'm having trouble with the Alt key, though. I've turned on mks.keyboard.swapAlt, and it only works intermittently, which is unfortunate because the Alt key is critical to us emacs users.

I have a friend who is an X Windows hacker, and I borrowed a program from him that prints out keyboard events as they come in. Sometimes Command is mapped to Alt, and sometimes it's mapped to Ctrl. It seems to depend on which key gets pressed next. If I type "Command-A", it's showing up in the guest OS as "Ctrl-A", whereas "Command-B" shows up as "Alt-B". After some experimentation, I found that the Command key is correctly getting mapped to Alt for most letters, but gets mapped to Ctrl for these: A C F P Y X and Z.

Feb 28, 2008 10:18 AM etung  VMware  says: in response to: bwbeach

Sometimes Command is mapped to Alt, and sometimes it's mapped to Ctrl.

While the virtual machine is powered off, try adding the following line to the .vmx:

pref.mapMacShortcutKeys = "FALSE"

1.1.1 added some remapping, which sounds exactly like what is interfering with your situation. Disabling the new remapping of Command+C/Ctrl+C in Fusion 1.1.1

Feb 28, 2008 12:20 PM bwbeach  says: in response to: etung

Thanks for the quick reply!

Setting pref.mapMacShortcutKeys in the .vmx file didn't make any difference, but putting it in ~/Library/Preferences/VMware Fusion/preferences did the trick (as mentioned in the thread "Disabling the new remapping of Command+C/Ctrl+C in Fusion 1.1.1".