Results 1 to 4 of 4

Thread: How to run Virtual Machine headless and controlling shutdown or suspend upon Mac OS X Lion Reboot or Shutdown?

  1. #1
    Join Date
    Nov 2011
    Posts
    60

    How to run Virtual Machine headless and controlling shutdown or suspend upon Mac OS X Lion Reboot or Shutdown?

    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?

  2. #2
    Join Date
    Nov 2010
    Posts
    503

    Re: How to run Virtual Machine headless and controlling shutdown or suspend upon Mac OS X Lion Reboot or Shutdown?

    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.

  3. #3
    Join Date
    Dec 2010
    Posts
    351

    Re: How to run Virtual Machine headless and controlling shutdown or suspend upon Mac OS X Lion Reboot or Shutdown?

    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
    Code:
    cd /Library/LaunchDaemons/
    sudo nano com.wkz.headlessvm.plist
    you have to copy and paste below mentioned code into nano.

    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>
    Now save the file and close it.
    You have to verify permission by using ls -l command.

    Code:
    -rw-r--r--  root  wheel  com.wkz.headlessvm.plist
    In case it is not displaying permission then execute ls -l below mentioned output should be generated.
    sudo chown root:wheel com.wkz.headlessvm.plist
    sudo chmod 644 com.wkz.headlessvm.plist

  4. #4
    Join Date
    May 2011
    Posts
    410

    Re: How to run Virtual Machine headless and controlling shutdown or suspend upon Mac OS X Lion Reboot or Shutdown?

    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:


    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
    suspendheadless:

    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
    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
    after that you have to created StartupParameters.plist from HeadlessVM script.
    Code:
    nano StartupParameters.plist
    you should copy and paste following code in the nano file.


    Code:
      Description     = "HeadlessVM";
      Provides        = ("Runs/Suspends Virtual Machine Headless on OS X Startup/Shutdown");
      Uses            = ("Disks");
    }
    There is need of checking the file permission by using following command ls –l.
    It should display following output
    Code:
    -rwxr--r--  root  wheel  HeadlessVM
    -rw-r--r--  root  wheel  StartupParameters.plist

Similar Threads

  1. windows 2003 server shutdown and reboot automatically.
    By Prashant in forum Windows Server Help
    Replies: 3
    Last Post: 09-01-2014, 01:39 PM
  2. PC with Gigabyte GA-Z68AP-D3 shows NO SIGNAL, shutdown and reboot
    By |Gyani| in forum Motherboard Processor & RAM
    Replies: 4
    Last Post: 12-03-2012, 08:51 PM
  3. Replies: 6
    Last Post: 24-06-2011, 09:59 PM
  4. Creating Icons for Shutdown and Reboot
    By Orlando in forum Tips & Tweaks
    Replies: 2
    Last Post: 21-03-2009, 05:29 PM
  5. Replies: 1
    Last Post: 19-03-2009, 10:32 AM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,711,673,206.61760 seconds with 17 queries