as the title saying. I am looking to run Virtual Machine headless that means without GUI in order to control shutdown and suspend with the reboot and shutdown of Mac OS X. Can you give me brief idea of above mentioned things?
as the title saying. I am looking to run Virtual Machine headless that means without GUI in order to control shutdown and suspend with the reboot and shutdown of Mac OS X. Can you give me brief idea of above mentioned things?
Well if you wanted to run Virtual Machine Headless which is only possible with VMware Fusion. Before you go for running Virtual Machine as headless you should run it normally in order to find out whether it is configured. You have to turn off all the unnecessary feature. Virtual Machines are supposed to connect automatically to unwanted devices. You have to add following parameters to vmx configuration file.
Code:msg.autoAnswer = "TRUE"
- now shutdown Virtual Machine and remove entry from Virtual Machine Library and close VMware Fusion.
- After that you have to use vmrun in order to start with Virtual Machine by using nogui parameter.
- If you have done the same VMware Fusion would remain headless as it was removed from Virtual Machine Library.
If you wanted to start Virtual Machine with the user login then you have to perform.
You have to launch Terminal and execute below mentioned command
you have to copy and paste below mentioned code into nano.Code:cd /Library/LaunchDaemons/ sudo nano com.wkz.headlessvm.plist
Now save the file and close it.Code:<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <plist version="1.0"> <dict> <key>Disabled</key> <false/> <key>KeepAlive</key> <false/> <key>Label</key> <string>com.wkz.headlessvm</string> <key>ProgramArguments</key> <array> <string>/Library/Application Support/VMware Fusion/vmrun</string> <string>-T</string> <string>fusion</string> <string>start</string> <string>/Virtual Machines/Windows XP Professional SP3.vmwarevm/Windows XP Professional SP3.vmx</string> <string>nogui</string> </array> <key>RunAtLoad</key> <true/> <key>UserName</key> <string>WKZ</string> </dict> </plist>
You have to verify permission by using ls -l command.
In case it is not displaying permission then execute ls -l below mentioned output should be generated.Code:-rw-r--r-- root wheel com.wkz.headlessvm.plist
sudo chown root:wheel com.wkz.headlessvm.plist
sudo chmod 644 com.wkz.headlessvm.plist
You have to perform below mentioned steps to perform shutdown and suspend of Virtual Machine when Mac OS X is rebooting or shutdown.
From the Home folder in the Terminal you have to create .profile and add following
Code:export PATH=$PATH:/Scripts runheadless and suspendheadless are the two folders in the script folder to use Headless Virtual Machines.
runheadless:
suspendheadless:Code:#!/bin/bash "/Library/Application Support/VMware Fusion/vmrun" -T fusion start "/Virtual Machines/Windows XP Professional SP3.vmwarevm/Windows XP Professional SP3.vmx" nogui
Code:#!/bin/bash "/Library/Application Support/VMware Fusion/vmrun" -T fusion suspend "/Virtual Machines/VMware Fusion/Windows XP Professional SP3.vmwarevm/Windows XP Professional SP3.vmx"
Now you will need to run below mentioned command on Terminal
Code:mkdir /Library/StartupItems/HeadlessVM cd /Library/StartupItems/HeadlessVM nano HeadlessVM
Now you have to copy and paste the following command into nano file
after that you have to created StartupParameters.plist from HeadlessVM script.Code:#!/bin/sh . /etc/rc.common StartService () { /Scripts/runheadless } StopService () { /Scripts/suspendheadless } RunService "$1" Now save and close HeadlessVM file. Now executer HeadlessVM file chmod a+x HeadlessVM
you should copy and paste following code in the nano file.Code:nano StartupParameters.plist
There is need of checking the file permission by using following command ls –l.Code:Description = "HeadlessVM"; Provides = ("Runs/Suspends Virtual Machine Headless on OS X Startup/Shutdown"); Uses = ("Disks"); }
It should display following output
Code:-rwxr--r-- root wheel HeadlessVM -rw-r--r-- root wheel StartupParameters.plist
Bookmarks