Multiple CPU with virtualbox provider

558 views
Skip to first unread message

Jo Knight

unread,
Jun 5, 2018, 10:06:16 AM6/5/18
to Vagrant
I’m looking to enable ioapic in my Vagrantfile in an effort to utilise multiple cpus in my Virtualbox VMs and am trying the below setting without sucsess. Each time I increase `$vm_cpus` to >1 it hangs on startup. Reverting it to 1 and all works. Can anyone assist with any pointers?

```config.vm.provider :virtualbox do |vb|
        vb.gui = $vm_gui
        vb.memory = $vm_memory
        vb.customize ["modifyvm", :id, "--ioapic", "on"]
        vb.cpus = $vm_cpus
      end```

vagrant up hangs on the following step: k8s-01: SSH auth method: private key

Does anyone have VMs using multiple cpus per VM? 


The host I am running on has 4 cores:


$ lscpu
Architecture:          x86_64
CPU op-mode(s):        32-bit, 64-bit
Byte Order:            Little Endian
CPU(s):                4
On-line CPU(s) list:   0-3
Thread(s) per core:    1
Core(s) per socket:    4
Socket(s):             1
NUMA node(s):          1
Vendor ID:             GenuineIntel
CPU family:            6
Model:                 58
Model name:            Intel(R) Xeon(R) CPU E3-1220 V2 @ 3.10GHz
Stepping:              9
CPU MHz:               3366.042
CPU max MHz:           3500.0000
CPU min MHz:           1600.0000
BogoMIPS:              6185.94
Virtualisation:        VT-x
L1d cache:             32K
L1i cache:             32K
L2 cache:              256K
L3 cache:              8192K
NUMA node0 CPU(s):     0-3
Flags:                 fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx rdtscp lm constant_tsc arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc aperfmperf eagerfpu pni pclmulqdq dtes64 monitor ds_cpl vmx smx est tm2 ssse3 cx16 xtpr pdcm pcid sse4_1 sse4_2 x2apic popcnt tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm epb kaiser tpr_shadow vnmi flexpriority ept vpid fsgsbase smep erms xsaveopt ibpb ibrs stibp dtherm ida arat pln pts


Versions below:

$ vagrant version
Installed Version: 2.1.1
Latest Version: 2.1.1

You're running an up-to-date version of Vagrant!

$ vboxmanage --version
5.1.34_Ubuntur121010


Alvaro Miranda Aguilera

unread,
Jun 5, 2018, 10:34:03 AM6/5/18
to vagra...@googlegroups.com
This works for me.

Host is mac book pro 13" i7

0  $ cat Vagrantfile 

Vagrant.configure("2") do |config|

  config.vm.box = "hashicorp/precise64"

  config.vm.provider "virtualbox" do |v|

    v.memory = 1024

    v.cpus = 4

    v.customize ["modifyvm", :id, "--ioapic", "on"]

  end

end

0  $ 


Jo Knight

unread,
Jun 5, 2018, 10:52:55 AM6/5/18
to vagra...@googlegroups.com
​Thanks, any idea how I could start to troubleshoot this on Ubuntu?​

--
This mailing list is governed under the HashiCorp Community Guidelines - https://www.hashicorp.com/community-guidelines.html. Behavior in violation of those guidelines may result in your removal from this mailing list.
 
GitHub Issues: https://github.com/mitchellh/vagrant/issues
IRC: #vagrant on Freenode
---
You received this message because you are subscribed to the Google Groups "Vagrant" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vagrant-up+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/vagrant-up/CAHqq0ezDUeXmX40B%3D_pn3fucoXBpV11Tt4Yz9geKbueQnOoGhg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Alvaro Miranda Aguilera

unread,
Jun 5, 2018, 1:21:19 PM6/5/18
to vagra...@googlegroups.com
you could open virtual box gui, halt/power off the VM

and turn it on manually without vagrant

that will show any error and you will able to see the VM console too

alvaro

On Tue, Jun 5, 2018 at 4:52 PM, Jo Knight <jokn...@gmail.com> wrote:
​Thanks, any idea how I could start to troubleshoot this on Ubuntu?​

