VMware Communities
pumpkingod
Contributor
Contributor

"Headless" Fusion VM?

Is there any way for me to run the Fusion VM engine without the GUI on top of it? All I really need is a service in the background to ssh into, as I never use the GUI.

Thanks!

0 Kudos
11 Replies
admin
Immortal
Immortal

Force quit the GUI Fusion process (e.g. ctrl-click on dock icon, hold option, and select Force Quit). Since the heavy lifting is actually done by vmware-vmx, your VM continues running in the background. To reconnect the GUI, just open the VM again.

pumpkingod
Contributor
Contributor

Thanks, that'll work... but is there any less heavy-handed way of doing that? Can I launch the vmware-vmx process myself?

0 Kudos
admin
Immortal
Immortal

I don't think you can start vmware-vmx directly.

0 Kudos
AaronPerez
Contributor
Contributor

Yes,

It is possible to start the Virtual Machine automatically. However involves AppleScript.

I wrote a script for the following scenario: A Mac must automatically start the Windows 2003 Server virtual machine upon booting OS X 10.4. Windows 2003 Server is installed on a Boot Camp partition. Before VMWare Fusion runs, the Boot Camp partition must be unmounted. When the user quits VMWare Fusion, the Boot Camp partition will be mounted again.

AppleScript "saved as" a program using Script Editor:

do shell script "sudo diskutil unmount /dev/disk0s3" password "SUPERSECRET" with administrator privileges

delay 5

do shell script "sudo \"/Applications/VMWare Fusion.app/Contents/MacOS/vmware\" \"/Users/aaron/Library/Application Support/VMware Fusion/Virtual Machines/Boot Camp/%2Fdev%2Fdisk0/Boot Camp partition.vmwarevm\"" password "SUPERSECRET" with administrator privileges

do shell script "sudo diskutil Mount /dev/disk0s3" password "SUPERSECRET" with administrator privileges

The resulting program from AppleScript can then be added to your OS X Account as a Login Item.

Hope this helps you.

-Aaron

0 Kudos
admin
Immortal
Immortal

Aaron, nice script! I'll have to remember this post, the question comes up every so often. I am a bit confused what it has to do with this particular thread, though Smiley Happy

Edit: Looking at the script a little more, I have some suggestions:

  1. You don't need admin privileges to run Fusion, so don't do that.

  2. You should specify the full path to diskutil to avoid someone inserting a malicious diskutil earlier in their PATH.

  3. You should use the volume mount point or UUID because OS X doesn't always number disks consistently (what is currently disk0 might be disk1 after a reboot).

Edit: I was wrong, Fusion does need admin privileges to write to a raw partition.

0 Kudos
SCC_HelpDesk
Contributor
Contributor

Hello etung,

I don't understand your suggestion #1.

How do you run Fusion without Admin privileges?

It asks me every time when logged in as Administrator.

I stopped using Parallel's because of my scenario and hoped that VMware Fusion was the answer.

I have 2 User accounts and 1 Admin account on one MacPro.

How do I get the regular users to launch Fusion and the BootCamp partition without giving them the Admin password?

They are regular users and not Admins because we don't want them installing anything.

I understand that mounting a volume (launching Fusion/BootCamp) requires Admin credentials.

Would you be able to clarify please?

It would be really nice if the VM auto-loaded (Head-Less) for them when they logged in or if they were not prompted for any authentication.

Perhaps Aaron might comment as well?

Thanks,

James

0 Kudos
admin
Immortal
Immortal

How do you run Fusion without Admin privileges?

It asks me every time when logged in as Administrator.

The password is only used for Boot Camp virtual machines so that the partition can be unmounted. If you use a normal virtual machine, you don't need to be an administrator.

Edit: I was wrong, Fusion needs admin privileges to write to the partition. Unmounting is not sufficient. Sorry for the confusion!

How do I get the regular users to launch Fusion and the BootCamp partition without giving them the Admin password?

What I described should work, except there seems to be a bug where Fusion asks for the password even if it's not required. So I don't think there is a way to do it at this time.

0 Kudos
AaronPerez
Contributor
Contributor

Dear James,

Etung is correct on both issues. Because of this administrator "problem", I decided to create a workaround by writing an AppleScript program. You have seen part of this solution from my previous post.

You can add the AppleScript program you write to the user's "Login Items" under the Accounts section of System Preferences. In regards to the program itself, you can prevent users from altering your AppleScript program or viewing its commands by using the "Run Only" option when you save your AppleScript as a Program using Script Editor. Make sure you save a writable copy for yourself beforehand.

Here is a sample script you can use with a BootCamp Partition (the code begins after *****). The delay 5 is added because I noticed the script has problems if it executes too quickly at login. Also, the last line is added so that the BootCamp partition is reloaded after the program exits:

*****

delay 5

do shell script "sudo diskutil unmount /dev/disk0s3" password "SUPERSECRET" with administrator privileges

delay 5

do shell script "sudo \"/Applications/VMWare Fusion.app/Contents/MacOS/vmware\" \"/Users/COMPANYEMPLOYEE/Library/Application Support/VMware Fusion/Virtual Machines/Boot Camp/%2Fdev%2Fdisk0/Boot Camp partition.vmwarevm\"" password "SUPERSECRET" with administrator privileges

do shell script "sudo diskutil Mount /dev/disk0s3" password "SUPERSECRET" with administrator privileges

*****

Here is a sample script you can use with a Fusions disk file:

*****

delay 5

do shell script "sudo \"/Applications/VMWare Fusion.app/Contents/MacOS/vmware\" \"/Users/COMPANYEMPLOYEE/Documents/Virtual Machines/Windows XP Professional.vmwarevm\"" password "SUPERSECRET" with administrator privileges

*****

OR

*****

delay 5

do shell script "\"/Applications/VMWare Fusion.app/Contents/MacOS/vmware\" \"/Users/COMPANYEMPLOYEE/Documents/Virtual Machines/Windows XP Professional.vmwarevm\"" user name "ME" password "MYPASSWORD" with administrator privileges

*****

Best,

Aaron

0 Kudos
SCC_HelpDesk
Contributor
Contributor

Thanks and this may be an open-ended question...but why would you want or need BootCamp if you want only a VM?

I understand a Dual-Boot setup...but a VM (Fusion) makes it so much easier.

I spent too much time trying to get Parallels to work as I wanted and with Fusion Easy Install, it was easy. (VM sales team, you may quote me on that).

Thank you Aaron & Etung!

0 Kudos
admin
Immortal
Immortal

Thanks and this may be an open-ended question...but why would you want or need BootCamp if you want only a VM?

There are a couple valid reasons, but for most use cases I think users are better off with a regular VM. has some arguments for choosing Boot Camp.

0 Kudos
Baconfed
Contributor
Contributor

I found a simpler way to get vmware to run automatically without running as root which has certain draw backs. (In my case, file dragging from vmware to Mac and creating other virtual machines) It won't automatically remount your boot camp partition, but for me I have no need for it, as all my data files are via shared folders on the mac os partition (For backup purposes)

___

Set your bootcamp partition to automatically boot on vmware startup

The using applescript; (You may need to adjust the delays depending on your system speed)

delay 5

do shell script "sudo diskutil unmount /dev/disk0s3" password "YOURPASSWORD" with administrator privileges

delay 5

tell application "VMware Fusion" to activate

delay 10

tell application "System Events"

keystroke "YOURPASSOWRD" & return

end tell

Save this applescript as a Application (Run Only)

Under your Mac OS User Preference, Set this application to run at startup.

As a note, I strongly recommend to have two hardware profiles for quicker booting between bootcamp and vmware.

Bacon

0 Kudos