mark.bockenstedt.net header image
Twitter
Gaming Linux Mac Software Tech
mu Updates
Web
Musings Rants & Raves Rumor Sports Weather
Video Reviews

VMware Fusion VMs as Apps

October 21st, 2008 · 3 Comments

Mac OS X: Last week I showed how to create VirtualBox VMs as applications. This week, I’m trying out VMware Fusion to see if it’s better or worse than VirtualBox. I’m trying to shoot for the same experience as the VirtualBox machines, so I needed to figure out how to create an App using AppleScript so I could put the VM on the Dock.

Create VM

This step is obvious, but necessary. Get everything in your VM set up how you want it, including opening it in Full Screen mode if you wish. Fusion seems to remember your last view, so killing your VM while it’s in full screen will open it next time in that mode. Plus, it saves on AppleScript that I really don’t like (setting delays before going to fullscreen).

Write Script to Create Application

If you remember the script for VirtualBox, it was very short:

do shell script "vboxmanage startvm Ubuntu"

The script for Fusion is slightly more complex, but still not too bad:

tell application "System Events"
    if UI elements enabled then
        open "~/Documents/Virtual Machines.localized/Ubuntu.vmwarevm"
    else
        display dialog "Can't start VM"
    end if
end tell

In order for this to work, you need to have the “Enable access for assistive devices” box in System Preferences -> Universal access checked. I’m not sure why, but you just do. The else clause here is just so you have some feedback in case your VM doesn’t want to start.

Once you’ve entered the script above (substituting the correct path to your VM), save it as an application. I save all my custom apps to /Users/mark/Applications, but the path is arbitrary.

Change App Icon (Optional)

Check out this post on how to change an application icon.

Put on Dock (Optional)

I don’t think I have to explain how to do this if you’re messing around with virtualization.

Categories: How-To · Mac
Tags:, , , ,



3 comments so far ↓

  • 1: Ben G. says:
    October 21st, 2008 at 6:01 pm

    VMware Fusion also has a nice command-line interface to starting a VM. Check out:

    “/Library/Application Support/VMware Fusion/vmrun”

    You can start a specific VM with:

    “/Library/Application Support/VMware Fusion/vmrun” -T fusion start “~/Documents/Virtual Machines.localized/Ubuntu.vmwarevm/Ubuntu.vmx”

  • 2: Ben G. says:
    October 21st, 2008 at 6:02 pm

    By the way, if all you want to do is to put the VM on the Dock, just drag the document from ~/Documents/Virtual Machines onto your Dock.

    If you want it to start up automatically, just add the document to System Preferences -> Accounts -> Login Items.

  • 3: Mark says:
    October 21st, 2008 at 10:07 pm

    @Ben
    The reason I created them as apps through AppleScript is that they can then be placed on the left side of the Dock with the other apps. You can also customize the icon when it’s an app – is that available by dragging the .vmwarevm file to the Dock?

    I appreciate the tips – there’s almost always an easier way to do things!