On Tue, 5 Jun 2018 at 15:34, Alvaro Miranda Aguilera <kik...@gmail.com> wrote:
This works for me.

Host is mac book pro 13" i7

0  $ cat Vagrantfile 

Vagrant.configure("2") do |config|

  config.vm.box = "hashicorp/precise64"

  config.vm.provider "virtualbox" do |v|

    v.memory = 1024

    v.cpus = 4

    v.customize ["modifyvm", :id, "--ioapic", "on"]

  end

end

0  $ 


--
This mailing list is governed under the HashiCorp Community Guidelines - https://www.hashicorp.com/community-guidelines.html. Behavior in violation of those guidelines may result in your removal from this mailing list.
 
GitHub Issues: https://github.com/mitchellh/vagrant/issues
IRC: #vagrant on Freenode
---
You received this message because you are subscribed to the Google Groups "Vagrant" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vagrant-up+unsubscribe@googlegroups.com.

--
This mailing list is governed under the HashiCorp Community Guidelines - https://www.hashicorp.com/community-guidelines.html. Behavior in violation of those guidelines may result in your removal from this mailing list.
 
GitHub Issues: https://github.com/mitchellh/vagrant/issues
IRC: #vagrant on Freenode
---
You received this message because you are subscribed to the Google Groups "Vagrant" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vagrant-up+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/vagrant-up/CAFKre0eV-j%2B_-tU-LTdeb5GuWe_vx6GKrXrh8gEBOV_dHhJXeg%40mail.gmail.com.

For more options, visit https://groups.google.com/d/optout.



--
Alvaro

Jo Knight

unread,
Jun 5, 2018, 1:40:43 PM6/5/18
to vagra...@googlegroups.com
I am running on a headless server so no access to the gui. 


Can I do the same from the cli?

To unsubscribe from this group and stop receiving emails from it, send an email to vagrant-up+...@googlegroups.com.

--
This mailing list is governed under the HashiCorp Community Guidelines - https://www.hashicorp.com/community-guidelines.html. Behavior in violation of those guidelines may result in your removal from this mailing list.
 
GitHub Issues: https://github.com/mitchellh/vagrant/issues
IRC: #vagrant on Freenode
---
You received this message because you are subscribed to the Google Groups "Vagrant" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vagrant-up+...@googlegroups.com.
--
This mailing list is governed under the HashiCorp Community Guidelines - https://www.hashicorp.com/community-guidelines.html. Behavior in violation of those guidelines may result in your removal from this mailing list.
 
GitHub Issues: https://github.com/mitchellh/vagrant/issues
IRC: #vagrant on Freenode
---
You received this message because you are subscribed to the Google Groups "Vagrant" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vagrant-up+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/vagrant-up/CAHqq0ew8A1RFPCrmbaK0imC7ZwkjY8OJtcn-0nzq_-%2BqRr_jJw%40mail.gmail.com.

For more options, visit https://groups.google.com/d/optout.
--
Sent from my iPhone

Alvaro Miranda Aguilera

unread,
Jun 5, 2018, 2:25:27 PM6/5/18
to vagra...@googlegroups.com
i am not aware how to see the console and pop-up for errors.

vnc/rdp an option?

can you create/boot vms with more cpus outside vagrant?

if you poweroff/poweron the VM manually vagrant won't be part of the picture so is a good test


To unsubscribe from this group and stop receiving emails from it, send an email to vagrant-up+unsubscribe@googlegroups.com.

--
This mailing list is governed under the HashiCorp Community Guidelines - https://www.hashicorp.com/community-guidelines.html. Behavior in violation of those guidelines may result in your removal from this mailing list.
 
GitHub Issues: https://github.com/mitchellh/vagrant/issues
IRC: #vagrant on Freenode
---
You received this message because you are subscribed to the Google Groups "Vagrant" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vagrant-up+unsubscribe@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.



--
Alvaro

--
This mailing list is governed under the HashiCorp Community Guidelines - https://www.hashicorp.com/community-guidelines.html. Behavior in violation of those guidelines may result in your removal from this mailing list.
 
