Please note that the Vagrant issue tracker is reserved for bug reports and
enhancements. For general usage questions, please use the Vagrant mailing list:
https://groups.google.com/forum/#!forum/vagrant-up. Thank you!
Vagrant 1.8.7
Version 5.1.8 r111374 (Qt5.5.1)
OS Name Microsoft Windows 10 Pro
Version 10.0.14393 Build 14393
Centos 7
require 'base64'
require 'yaml'
require 'json'
Vagrant.require_version ">= 1.8.0"
Vagrant.configure("2") do |config|
env_file = File.dirname(__FILE__) + "/env.json"
if File.exists?(env_file)
env = JSON.parse(IO.read(env_file))
else
env = {}
end
box_url = (env['centos_version'] == "centos6") ? "https://myshare.box.com/shared/static/s0jvhavqu7jqukn48jnqab40ed1ff4kn.box" : "https://myshare.box.com/shared/static/51hsyyeunsebzgejp5g4kfdxo9k4sx0p.box"
ip_addr = (env['centos_version'] == "centos6") ? '192.168.193.10' : '192.168.193.22'
hostname = (env['centos_version'] == "centos6") ? 'sandbox.foo.co.uk' : 'cloud7.sandbox.foo.co.uk'
config.vm.box = (env['centos_version'] == "centos6") ? "centos6-sandbox" : "centos7-sandbox"
config.ssh.username = "developer"
config.ssh.host = hostname
config.ssh.port = 22
config.ssh.forward_agent = true
config.vm.network :forwarded_port, guest: 22, host: 2223, id: "ssh", disabled: "true"
config.vm.network "private_network", ip: ip_addr, name: 'VirtualBox Host-Only Ethernet Adapter #7', adapter: 1
config.vm.box_url = box_url
config.vm.box_download_insecure = true
#cert in pem format
if ENV['cert_path'] || env['cert_path']
cert = ENV['cert_path'] || env['cert_path']
config.vm.box_download_client_cert = "#{cert}"
#puts "#{cert}:#{pw}"
env['certificate'] = {
"file" => Base64.encode64(IO.read(cert))
}
end
workspace = "~/workspace"
if ENV['workspace'] || env['workspace']
workspace = ENV['workspace'] || env['workspace']
end
config.vm.synced_folder workspace, "/mnt/hgfs/workspace", :mount_options => ["dmode=777", "fmode=666"]
# config.vm.provision "shell", inline: "sudo -u developer -H -i /usr/sbin/reithproxies $1", args: reithproxies
config.vm.provision "file", source: "repos/", destination: "/tmp/"
config.vm.provision "file", source: "configFiles/", destination: "/tmp/"
# file provisioner doesn't have access to /etc but shell does
config.vm.provision "shell", inline: "mv /tmp/repos/*.repo /etc/yum.repos.d/"
config.vm.provision "shell", path: "guest_setup_script.py", args: [env['cert_path']]
config.vm.provider :virtualbox do |vb|
vb.name = (env['centos_version'] == "centos6") ? "CentOS-6-Sandbox" : "CentOS-7-Sandbox"
vb.customize ["modifyvm", :id, "--usbehci", "off"]
end
end
Please note, if you are using Homestead or a different Vagrantfile format, we
may be unable to assist with your issue. Try to reproduce the issue using a
vanilla Vagrantfile first.
https://gist.github.com/Jayflux/6ff1aa5b2b48fb97f65f4e85f8d94d66
Vagrant/virtualbox should be using the host-only name i set in the vagrantfile.
Virtualbox seems to be looking for "VirtualBox Host-Only Ethernet Adapter" instead of "VirtualBox Host-Only Ethernet Adapter #7" unfortunately i cannot rename the adapters on windows.
If i remove the # then it searches for "VirtualBox Host-Only Ethernet Adapter 7" (which still does not exist), it looks like the pound sign is causing some truncation

