2016-11-16 2 views
1

내 localhost가 제대로 작동하는 데 문제가 있습니다.localhost vagrant 및 Windows (8.1) 빌드의 VM - 방해물 파일 사양

내가 성공적으로 방랑 초기화 "hashicorp/precise32는"

이 방랑은 아마 내가 잘못된 위치에 내 로컬 호스트 IP를 가하고있어

까지 한 실행 자식 강타 : 127.0.0.1

이 확인 된 내 VM 여기 실행하고 나의 방랑 파일 : 나는 몇 가지 추가 옵션을 추가 한

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

# Vagrantfile API/syntax version. Don't touch unless you know what you're doing! 

Vagrant.configure(2) do |config| 

    config.vm.box = "hashicorp/precise32" 

    # config.vm.boot_timeout = "300" 
    # Setting this above never worked for me when i had a config.vm.boot_timeout 

    config.vm.network :forwarded_port, guest: 80, host: 8082 

    # config.vm.network :public_network 
    config.vm.network "private_network", ip: "127.0.0.1" 

    config.vm.synced_folder ".", "/vagrant", type: "nfs" 


    config.vm.provider :virtualbox do |vb| 
    vb.gui = true 

# I turned this vb.gui = true on when i was having a problem with config.vm.boot_timeout 

    vb.customize ["modifyvm", :id, "--memory", "4096"] 
    vb.cpus = 4 

    end 

end 

하지만 내 IP 또는 포트가 잘못 생각합니다. 어떤 도움이라도 대단히 감사하겠습니다. 고맙습니다. 내가 다시로드를 방랑 한 후

# Copyright (c) 1993-2006 Microsoft Corp. 
# 
# This is a sample HOSTS file used by Microsoft TCP/IP for Windows. 
# 
# This file contains the mappings of IP addresses to host names. Each 
# entry should be kept on an individual line. The IP address should 
# be placed in the first column followed by the corresponding host name. 
# The IP address and the host name should be separated by at least one 
# space. 
# 
# Additionally, comments (such as these) may be inserted on individual 
# lines or following the machine name denoted by a '#' symbol. 
# 
# For example: 
# 
#  102.54.94.97  rhino.acme.com   # source server 
#  38.25.63.10  x.acme.com    # x client host 

# localhost name resolution is handle within DNS itself. 
     127.0.0.1  localhost 
     ::1    localhost 

:

편집 ************************

호스트 파일과 같이 보인다 :

$ vagrant reload 
==> default: [vagrant-hostsupdater] Removing hosts 
==> default: Attempting graceful shutdown of VM... 
==> default: Checking if box 'hashicorp/precise32' is up to date... 
==> default: Clearing any previously set forwarded ports... 
==> default: Clearing any previously set network interfaces... 
==> default: Preparing network interfaces based on configuration... 
    default: Adapter 1: nat 
    default: Adapter 2: hostonly 
==> default: Forwarding ports... 
    default: 80 (guest) => 8082 (host) (adapter 1) 
    default: 22 (guest) => 2222 (host) (adapter 1) 
==> default: Running 'pre-boot' VM customizations... 
==> default: Booting VM... 
==> default: Waiting for machine to boot. This may take a few minutes... 
    default: SSH address: 127.0.0.1:2222 
    default: SSH username: vagrant 
    default: SSH auth method: private key 
==> default: Machine booted and ready! 
[default] GuestAdditions 5.1.8 running --- OK. 
==> default: Checking for guest additions in VM... 
==> default: [vagrant-hostsupdater] Checking for host entries 
==> default: Configuring and enabling network interfaces... 
==> default: Mounting shared folders... 
    default: /vagrant => C:/Users/Timothy/Documents/Magento 
==> default: Machine already provisioned. Run `vagrant provision` or use the `--provision` 
==> default: flag to force provisioning. Provisioners marked to run always will still run. 

왜 이렇게 혼란 스럽습니까? 지금까지는 로컬 개발자를 설정하는 데 별 어려움이 없었습니다. 환경.

답변

1

127.0.0.1의 개인 네트워크를 루프백 어댑터에있는 호스트에서 사용할 수 없으므로 VM에 연결할 수 없습니다.

당신은 ( https://en.wikipedia.org/wiki/Private_network#Private_IPv4_address_spaces 참조) 3 개 다음 범위에서 사용한다

  • 10.0.0.0 - 10.255.255.255
  • 172.16.0.0 - 172.31.255.255
  • 192.168.0.0 - 192.168.255.255

방랑자는 이미 10.0.2.15에 NAT 어댑터를 만들어 ssh를 통해 통신합니다.

은 내가 192.168.x.x 범위의 IP를 가지고하는 것이 좋습니다 당신은 로컬 호스트의 IP를 사용하고있는 모든 개인 네트워크를 사용하지 할 수있는 방법이 있나요 당신의 VM

+0

제대로 작동 할 수있을 것입니다. 비공개 일 필요는 없습니다. 나는 xampp이나 wamp와 같은 램프 환경을 운영하고 싶다. @Frederic Henri – Supplement

+0

호스트 파일을 192.168.7.7 localhost ?????로 변경합니까? – Supplement

+0

그래서 지금은 로컬 호스트에 대한 일하는거야하지만 내 파일을 내 폴더를 찾는 아니에요. 그것은 작동합니다. http://127.0.0.1:8082/ – Supplement