2017-07-27 29 views
2

我正在一個運行在Roots WP堆棧上的網站上工作,我們現在計劃從xampp切換到vagrant。問題是當我運行「流浪漢」時,沒有任何反應。沒有錯誤,沒有任何輸出,它只是掛起,直到我退出命令。運行vagrant init會創建一個vagrantfile,但流浪者up並沒有什麼。Vagrant不起作用,不會返回任何錯誤(Windows 7)

我正在使用Windows 7,在工作計算機上工作。我過去成功地使用了流浪漢而沒有問題。

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

# All Vagrant configuration is done below. The "2" in Vagrant.configure 
# configures the configuration version (we support older styles for 
# backwards compatibility). Please don't change it unless you know what 
# you're doing. 
Vagrant.configure("2") do |config| 
    # The most common configuration options are documented and commented below. 
    # For a complete reference, please see the online documentation at 
    # https://docs.vagrantup.com. 

    # Every Vagrant development environment requires a box. You can search for 
    # boxes at https://vagrantcloud.com/search. 
    config.vm.box = "precise32" 

    # The url from where the 'config.vm.box' box will be fetched if it 
    # doesn't already exist on the user's system. 
    config.vm.box_url = "http://files.vagrantup.com/precise32.box" 

    # Create a forwarded port mapping which allows access to a specific port 
    # within the machine from a port on the host machine. In the example below, 
    # accessing "localhost:8080" will access port 80 on the guest machine. 
    # NOTE: This will enable public access to the opened port 
    # config.vm.network "forwarded_port", guest: 80, host: 8080 

    # Create a forwarded port mapping which allows access to a specific port 
    # within the machine from a port on the host machine and only allow access 
    # via 127.0.0.1 to disable public access 
    # config.vm.network "forwarded_port", guest: 80, host: 8080, host_ip: "127.0.0.1" 

    # Create a private network, which allows host-only access to the machine 
    # using a specific IP. 
    # config.vm.network "private_network", ip: "192.168.33.10" 

    # Create a public network, which generally matched to bridged network. 
    # Bridged networks make the machine appear as another physical device on 
    # your network. 
    # config.vm.network "public_network" 

    # Share an additional folder to the guest VM. The first argument is 
    # the path on the host to the actual folder. The second argument is 
    # the path on the guest to mount the folder. And the optional third 
    # argument is a set of non-required options. 
    # config.vm.synced_folder "../data", "/vagrant_data" 

    # Provider-specific configuration so you can fine-tune various 
    # backing providers for Vagrant. These expose provider-specific options. 
    # Example for VirtualBox: 
    # 
    # config.vm.provider "virtualbox" do |vb| 
    # # Display the VirtualBox GUI when booting the machine 
    # vb.gui = true 
    # 
    # # Customize the amount of memory on the VM: 
    # vb.memory = "1024" 
    # end 
    # 
    # View the documentation for the provider you are using for more 
    # information on available options. 

    # Enable provisioning with a shell script. Additional provisioners such as 
    # Puppet, Chef, Ansible, Salt, and Docker are also available. Please see the 
    # documentation for more information about their specific syntax and use. 
    # config.vm.provision "shell", inline: <<-SHELL 
    # apt-get update 
    # apt-get install -y apache2 
    # SHELL 
end 
+0

這個職位似乎是重複的。通過下載適用於Windows 7的Windows管理框架,查看此鏈接以獲得完整的解決方案:https://stackoverflow.com/questions/25013526/vagrant-hangs-on-windows-7 – LectureMaker

回答

0

如果Vagrant命令掛在Windows上是因爲它們與VirtualBox通信,這可能是由VirtualBox的權限問題引起的。這很容易解決。以普通用戶或管理員身份啓動VirtualBox會阻止您以相反的方式使用它。請記住,當Vagrant與VirtualBox交互時,它將以與運行Vagrant的控制檯相同的訪問級別與它進行交互。

要解決此問題,請完全關閉所有VirtualBox機器和GUI。等幾秒鐘。然後,啓動VirtualBox只與您希望使用的訪問級別..

1

我有同樣的問題(Windows7 Pro SP1,VirtualBox 5.1.26,vagrant 1.9.7)。 我'通過降級流浪者解決了這個問題1.9.6。

+0

同樣在這裏。我曾將Vagrant降級到1.9.6以使其工作。 –

0

由於呼叫到流浪者內的powershell而存在問題。目前(2.0.1)流浪版本仍然存在這個問題。

相關link

有多種解決方案:

  • 降級的癟三對1.9.6
  • 更新的PowerShell更高版本
相關問題