1 2 Previous Next 17 Replies Latest reply on Jun 4, 2013 10:03 AM by bfly88 Go to original post
      • 15. Re: Running a VM Headless (no GUI) and Controlling Shutdown/Suspend with Mac OS X Reboot/Shutdown
        bfly88 Lurker

        I know I am dragging up an old thread but I have an issue with the behavior of the VM once running. I am using Lion and a StartupItem script with Fusion 4. The behavior is the same if I use launchd.

         

        Problem:

        The VM launches perfectly fine and works beautifully. The problem lies when I login to the host system and then logout. When I logout the VM processes are killed effectively doing a force shutdown of the VM. Any ideas what could be the problem? In case it matters, when starting the VM I am getting these errors but the VM runs fine:

         

        Jun  4 08:48:31 server.local vmware-vmx[7906] <Warning>: 3891612: (connectAndCheck) Untrusted apps are not allowed to connect to or launch Window Server before login.

        Jun  4 08:48:31 server.local vmware-vmx[7906] <Error>: kCGErrorFailure: Set a breakpoint @ CGErrorBreakpoint() to catch errors as they are logged.

        _RegisterApplication(), FAILED TO establish the default connection to the WindowServer, _CGSDefaultConnection() is NULL.

        • 16. Re: Running a VM Headless (no GUI) and Controlling Shutdown/Suspend with Mac OS X Reboot/Shutdown
          WoodyZ Guru

          Yes, this is an old thread and what was presented here is not officially supported either.  Additionally I'm not in a position at the moment to work with the older version of VMware Fusion or Mac OS X so I really can't do (and honestly don't want to do) any testing with what is a totally officially unsupported manner of running VMware Fusion as I no longer have a need to run any VM's Headless, sorry.

          • 17. Re: Running a VM Headless (no GUI) and Controlling Shutdown/Suspend with Mac OS X Reboot/Shutdown
            bfly88 Lurker

            FWIW, this is the reason for my issues:

             

            https://developer.apple.com/library/mac/#technotes/tn2083/_index.html

             

            However, this isn't the case (r. 5544764) . This message is really telling you is that you're trying to connect to the window server from the wrong context. You see this message if you try to connect to the global window server service from outside of the pre-login context before the user has logged in; typically this means that you're trying to use the window server from a daemon.

             

            You should not attempt to fix this by convincing the window server to trust your program; doing so will just cause other problems further down the road. For example, if you do successfully connect to the window server from your daemon, you still have to deal with window server lifecycle issues described previously.

             

            Instead, you should fix this problem by changing your code to run in the correct context. If you need to connect to the window server in a pre-login context, create a pre-login launchd agent. For an example of this, see Sample Code 'PreLoginAgents'.

             

            I guess I should have used VirtualBox instead.

            1 2 Previous Next