GitHub Issues: https://github.com/mitchellh/vagrant/issues
IRC: #vagrant on Freenode
---
You received this message because you are subscribed to the Google Groups "Vagrant" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vagrant-up+unsubscribe@googlegroups.com.
--
Sent from my iPhone

--
This mailing list is governed under the HashiCorp Community Guidelines - https://www.hashicorp.com/community-guidelines.html. Behavior in violation of those guidelines may result in your removal from this mailing list.
 
GitHub Issues: https://github.com/mitchellh/vagrant/issues
IRC: #vagrant on Freenode
---
You received this message because you are subscribed to the Google Groups "Vagrant" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vagrant-up+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/vagrant-up/CAFKre0cf09DiBTsUC2z8wW%2BpE4o5xD50_WWGfEu13c0i3OPmTg%40mail.gmail.com.

For more options, visit https://groups.google.com/d/optout.



--
Alvaro

Jo Knight

unread,
Jun 6, 2018, 4:38:34 PM6/6/18
to vagra...@googlegroups.com
My VirtualBox fu isnt that strong so not sure what I am doing with it.

To unsubscribe from this group and stop receiving emails from it, send an email to vagrant-up+...@googlegroups.com.

--
This mailing list is governed under the HashiCorp Community Guidelines - https://www.hashicorp.com/community-guidelines.html. Behavior in violation of those guidelines may result in your removal from this mailing list.
 
GitHub Issues: https://github.com/mitchellh/vagrant/issues
IRC: #vagrant on Freenode
---
You received this message because you are subscribed to the Google Groups "Vagrant" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vagrant-up+...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.



--
Alvaro

--
This mailing list is governed under the HashiCorp Community Guidelines - https://www.hashicorp.com/community-guidelines.html. Behavior in violation of those guidelines may result in your removal from this mailing list.
 
GitHub Issues: https://github.com/mitchellh/vagrant/issues
IRC: #vagrant on Freenode
---
You received this message because you are subscribed to the Google Groups "Vagrant" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vagrant-up+...@googlegroups.com.
--
Sent from my iPhone

--
This mailing list is governed under the HashiCorp Community Guidelines - https://www.hashicorp.com/community-guidelines.html. Behavior in violation of those guidelines may result in your removal from this mailing list.
 
GitHub Issues: https://github.com/mitchellh/vagrant/issues
IRC: #vagrant on Freenode
---
You received this message because you are subscribed to the Google Groups "Vagrant" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vagrant-up+...@googlegroups.com.



--
Alvaro

--
This mailing list is governed under the HashiCorp Community Guidelines - https://www.hashicorp.com/community-guidelines.html. Behavior in violation of those guidelines may result in your removal from this mailing list.
 
GitHub Issues: https://github.com/mitchellh/vagrant/issues
IRC: #vagrant on Freenode
---
You received this message because you are subscribed to the Google Groups "Vagrant" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vagrant-up+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/vagrant-up/CAHqq0ezd3b2pwKBtkq33KeHUiRqpZ8QARBV5ka7Qw4OeWx5AmA%40mail.gmail.com.

Jo Knight

unread,
Jun 11, 2018, 9:56:32 AM6/11/18
to vagra...@googlegroups.com
Hi,

I've attempted to start the VM outside of Vagrant but still see the same behaviour. So not really sure where to go with this - I have a couple of servers that i am running this on and see the same on both anytime I try to increase the CPU to > 1 (both servers have multiple CPU cores and have VT-x enabled.)

Any assistance of what to look at on the VirtualBox side greatly appreciated (I know this is the vagrant-up list, but would ideally like to get this working through Vagrant).

Thanks.

Alvaro Miranda Aguilera

unread,
Jun 11, 2018, 11:24:20 AM6/11/18
to vagra...@googlegroups.com
Hello

The machine where Vagrant + Virtualbox is installed.
is a real machine or a virtual machine?

Is local or a provider somewhere, ie cloud ?

Whats the HOST os?

Who install the OS + apps?

Alvaro

To unsubscribe from this group and stop receiving emails from it, send an email to vagrant-up+unsubscribe@googlegroups.com.

