Vagrant: kann nicht ping-Gast-Maschine vom host

Habe ich Mac OS mit installiert vagrant. Auf der Gast-Maschine habe ich Ubuntu 12. Also, was ich tun möchte ist die ping-Gast-Maschine vom host.

Gast Maschine befestigt NAT (nach VirtualBox-Einstellungen)

Fand ich nur eine Schnittstelle auf der Gast-Maschine (außer lo):

eth0      Link encap:Ethernet  HWaddr 08:00:27:88:0c:a6  
          inet addr:10.0.2.15  Bcast:10.0.2.255  Mask:255.255.255.0
          inet6 addr: fe80::a00:27ff:fe88:ca6/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:581 errors:0 dropped:0 overruns:0 frame:0
          TX packets:410 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:61376 (61.3 KB)  TX bytes:51599 (51.5 KB)

Die Sache ist die, dass es keine ip-Adresse im 10.0.2.* Netzwerk auf dem host. Host-Maschine hat mehrere vboxnet Schnittstellen, aber Sie alle haben keine ip-Adressen:

vboxnet0: flags=8842<BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 1500
          ether 0a:00:27:00:00:00 
vboxnet1: flags=8842<BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 1500
          ether 0a:00:27:00:00:01 
vboxnet2: flags=8842<BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 1500
          ether 0a:00:27:00:00:02 
vboxnet3: flags=8842<BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 1500
          ether 0a:00:27:00:00:03 

Haben Sie eine Ahnung, warum die ip-Adresse wird nicht zugewiesen, um die host-Maschine von VirtualBox? Was kann ich tun, um in der Lage sein ping-gust Maschine?

Hier ist mein vagrant Datei (habe ich entfernt, einige kommentierte Zeilen, die ich nicht verwenden):

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

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

Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
# All Vagrant configuration is done here. The most common configuration
# options are documented and commented below. For a complete reference,
# please see the online documentation at vagrantup.com.

# Every Vagrant virtual environment requires a box to build off of.
config.vm.box = "hashicorp/precise64"

# 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://domain.com/path/to/above.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.
config.vm.network "forwarded_port", guest: 80, host: 8080
config.vm.network "forwarded_port", guest: 3306, host: 8086
config.vm.network "forwarded_port", guest: 27017, host: 27017

config.vm.synced_folder "/Users/KoulSlou/Documents/Cloudware12.10", "/vagrant", owner:     "www-data", group: "www-data"
config.vm.synced_folder "/Users/KoulSlou/Documents/Cloudware/public","/cloudware", owner: "www-data", group: "www-data"

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

# 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"

# If true, then any SSH connections made will enable agent forwarding.
# Default value: false
# config.ssh.forward_agent = true
...

end
Können Sie teilen Sie Ihre Vagrantfile? Mit einem guten Netzwerk-Konfiguration, die Sie können wählen, eine private_network mit statischer ip-Adresse oder port-forwarding.. docs.vagrantup.com/v2/networking/index.html
Ich habe meine Vagrantfile. Für quick fix ich die auskommentierte Zeile config.vm.Netzwerk "public_network" und nach konnte ich ping virtuelle Maschine (ich brauche es zum testen meiner app), So dass Sie Ratschläge zu setup private Netzwerk?

InformationsquelleAutor Tamara | 2014-08-21

Schreibe einen Kommentar