Homestead: Homestead VM freezes randomly

Created on 25 Feb 2021  路  6Comments  路  Source: laravel/homestead

Versions

  • Vagrant: Vagrant 2.2.14
  • Provider: Virtualbox 6.1.16 r140961 (Qt5.6.3)
  • Homestead: release branch

Host operating system

macOS Big Sur 11.2.1 (20D74)

Homestead.yaml

---
ip: "192.168.10.10"
memory: 4096
cpus: 4
provider: virtualbox
authorize: ~/.ssh/id_rsa.pub

keys:
    - ~/.ssh/id_rsa

folders:
    - map: /Users/user/Projects/one
      to: /home/vagrant/one
    - map: /Users/user/Projects/two
      to: /home/vagrant/two
sites:
    - map: one.local.com
      to: /home/vagrant/one/public
      php: "7.4"
    - map: two.local.com
      to: /home/vagrant/two/public
      php: "7.1"
databases:
    - one
    - two
features:
    - mysql: true
    - rabbitmq: true
    - mariadb: false
    - postgresql: false
    - ohmyzsh: false
    - webdriver: false

#services:
#    - enabled:
#        - "postgresql@12-main"
#    - disabled:
#        - "postgresql@11-main"

ports:
    - send: 80
      to: 80
    - send: 3306
      to: 3306
    - send: 15672
      to: 15672

Vagrant destroy & up output

https://gist.github.com/petcumihai/0276d8ed753c7938e850cfd766bfe612

Expected behavior

Don't freeze

Actual behavior

It freezes randomly. I gradually increased the VM's resources (CPU and RAM) and it still froze.
At first I thought it was related to RabbitMQ but it happens with the service turned off as well.

I manage to do everything I need (SSH into the machine, run the app, develop, etc) but for no reason it freezes to the point I have to forcefully remove the VM and recreate the box.
I'm not able to figure out any pattern or trigger for this behaviour. It freezes for no apparent reason.

Steps to reproduce

Just wait I guess

References

Most helpful comment

Add this to after.sh (and run it in the VM if you don't want to re-provision)

sudo systemctl mask sleep.target suspend.target hibernate.target hybrid-sleep.target

All 6 comments

Add this to after.sh (and run it in the VM if you don't want to re-provision)

sudo systemctl mask sleep.target suspend.target hibernate.target hybrid-sleep.target

Add this to after.sh (and run it in the VM if you don't want to re-provision)

sudo systemctl mask sleep.target suspend.target hibernate.target hybrid-sleep.target

Will do that right now. I've just installed a fresh homestead setup and ran apt update; apt upgrade -y and froze again.
Will come back with feedback on your solution. 馃檹 Thanks!

I've also ran into those random freeze issues. Just ran your command. Will report if this resolves this issue.

Add this to after.sh (and run it in the VM if you don't want to re-provision)

sudo systemctl mask sleep.target suspend.target hibernate.target hybrid-sleep.target

Nice! This seem to have worked. Managed to upgrade installed packages and run heavy work loads on the VM for almost 3 hours now and hasn't froze. 鉂わ笍

I'm guessing this fix should get reviewed and pushed directly into after.sh.

'm guessing this fix should get reviewed and pushed directly into after.sh.

We should fix this upstream in https://github.com/laravel/settler

Was this page helpful?
0 / 5 - 0 ratings

Related issues

alexdover picture alexdover  路  4Comments

pqt picture pqt  路  3Comments

leandroruel picture leandroruel  路  4Comments

pluxain picture pluxain  路  3Comments

steveheinsch picture steveheinsch  路  3Comments