--
This mailing list is governed under the HashiCorp Community Guidelines - https://www.hashicorp.com/community-guidelines.html. Behavior in violation of those guidelines may result in your removal from this mailing list.
 
GitHub Issues: https://github.com/mitchellh/vagrant/issues
IRC: #vagrant on Freenode
---
You received this message because you are subscribed to the Google Groups "Vagrant" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vagrant-up+unsubscribe@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.



--
Alvaro

--
This mailing list is governed under the HashiCorp Community Guidelines - https://www.hashicorp.com/community-guidelines.html. Behavior in violation of those guidelines may result in your removal from this mailing list.
 
GitHub Issues: https://github.com/mitchellh/vagrant/issues
IRC: #vagrant on Freenode
---
You received this message because you are subscribed to the Google Groups "Vagrant" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vagrant-up+unsubscribe@googlegroups.com.
--
Sent from my iPhone

--
This mailing list is governed under the HashiCorp Community Guidelines - https://www.hashicorp.com/community-guidelines.html. Behavior in violation of those guidelines may result in your removal from this mailing list.
 
GitHub Issues: https://github.com/mitchellh/vagrant/issues
IRC: #vagrant on Freenode
---
You received this message because you are subscribed to the Google Groups "Vagrant" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vagrant-up+unsubscribe@googlegroups.com.



--
Alvaro

--
This mailing list is governed under the HashiCorp Community Guidelines - https://www.hashicorp.com/community-guidelines.html. Behavior in violation of those guidelines may result in your removal from this mailing list.
 
GitHub Issues: https://github.com/mitchellh/vagrant/issues
IRC: #vagrant on Freenode
---
You received this message because you are subscribed to the Google Groups "Vagrant" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vagrant-up+unsubscribe@googlegroups.com.

--
This mailing list is governed under the HashiCorp Community Guidelines - https://www.hashicorp.com/community-guidelines.html. Behavior in violation of those guidelines may result in your removal from this mailing list.
 
GitHub Issues: https://github.com/mitchellh/vagrant/issues
IRC: #vagrant on Freenode
---
You received this message because you are subscribed to the Google Groups "Vagrant" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vagrant-up+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/vagrant-up/CAFKre0dqSem0AF-d197JupKw1Y-D47-rBHZfu9nFeSjb%3DfzsYA%40mail.gmail.com.

For more options, visit https://groups.google.com/d/optout.



--
Alvaro

Jo Knight

unread,
Jun 11, 2018, 11:28:45 AM6/11/18
to vagra...@googlegroups.com

It is a physical machine running Ubuntu 16.04 

To unsubscribe from this group and stop receiving emails from it, send an email to vagrant-up+...@googlegroups.com.

--
This mailing list is governed under the HashiCorp Community Guidelines - https://www.hashicorp.com/community-guidelines.html. Behavior in violation of those guidelines may result in your removal from this mailing list.
 
GitHub Issues: https://github.com/mitchellh/vagrant/issues
IRC: #vagrant on Freenode
---
You received this message because you are subscribed to the Google Groups "Vagrant" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vagrant-up+...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.



--
Alvaro

--
This mailing list is governed under the HashiCorp Community Guidelines - https://www.hashicorp.com/community-guidelines.html. Behavior in violation of those guidelines may result in your removal from this mailing list.
 
GitHub Issues: https://github.com/mitchellh/vagrant/issues
IRC: #vagrant on Freenode
---
You received this message because you are subscribed to the Google Groups "Vagrant" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vagrant-up+...@googlegroups.com.
--
Sent from my iPhone

--
This mailing list is governed under the HashiCorp Community Guidelines - https://www.hashicorp.com/community-guidelines.html. Behavior in violation of those guidelines may result in your removal from this mailing list.
 
GitHub Issues: https://github.com/mitchellh/vagrant/issues
IRC: #vagrant on Freenode
---
You received this message because you are subscribed to the Google Groups "Vagrant" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vagrant-up+...@googlegroups.com.



--
Alvaro

