Virtual Mac OS in ESXI without SSH and reboot + Remote connection directly

Prerequisites: 

  1. VMware Workstation 12 and up.
  2. Download VM Unlocker and Tools. (Link added)
  3. Mac OS X .vmdk or .iso.
  4. ESXI Virtual Machine – Windows Server 2012.
  5. TeamViewer Installer.

Familiarity with:

    1. VMware workstation.
    2. VMware vSphere.
    3. Windows server 2012.

Step-By-Step Guide

  1. Create new Windows server 2012 Virtual Machine on your ESXI host.
  • No need for special roles. Add to domain if possible.
  1. Create user without permissions for auto logon.
  • If server has been added to a domain, create a domain user without any permissions other than login. Otherwise, create a local user without permissions.
  1. Download Windows server 2012 Virtual Machine .vmx file from datastore and upload the new edited one.
  • Shutdown the VM.
  • Browse vSphere Datastore where the VM is located:

 

  • Double click the VM’s folder.
  • Download the VM’s .vmx file:

 

  • Edit the downloaded .vmx file. Add these lines to the end of the file:
vhv.enable = “TRUE”
hypervisor.cpuid.v0 = “FALSE”
  • Rename the .vmx Datastore’s file.
  • Upload the new .vmx file to the VM’s folder.
  • Power On the VM.
  1. Edit the VM’s “CPU/MMU Virtualization” settings. In our case, worked well with last option. However, you might prefer “Automatic”.

 

5. Run reg file for autologon.

  • Login with the relevant user into Windows
  • Open CMD and run:

wmic useraccount where name=’admin’ get sid

  • Copy the SID string aside

    • Create a new text file (Registry Script) and rename it to: AutoStart.reg
    • Add these lines while you change only the relevant bold values:
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon]
"ReportBootOk"="1"
"Shell"="explorer.exe"
"PreCreateKnownFolders"="{A520A1A4-1780-4FF6-BD18-167343C5AF16}"
"Userinit"="C:\\Windows\\system32\\userinit.exe,"
"VMApplet"="SystemPropertiesPerformance.exe /pagefile"
"AutoRestartShell"=dword:00000001
"Background"="0 0 0"
"CachedLogonsCount"="10"
"DebugServerCommand"="no"
"ForceUnlockLogon"=dword:00000000
"LegalNoticeCaption"=""
"LegalNoticeText"=""
"PasswordExpiryWarning"=dword:00000005
"PowerdownAfterShutdown"="0"
"ShutdownWithoutLogon"="0"
"WinStationsDisabled"="0"
"DisableCAD"=dword:00000001
"scremoveoption"="0"
"ShutdownFlags"=dword:00000027
"AutoAdminLogon"="1"
"DefaultUserName"="admin"
"DefaultDomainName"="domain.local"
"DisableBackButton"=dword:00000001
"EnableSIHostIntegration"=dword:00000001
"ShellCritical"=dword:00000000
"ShellInfrastructure"="sihost.exe"
"SiHostCritical"=dword:00000000
"EnableFirstLogonAnimation"=dword:00000001
"AutoLogonSID"="S-1-5-21-1429605073-########-3440955449-###"
"LastUsedUsername"="username"
"IsConnectedAutoLogon"=dword:00000000
"DisableLockWorkstation"=dword:00000000
"DefaultPassword"="Your_Password"
  • Save the changes and run AutoStart.reg as administrator
  • Restart your PC and wait until user is automatically login to Desktop.

6. Install VMware Workstation 12 and up on Server.

7. Upload MacOS .vmdk or .iso to Windows Server 2012

8. Mac OS Unlocker (You may find it over the Web).

  • Link to download the zipped file: bit.ly/2ZtVBcx
  • Close VMware Workstation
  • Run “wim-install.cmd” as admin from the downloaded zip file on Windows Server 2012
  • Reopen Workstation
  • This option should appear when you create a new virtual machine in workstation:

 

9. Create New MacOS X Virtual Machine.

  • Create a new Virtual Machine in Workstation.
  • Use .vmdk as existing disk or .iso with new disk
  • .vmdk option:

Finish

  • .iso file:
  • Create new disk and customize Hardware to connect to iso image at power on:

  • Add line to .vmx file of the new virtual machine:
Smc.version = “0”

10. Install VMware Tools on MacOS Virtual Machine

  • Load darwin.iso file from unlocker download folder to machines cd hardware.

  • Run installation

  • Restart MacOS machine

11. AutoLogon as a regular user.
 

 
12. Start TeamViewer at user login.

 


 

  1. Configure TeamViewer:
  2.  

 

  • Save password for remote login:

  • Grant access permissions:

 
 

  1. Create script to run VM inside VMware workstation.
@echo off
c:
cd "C:\Program Files (x86)\VMware\VMware Workstation"
"C:\Program Files (x86)\VMware\VMware Workstation\vmrun.exe"
vmware -x "D:\path to VM .vmx file"
Ping 8.8.8.8 -n 2
Exit
  1. Edit registry to run script at system startup. Run cmd as admin!
reg add "HKLM\Software\Microsoft\Windows\CurrentVersion\Run" /V "REGISTRY_NAME" /D "C:\PathToFile" /F

 

Reboot Windows Server 2012 VM and check it out!

Enjoy!

🙂