boxcutter / macos

Virtual machine templates for macOS written in legacy JSON
MIT License
316 stars 65 forks source link

macOS Sierra VM on ESXi Freezes Periodically every ~10s for about ~10s #19

Closed berney closed 7 years ago

berney commented 7 years ago

This is similar to the symptoms described in https://github.com/timsutton/osx-vm-templates/issues/43, however it is on ESXi 5.5 and occurs when DISABLE_REMOTE_MANAGEMENT and DISABLE_SCREEN_SHARING are specified. This issue happens on macOS Sierra 10.12.0 and 10.12.1. OS X El Capitan and OSX Mavericks built the same way do not have this issue, only macOS Sierra. I haven't tried other major versions yet.

I haven't been able to workout the cause of the issue. I not that even though Remote Management is disabled there's still ARDAgent process starting. It's PID changes roughly every 10s so I suspect that it's to blame, I haven't been able to stop it from starting. I'm not very proficient in OSX admin.

annawake commented 7 years ago

How much memory have you allocated to your VMs? At the bare minimum I recommend at least 2GB of RAM - I usually only see this problem in ESXi boxes that try to constrain memory more than that.

berney commented 7 years ago

I have 4GB dedicated to the macOS Sierra 10.12.0 and 10.12.1 VMs.

The VM runs fine for 10s then pauses for 10s, the pattern is very stable, so I think it is not memory pressure but something else, something is triggering the VM to lock up, but then it comes good again, and this keeps repeating.

mondoshivan commented 7 years ago

How many CPU cores are configured in the Vagrantfile? Does it also freeze when only 1 core is used?

berney commented 7 years ago

Good question. I'll check this out and post back.

roynielsen17 commented 7 years ago

I've found better success with Mac VM's having 2 cpus.

Regards, -Roy

What man is a man who does not make the world better? - Balien of Ibelin, Kingdom of Heaven

On Wed, Feb 15, 2017 at 5:41 AM, berney notifications@github.com wrote:

Good question. I'll check this out and post back.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/boxcutter/macos/issues/19#issuecomment-280000719, or mute the thread https://github.com/notifications/unsubscribe-auth/ALCwGAUVoUUT_oQLMgHd9TiQxcrdmACcks5rcvJ8gaJpZM4Kw6BB .

barkingfoodog commented 7 years ago

I had a similar issue using Vagrant + VMWare Fusion for our macOS boxes. My Vagrantfile explicitly set the ram to 2048 MB but didn't set the number of cpus. Once I set the cpus to 2, the problem went away.

For posterity here is my working Vagrantfile:

ENV['VAGRANT_DEFAULT_PROVIDER'] = "vmware_fusion"
Vagrant.configure("2") do |config|
  config.vm.provider "vmware_fusion" do |vb|
    vb.memory = "2048"
    vb.cpus = "2"
  end
end
berney commented 7 years ago

Thanks for the tip regarding number of CPUs. I checked and I had it set to 1 socket x 1 core == 1 logical CPU. I am now testing 1 socket x 2 cores == 2 logical CPUs. This is working well, boot up is much faster and I no longer get the 10 seconds of freezing. I will update my Packer templates to ensure i set vCPUs to 2.

Based on this it appears that prior to 10.12 Sierra, OSX was fine with 1 vCPU, but on 10.12 Sierra (and my guess is going forward but time will tell) 2 vCPUs is needed to prevent severe performance degradation.