Randomly I get a VBoxHeadless process consuming all the CPU usage, working on OSX 10.10.3.
Googling around I see that this may be countered by setting serial-logging to false, anyone heard of this - if so which config file do you set that in.
I just put it in the main Vagrantfile for now, after some minor testing it seems to be woking keeping the CPU % very low - I added
$enable_serial_logging = false
Thanks for the info, @neilgee. I haven't noticed that issue specifically, but I'm going to keep a better eye out.
Its referenced here also - https://github.com/coreos/coreos-vagrant/issues/98
The solution offered in my previous comment should only work on Core OS as outlined here - http://stackoverflow.com/questions/28293238/why-does-virtual-box-vboxheadless-process-using-vagrant-use-100-of-my-cpu
This thread also mentions installing and updating
vagrant plugin install vagrant-vbguest
I have done both setting the variable $enable_serial_logging and added the plugin, now the vboxheadless process doesn't consume as much CPU but the issue still occurs some of the time
@neilgee Where should I find the config file to add the $enable_serial_logging = false line? What is the filename? Thanks.
In your VVV root, create a file named CustomFile and add the line in there, then do a vagrant reload
Thanks so much @neilgee. I've added the file and did a vagrant reload.
I will do a couple of tests throughout the day and hope that it works.
See how you go - I still get the issue but not as frequent, you may also consider adding more RAM to the VM, you can also do this in the CustomFile - obviously this will depend on what RAM you have available - so to allocate 3GB for exampple , in your CustomFile you can do...
config.vm.provider :virtualbox do |v|
v.customize ["modifyvm", :id, "--memory", 3072]
end
$enable_serial_logging = false
Just to note that this fixed vboxheadless eating 350% CPU on my iMac. ๐
You can bump the memory of the VM from vvv-custom.yml in the vm_config section, along with how many CPU cores. No need to modify the vagrantfile or add a custom one
It sounds like your VM ran out of virtual ram and started swapping to the disk
I just meant adding $enable_serial_logging = false reduced the CPU hammering. The VM is set to use 12GB of RAM from my host's 24GB, with no services running, so I don't think RAM usage was the problem. Thanks though!
Can you do a PR for that? My understanding is this meddles with the uartmode1 option passed to virtualbox, we currently set that to this:
v.customize ["modifyvm", :id, "--uartmode1", "file", File.join(vagrant_dir, "log/ubuntu-bionic-18.04-cloudimg-console.log")]
But I'm happy for it to be disabled entirely
Sorry, I don't actually use VVV, just plain Vagrant :)
I see, enable_serial_logging doesnt actually appear in the vagrant source code, this looks like it's a solution specific to a particular vagrant config
Note that we don't provide general/generic Vagrant support here, this is the VVV project
Its a solution specific to the particular vagrant config of 'using Virtualbox', which i'd imagine is pretty common.
I'm not asking for any support, merely noting that it fixed the CPU hammering for me. If you wish, feel free to delete my comments, I just thought they may help other people googling around for 'vagrant virtualbox consumes all CPU', which is how I came here.
There's no reference of any kind to enable_serial_logging in the vagrant github repo issues or code, but i do find references to it in some gists where it's used as part of a user config. In these gists if it's set to true the uartmode1 value is set later down the file.
So this isn't a pure vagrant, or a pure virtualbox thing, it appears to be a coreos0vagrant thing, specifically related to how coreos-vagrant handles its config system:
if $enable_serial_logging
logdir = File.join(File.dirname(__FILE__), "log")
FileUtils.mkdir_p(logdir)
serialFile = File.join(logdir, "%s-serial.txt" % vm_name)
FileUtils.touch(serialFile)
["vmware_fusion", "vmware_workstation"].each do |vmware|
config.vm.provider vmware do |v, override|
v.vmx["serial0.present"] = "TRUE"
v.vmx["serial0.fileType"] = "file"
v.vmx["serial0.fileName"] = serialFile
v.vmx["serial0.tryNoRxLoss"] = "FALSE"
end
end
config.vm.provider :virtualbox do |vb, override|
vb.customize ["modifyvm", :id, "--uart1", "0x3F8", "4"]
vb.customize ["modifyvm", :id, "--uartmode1", serialFile]
end
end
It seems a lot of people have copy pasted this into their own configs, then told users that setting that global variable to false will fix the issue by setting uartmode, and that the variable itself has been mistaken for the fix
The actual fix, and the generic one that would work for all vagrant/virtualbox combos, is to set uartmode to disconnected:
vb.customize ["modifyvm", :id, "--uartmode1", "disconnected"]
Here's the VirtualBox docs on that parameter and the valid options:
https://www.virtualbox.org/manual/ch08.html#vboxmanage-modifyvm-other
GitHub
Minimal Vagrantfile for Container Linux. Contribute to coreos/coreos-vagrant development by creating an account on GitHub.
IDK what to tell you... I dont use CoreOS, and this is the only change in my Vagrantfile. I also have no mentions of uart in my Vagrantfile:
rory@Eddie:vm(master) โ $ cat Vagrantfile | grep uart
rory@Eddie:vm(master) โ $ cat Vagrantfile | grep \$enable_serial
$enable_serial_logging = false
rory@Eddie:vm(master) โ $
Without $enable_serial_logging = false : https://take.ms/Xg41m
With $enable_serial_logging = false : https://take.ms/8Lwao
Monosnap screenshot tool
Monosnap screenshot tool
I'll give your uart fix a try and report back ๐
Just to note that this fixed vboxheadless eating 350% CPU on my iMac. ๐
Fixed my issue too.
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
Most helpful comment
I just put it in the main Vagrantfile for now, after some minor testing it seems to be woking keeping the CPU % very low - I added