为http共享框执行Vargrant Up时出错500

时间:2016-02-26 08:09:10

标签: vagrant virtual-machine vagrant-windows

我正在创建一个流媒体的Windows Server 2012基础框,我想在内部共享它,我正在使用Vagrant http共享以下命令

流浪汉分享--http 80

    C:\Isentia\Vagrant>vagrant share --http 80
==> dev: Detecting network information for machine...
    dev: Local machine address: 169.254.202.14
    dev: Local HTTP port: 80
    dev: Local HTTPS port: disabled
==> dev: Checking authentication and authorization...
==> dev: Creating Vagrant Share session...
    dev: Share will be at: caring-dragon-2751
==> dev: Your Vagrant Share is running! Name: caring-dragon-2751
==> dev: URL: http://caring-dragon-2751.vagrantshare.com

并在另一台机器中使用vagrant up访问该框

    C:\Isentia\DevVM>vagrant init http://caring-dragon-2751.vagrantshare.com:80
A `Vagrantfile` has been placed in this directory. You are now
ready to `vagrant up` your first virtual environment! Please read
the comments in the Vagrantfile as well as documentation on
`vagrantup.com` for more information on using Vagrant.

C:\Isentia\DevVM>vagrant up
Bringing machine 'default' up with 'virtualbox' provider...
==> default: Box 'http://caring-dragon-2751.vagrantshare.com:80' could not be fo
und. Attempting to find and install...
    default: Box Provider: virtualbox
    default: Box Version: >= 0
==> default: Box file was not detected as metadata. Adding it directly...
==> default: Adding box 'http://caring-dragon-2751.vagrantshare.com:80' (v0) for
 provider: virtualbox
    default: Downloading: http://caring-dragon-2751.vagrantshare.com:80
    default: Progress: 0% (Rate: 0curl:/s, Estimated time remaining: --:--:--)
An error occurred while downloading the remote file. The error
message, if any, is reproduced below. Please fix this error and try
again.

The requested URL returned error: 500 Internal Server Error

下面是流浪文件内容

Vagrant.configure(2) do |config| 
  config.vm.box = "BuzzNumberDevBox"
  config.vm.guest = :windows
  config.vm.communicator = "winrm"
  config.vm.boot_timeout = 600
  config.vm.graceful_halt_timeout = 600
  # Admin user name and password
  config.winrm.username = "vagrant"
  config.winrm.password = "vagrant"  
  config.vm.define "dev" do |dev|
    dev.vm.network "private_network", ip: "192.168.100.10"
    dev.vm.host_name = "vagranttests.dev"
    dev.vm.network :forwarded_port, guest: 5985, host: 5985, id: "winrm", auto_correct: true
  end
  config.vm.provider :virtualbox do |vb|
      # Customize the name of VM in VirtualBox manager UI:
      vb.name = "BuzzNumber-Dev-VM-Web"
  end
end

我不明白的是什么可以阻止它从任何机器访问。文档要求直接使用该链接。

1 个答案:

答案 0 :(得分:0)

Vagrant共享旨在共享对VM上托管的应用程序的访问权限,而不是用于共享实际的VM。如果您想共享VM本身,您需要运行vagrant包来打包它,然后将它放在带有metadata.json的Web服务器上,或者放在另一个用户可以直接添加它的URL上。您是否可以澄清是否要将此复制框复制到另一台机器或只是访问在初始流浪盒上运行的服务?

相关问题