Error VT-x not available for Vagrant machine inside Virtualbox

后端 未结 7 765
无人共我
无人共我 2020-12-13 02:36

I have an Ubuntu Virtual machine that is configured to have VT-x enabled, 6 Processors, and 25 GB RAM.

Inside that virtual machine I am trying to start a vagrant mac

相关标签:
7条回答
  • 2020-12-13 03:08

    You can only use one virtual CPU without VT-x. Thus, the error message stating that VT-x isn't enabled is caused by the following line:

    vb.customize ["modifyvm", :id, "--cpus", "2"]

    Replacing it with the following works (Vagrant has a shorthand for setting the CPU count):

    vb.cpus = 1

    NOTE: You can only run 32-bit VMs inside another VM.

    0 讨论(0)
  • 2020-12-13 03:12

    If you're using packer and running into this error please make sure you have enough CPU's to actually stand up the image.

    I had stated to build the image with two CPUs but was only running a 2 core VM myself. Changed it down to 1 cpu and build ran without any errors.

    0 讨论(0)
  • 2020-12-13 03:14

    UPDATED: As pointed out below, you can use nested VirtualBox + vagrant provided that only 1 virtual CPU is assigned to the nested VM, plus nested VM guest is 32-bit OS.

    0 讨论(0)
  • 2020-12-13 03:16

    Vagrant in nested Virtual Box

    First of all you can run definitely Vagrant inside a nested Virtual Box.

    VT-X Support (related to VirtualBox)

    Currently VirtualBox is not supporting nesting VT-X. There is currently a feature request pending(see.: https://www.virtualbox.org/ticket/4032) but as of now it is not expected to be in a new version of VirtualBox

    Consequences from missing VT-X in nested VirtualBox

    There are currently two consequences from nesting without VT-X:

    1. You cannot use multiple CPUs but you can use a single virtual cpu using vb.cpus = 1
    2. You cannot run a 64-Bit VM within a nested VirtualBox.
    0 讨论(0)
  • 2020-12-13 03:19

    You can not use the first VM as Virtual Box one. That's sure. But what you can do is, make the first VM ( Ubuntu) based on VMware Player 7, then you can set up Vagrant on that. Tested and confirmed on my own. VMplayer version 7 and Virtual Box version 5.0.20. Thanks to the comment from Rudolf in the same page

    0 讨论(0)
  • 2020-12-13 03:27

    If you run vagrant + VirtualBox within a VirtualBox virtual machine and you face networking problems :

    Don't forget to set the right virtual network adapter

    I had to set the Adapter type to Paravirtualized Network (virtio-net)

    in Settings -> Network -> Advanced to make it work

    0 讨论(0)
提交回复
热议问题