I'd like to run VirtualBox using Vagrantfile and Ansible.
In first place I turn on virtualization in my BIOS:
And turn on Linux subsystem on Windows.
Then I work on Bash on Windows.
I install VirtualBox:
sudo apt-get update
sudo apt-get install virtualbox
Then I install Vagrant:
sudo apt-get update
sudo apt-get install vagrant
And then I install Ansible:
sudo apt-get install software-properities-common
sudo apt-get-repository ppa:ansible/ansible
sudo apt-get update
sudo apt-get install ansible
I have Vagrantfile:
# -*- 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
So, I try to run it
vagrant up
But I have an error:
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
Of course, I check:
VBoxManage --version
And I see:
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
When I try to install it
apt-get install virtualbox-dkms
It says that the latest version is installed yet.
Also I tried:
sudo dpkg-reconfigure virtualbox-dkms
Successfull, but error is still here
sudo apt-get install linux-headers-generic
Successfull, but error is still here
My CPU isn't support Secure Boot in BIOS.
I have Windows 10 Professional.
My hardware: Dual Core AMD Athlon II X2 250, 3000 MHz Asus M5A78L-M LX3 16 Gb DRAM
So, how can I run my Vagrantfile? Thanks for your help!