VirtualBox使用Vagrantfile和Ansible:VirtualBox抱怨安装不完整

VirtualBox使用Vagrantfile和Ansible:VirtualBox抱怨安装不完整,vagrant,ansible,windows-10,virtualbox,vagrantfile,Vagrant,Ansible,Windows 10,Virtualbox,Vagrantfile,我想使用Vagrantfile和Ansible运行VirtualBox 首先,我在BIOS中启用虚拟化: 并在Windows上打开Linux子系统 然后我在Windows上开发Bash 我安装VirtualBox: sudo apt-get update sudo apt-get install virtualbox 然后我安装了流浪汉: sudo apt-get update sudo apt-get install vagrant 然后我安装Ansible: sudo apt-get

我想使用Vagrantfile和Ansible运行VirtualBox

首先,我在BIOS中启用虚拟化:

并在Windows上打开Linux子系统

然后我在Windows上开发Bash

我安装VirtualBox:

sudo apt-get update
sudo apt-get install virtualbox
然后我安装了流浪汉:

sudo apt-get update
sudo apt-get install vagrant
然后我安装Ansible:

sudo apt-get install software-properities-common
sudo apt-get-repository ppa:ansible/ansible
sudo apt-get update
sudo apt-get install ansible
我有一份档案:

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

IP = "192.168.33.55"

VAGRANTFILE_API_VERSION = "2"

Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|

  config.vm.box = "ubuntu/xenial64" #target OS: Ubuntu 16.04 LTS

  config.ssh.insert_key = false

  config.vm.synced_folder ".", "/vagrant", disabled: true

  config.ssh.username = "ubuntu"

  config.vm.provider :virtualbox do |v|

    v.name = "jenkins"

    v.memory = 1024

    v.cpus = 2

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

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

  end

  config.vm.hostname = "jenkins"

  config.vm.network :private_network, ip: "192.168.33.55"

  config.vm.network "forwarded_port", guest: 80, host: 8080

  # Set the name of the VM. See: http://stackoverflow.com/a/17864388/100134

  config.vm.define :jenkins do |jenkins|

  end

  # Ansible provisioner.

      config.vm.provision "ansible" do |ansible|

     ansible.playbook = "jenkins/playbook.yml"

     ansible.inventory_path = "jenkins/inventory"

     ansible.sudo = true

  end

end
所以,我试着运行它

vagrant up
但我有一个错误:

VirtualBox is complaining that the installation is incomplete. Please run `VBoxManage --version` to see the error message which should contain instructions on how to fix this error
当然,我检查:

VBoxManage --version
我明白了:

The character device /dev/vboxdrv does not exist. Please install the virtualbox-dkms package and the appropriate headers, most likely linux-headers-3.4.0+. You will not be able to start VMs until this problem is fixed
当我尝试安装它时

 apt-get install virtualbox-dkms
它说最新版本已经安装

我也试过:

 sudo dpkg-reconfigure virtualbox-dkms
成功,但错误仍然存在

 sudo apt-get install linux-headers-generic
成功,但错误仍然存在

 sudo apt-get install linux-headers-generic
我的CPU不支持BIOS中的安全引导

我有Windows10专业版

我的硬件: 双核AMD Athlon II X2 250,3000 MHz 华硕M5A78L-M LX3 16GB内存


那么,我如何运行我的流浪汉文件?谢谢你的帮助

我认为VirtualBox不能在Windows Linux子系统上运行:

考虑在Windows本身上安装VirtualBox。

我认为下一步(也是最后一步)是为vbox编译内核模块,但我不记得那是什么命令。