Reputation: 10134
I tried to follow the following answer and make the xdebug installed to vagrant to get connected into the atom.
So in my Vagrantfile
I have put the following setting:
config.vm.network :forwarded_port, guest: 9000, host: 9000
Resulting the following Vagrantfile
is:
# -*- mode: ruby -*-
# vi: set ft=ruby :
require 'json'
require 'yaml'
VAGRANTFILE_API_VERSION ||= "2"
confDir = $confDir ||= File.expand_path("vendor/laravel/homestead", File.dirname(__FILE__))
homesteadYamlPath = File.expand_path("Homestead.yaml", File.dirname(__FILE__))
homesteadJsonPath = File.expand_path("Homestead.json", File.dirname(__FILE__))
afterScriptPath = "after.sh"
aliasesPath = "aliases"
require File.expand_path(confDir + '/scripts/homestead.rb')
Vagrant.require_version '>= 1.9.0'
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
if File.exist? aliasesPath then
config.vm.provision "file", source: aliasesPath, destination: "/tmp/bash_aliases"
config.vm.provision "shell" do |s|
s.inline = "awk '{ sub(\"\r$\", \"\"); print }' /tmp/bash_aliases > /home/vagrant/.bash_aliases"
end
end
if File.exist? homesteadYamlPath then
settings = YAML::load(File.read(homesteadYamlPath))
elsif File.exist? homesteadJsonPath then
settings = JSON.parse(File.read(homesteadJsonPath))
else
abort "Homestead settings file not found in #{confDir}"
end
Homestead.configure(config, settings)
if File.exist? afterScriptPath then
config.vm.provision "shell", path: afterScriptPath, privileged: false, keep_color: true
end
if defined? VagrantPlugins::HostsUpdater
config.hostsupdater.aliases = settings['sites'].map { |site| site['map'] }
end
config.vm.network :forwarded_port, guest: 9000, host: 9000
end
And I tried to start it via the following command:
vagrant up --provision
But I get the following error:
There was an error while executing
VBoxManage
, a CLI used by Vagrant for controlling VirtualBox. The command and stderr is shown below.Command: ["startvm", "12135e8c-7547-4c7e-a25c-58a7136fb600", "--type", "headless"]
Stderr: VBoxManage: error: The VMMR0.r0 module version does not match VBoxVMM.dll/so/dylib. If you just upgraded VirtualBox, please terminate all VMs and make sure that neither VBoxNetDHCP nor VBoxNetNAT is running. Then try again. If this error persists, try re-installing VirtualBox. (VERR_VMM_R0_VERSION_MISMATCH) VBoxManage: error: Details: code NS_ERROR_FAILURE (0x80004005), component ConsoleWrap, interface IConsole
My version of Virtualbox is the 5.1.38_Ubuntur122592
one (from command VboxManage -v
).
Do you know how I can fix it?
Upvotes: 2
Views: 2198
Reputation: 10134
You should follow these steps mentioned in here. The steps are:
First uninstall the virtualbox:
sudo apt-get remove virtualbox virtualbox-ose virtualbox-qt
Then run the following command:
find / -name '*VMMR0*' -o -name '*VBoxVMM*'
Then install it back:
sudo apt-get install virtualbox virtualbox-qt
Afterwards cd
to your project's root path and run
vagrant up
In my case I had to repeat these steps twice in order to make it working.
Upvotes: 3