Vagrant: SMB Shares are not supported in file: URLs

Created on 2 Jul 2018  ยท  5Comments  ยท  Source: hashicorp/vagrant

Vagrant version

2.1.2

Host operating system

Windows 10

Guest operating system

Ubuntu 16.04

Vagrantfile

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

### Change here for more memory/cores/displays ###
VM_MEMORY=8192
VM_CORES=4
MONITOR_COUNT=2
EXECUTION_CAP=95

FORD_VAGRANT_SHARE_FOLDER='//pikachu/proj/Images/Tools/Vagrant'

Vagrant.configure('2') do |config|
    config.vm.box_check_update = true
    config.vm.box = 'TEST/ubuntu-desktop'
    config.vm.box_url = "file://#{VAGRANT_SHARE_FOLDER}/test-ubuntu-desktop.json"

    if Vagrant.has_plugin?("vagrant-proxyconf")
        config.proxy.http     = ENV['HTTP_PROXY']
        config.proxy.https    = ENV['HTTPS_PROXY']
        config.proxy.no_proxy = ENV['NO_PROXY']
        config.proxy.enabled  = ENV.fetch('HTTP_PROXY', false)
    end

    config.vm.provider :virtualbox do |v, override|
        v.memory = VM_MEMORY
        v.cpus = VM_CORES
        v.gui = true
        v.customize ["modifyvm", :id, "--monitorcount", MONITOR_COUNT]
        v.customize ["modifyvm", :id, "--cpuexecutioncap", EXECUTION_CAP]
        v.customize ['modifyvm', :id, '--usb', "on"]
        v.customize ["modifyvm", :id, "--accelerate3d", "off"]

        required_plugins = %w( vagrant-vbguest )
        required_plugins.each do |plugin|
          system "vagrant plugin install #{plugin}" unless Vagrant.has_plugin? plugin
        end
    end

end

Debug output

Relevant section only:
https://gist.github.com/sparris9/4740f0fa093bf9f0550d0cb03cf1ae0c

Expected behavior

Curl should reach the file on the network share

Actual behavior

Curl does not reach the file on the network share

Steps to reproduce

  1. Put box image on Samba share
  2. Create JSON descriptor linking to box image
  3. Create Vagrantfile linking to JSON descriptor
  4. Run vagrant up

References

Are there any other GitHub issues (open or closed) that should be linked here?
For example:

installer

Most helpful comment

Is anyone willing to fix this issue? It worked until 2.1.0 using six slashes, then four slashes in 2.1.1, then completely broken in 2.1.2. This is truly unfortunate for many enterprise users like me, I maintain multiple boxes on file shares, how does this keep happening? :/

All 5 comments

Just wanted to add, for anyone else having this, a workaround is to go back down to vagrant 2.1.1 AND make sure you reference all your SMB shares paths with 4 forward slashes. ( Some previous tickets said to use 6 which hasn't worked for me )

Example:

vagrantfile:
config.vm.box_url = "file:////smb-share/catalog.json"

catalog file:
"url": "file:////smb-box-share/vbox.box"

Is anyone willing to fix this issue? It worked until 2.1.0 using six slashes, then four slashes in 2.1.1, then completely broken in 2.1.2. This is truly unfortunate for many enterprise users like me, I maintain multiple boxes on file shares, how does this keep happening? :/

Well, I just had a check today and it looks like samba is working again on Vagrant 2.1.5.

@briancain What keeps changing? Seems like no one over there is tracking this issue.

Hey there @sparris9 - this issue should of been closed via this pull request https://github.com/hashicorp/vagrant-installers/pull/141. It was just missed is all. Thanks for checking in! I'll go ahead and close this issue.

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.

Was this page helpful?
0 / 5 - 0 ratings