The screenshot shows is all good ?
@kikitux see https://gist.github.com/Jayflux/6ff1aa5b2b48fb97f65f4e85f8d94d66#file-gistfile1-txt-L3441
https://gist.github.com/Jayflux/6ff1aa5b2b48fb97f65f4e85f8d94d66#file-gistfile1-txt-L3449
from the gist i posted
The setup (screenshot) is fine, but the CLI is showing vagrant is cutting off the #7
Have you tried to escape the '#'?
Something like:
name: 'VirtualBox Host-Only Ethernet Adapter \#7'
@kenfusion yup! had no luck at all!
I've tried VirtualBox Host-Only Ethernet Adapter \#7 and had the same issue.
If it helps you guys, [kind of related], i've noticed that Virtualbox doesn't clean up old Host-only interfaces. So its impossible for me to go back to VirtualBox Host-Only Ethernet Adapter even if i uninstall Virtualbox and reinstall it, it will start my first Host-Only network interface at VirtualBox Host-Only Ethernet Adapter #7
@kenfusion @kikitux @chrisroberts any idea?
@Jayflux Hi! Can you try this setup on the recent release of both Vagrant and VirtualBox? I attempted to replicate the behavior but I see the correct name being used within the VMs settings. If it's still not working, please let me know. Thanks!

@chrisroberts thanks for replying!
sure will try when i get back home.
btw the problem here isn't with Virtualbox, its vagrant failing to start up if the Network Adapter has a # in the name. The # gets truncated, so vagrant ends up looking for 'VirtualBox Host-Only Ethernet Adapter' instead of 'VirtualBox Host-Only Ethernet Adapter #2'
Whats doubly annoying is VirtualBox doesn't allow me to change the host-only adapter name on windows :(
Will have a try
@Jayflux You bet. The VM in the image above was created with Vagrant and properly setup without truncating the name (at least on my machine). Hopefully it will do the same for you, but please do reply back either way. Cheers!
@chrisroberts in the meantime, could you share with me the Vagrantfile you used, version of Windows and version of Vagrant / VirtualBox ?
@Jayflux Sure: win10-15063 / vagrant 1.9.4.pre (build off master) / vbox 5.1.18
@chrisroberts still not working for me
ฮป vagrant up
Bringing machine 'default' up with 'virtualbox' provider...
==> default: Clearing any previously set network interfaces...
==> default: Preparing network interfaces based on configuration...
default: Adapter 1: hostonly
==> default: Forwarding ports...
==> default: Running 'pre-boot' VM customizations...
==> default: Booting VM...
There was an error while executing `VBoxManage`, a CLI used by Vagrant
for controlling VirtualBox. The command and stderr is shown below.
Command: ["startvm", "ba615f69-6e47-476b-ac2a-a871259dc074", "--type", "headless"]
Stderr: VBoxManage.exe: error: Interface ('VirtualBox Host-Only Ethernet Adapter') is not a Host-Only Adapter interface (VERR_INTERNAL_ERROR)
VBoxManage.exe: error: Details: code E_FAIL (0x80004005), component ConsoleWrap, interface IConsole

This is something that used to work, so there's been a regression somewhere, just working out what.
im on #vagrant if that helps
Vagrant 1.9.3
Virtualbox 5.1.20
Closing this up as it turned out to be an issue with the box. Cheers!
hey @chrisroberts, I know this ticket is closed, but i found out the problem.
I was poking around in C:\Users\Jason\.vagrant.d\boxes\centos7-sandbox\0\virtualbox\include and i found this
if Gem.win_platform?
VBOX_ADAPTER = 'VirtualBox Host-Only Ethernet Adapter'
VBOXMANAGE_COMMAND = 'C:/Program Files/Oracle/VirtualBox/VBoxManage.exe'
WORKSPACE = ('//?/' + ENV['HOME'] + '/workspace').gsub('/', "\\")
else
VBOX_ADAPTER = 'vboxnet0'
VBOXMANAGE_COMMAND = 'VBoxManage'
WORKSPACE = ENV['HOME'] + '/workspace'
end
I'm guessing whoever made this .box hardcoded it to VirtualBox Host-Only Ethernet Adapter, i don't really know how the whole box thing works, but this here is a base Vagrantfile? Anyway, don't know why mine wasn't overriding it.
I changed it to VBOX_ADAPTER = 'VirtualBox Host-Only Ethernet Adapter #7' and i works
I'm going to lock this issue because it has been closed for _30 days_ โณ. This helps our maintainers find and focus on the active issues.
If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.