geerlingguy / ansible-for-devops

Ansible for DevOps examples.
https://www.ansiblefordevops.com
MIT License
8.45k stars 3.46k forks source link

geerlingguy/ubuntu2004 needs 2 CPUs #481

Open RanchoHam opened 2 years ago

RanchoHam commented 2 years ago

Environment:

Problem: In the drupal directory vagrant up fails with the message:

The guest machine entered an invalid state while waiting for it to boot. Valid states are 'starting, running'. The machine is in the 'paused' state. ... Examination of the Virtual Box console shows the boot stopped because of a kernel panic

Manual Solution:

  1. After failure, power off the virtual machine
  2. Open the Virtual Box GUI
  3. Open settings for the virtual machine that failed
  4. Select the System window
  5. Select the Processor tab
  6. Increasing the number of processors to 2 will allow the VM to start.

How can the base box be modified to use 2 processors?

RanchoHam commented 2 years ago

I found that modifying the Vagrantfile by adding the following line: v.customize "pre-boot", ["modifyvm", :id, "--cpus", 2], to the config.vm.provider :virtualbox do |v| loop will modify the the number of CPUs allocated to the VM.

ellisgeek commented 2 years ago

@RanchoHam I ran into this as well. The proper way to do this in Vagrant is to use v.cpus = 2 in the config.vm.provider loop.

DdeathCoder commented 1 year ago

why this issue is still open ?? I think it got resolved by now @RanchoHam ?