--
This mailing list is governed under the HashiCorp Community Guidelines - https://www.hashicorp.com/community-guidelines.html. Behavior in violation of those guidelines may result in your removal from this mailing list.
 
GitHub Issues: https://github.com/mitchellh/vagrant/issues
IRC: #vagrant on Freenode
---
You received this message because you are subscribed to the Google Groups "Vagrant" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vagrant-up+...@googlegroups.com.

--
This mailing list is governed under the HashiCorp Community Guidelines - https://www.hashicorp.com/community-guidelines.html. Behavior in violation of those guidelines may result in your removal from this mailing list.
 
GitHub Issues: https://github.com/mitchellh/vagrant/issues
IRC: #vagrant on Freenode
---
You received this message because you are subscribed to the Google Groups "Vagrant" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vagrant-up+...@googlegroups.com.
--
This mailing list is governed under the HashiCorp Community Guidelines - https://www.hashicorp.com/community-guidelines.html. Behavior in violation of those guidelines may result in your removal from this mailing list.
 
GitHub Issues: https://github.com/mitchellh/vagrant/issues
IRC: #vagrant on Freenode
---
You received this message because you are subscribed to the Google Groups "Vagrant" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vagrant-up+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/vagrant-up/CAHqq0exdagz2PpG1vU3D46GnLbxdn0qu05GDYyUYLNo_U6uTNw%40mail.gmail.com.

For more options, visit https://groups.google.com/d/optout.

Jo Knight

unread,
Jun 12, 2018, 6:00:40 AM6/12/18
to vagra...@googlegroups.com
I should add that This is my own server so I installed the software and OS.

pixel fairy

unread,
Jun 24, 2018, 4:07:53 PM6/24/18
to Vagrant
you can it all from the cli in virtualbox, https://www.virtualbox.org/manual/ch08.html

or, you can run the gui over X11, ssh -X youhost, then virtualbox will give you the gui.

if you want a faster gui, you can install xrdp on your host. i recommend openbox as a
window manager.

the following worked, and /proc/cpuinfo in the guest showed two cpus

Vagrant.configure("2") do |config|
  config
.vm.box = "hashicorp/precise64"

  config
.vm.provider :virtualbox do |vb|
    vb
.customize ["modifyvm", :id, "--ioapic", "on"]
    vb
.cpus = 2
 
end
end

i also have a remote vagrant server, but mines libvirt, which you cant mix with virtualbox. but, you can run virtualbox in kvm. heres the vagrantfile that made the host and guest. vagrant-libvirt is a little rough around the edges, and has a stupid syntax for ipv6, but its performance and versatility has totally been worth it. with it, you can run virt-manager on your own host and go from there. (if your running qubes-os, you'll have to settle for virt-manager over ssh -X)

this might also be relevant to your interests, https://gist.github.com/xahare/1db2970b7b684c0d54c0c15cc32afb98

# -*- mode: ruby -*-
# vi: set ft=ruby :

VAGRANTFILE_API_VERSION
= "2"

vagrant_setup
= <<-SCRIPT
apt
-get update
apt
-get -y upgrade
apt
-get -y install virtualbox vagrant
SCRIPT

vagrant_test
= <<-SCRIPT
mkdir
-p test
cd test
cat
<<EOF>Vagrantfile

Vagrant.configure("2") do |config|
  config
.vm.box = "hashicorp/precise64"

  config
.vm.provider :virtualbox do |vb|
    vb
.customize ["modifyvm", :id, "--ioapic", "on"]
    vb
.cpus = 2
 
end
end
EOF
vagrant up
--provider=virtualbox
SCRIPT

Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
  config
.vm.synced_folder ".", "/vagrant", disabled: true
  config
.vm.box = "peru/ubuntu-18.04-desktop-amd64"
  config
.vm.provider "libvirt" do |libvirt|
    libvirt
.input type: "tablet", bus: "usb"
    libvirt
.cpus = 4
    libvirt
.memory = 4096
    libvirt
.nested = true
 
end
  config
.vm.provision "shell", inline: vagrant_setup
  config
.vm.provision "shell", inline: vagrant_test, privileged: false
end


Reply all
Reply to author
Forward
0 new messages