Meine Vagrantfile enthält die Zeile config.vm.network :private_network, ip: "192.168.33.10"
zugewiesen bekommen, aber wenn die Maschine ifconfig
zeigt aufkommt:Vagrant Gast nicht korrekt IP
eth0 Link encap:Ethernet HWaddr 08:00:27:1B:06:06
inet addr:10.0.2.15 Bcast:10.0.2.255 Mask:255.255.255.0
inet6 addr: fe80::a00:27ff:fe1b:606/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:921 errors:0 dropped:0 overruns:0 frame:0
TX packets:926 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:92471 (90.3 KiB) TX bytes:97079 (94.8 KiB)
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:65536 Metric:1
RX packets:255 errors:0 dropped:0 overruns:0 frame:0
TX packets:255 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:40178 (39.2 KiB) TX bytes:40178 (39.2 KiB)
So ist der Gast aus einem völlig anderen Bereich eine IP zugewiesen bekommen. Die Ergebnisse der ifconfig
auf dem Host-Show:
enp1s0 Link encap:Ethernet HWaddr 1c:1b:0d:3b:06:a0
inet addr:10.100.102.10 Bcast:10.100.102.255 Mask:255.255.255.0
inet6 addr: fe80::89fb:6606:8d85:ba21/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:214746 errors:0 dropped:0 overruns:0 frame:0
TX packets:124683 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:295158044 (295.1 MB) TX bytes:10146317 (10.1 MB)
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:65536 Metric:1
RX packets:35183 errors:0 dropped:0 overruns:0 frame:0
TX packets:35183 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1
RX bytes:4777700 (4.7 MB) TX bytes:4777700 (4.7 MB)
vboxnet0 Link encap:Ethernet HWaddr 0a:00:27:00:00:00
inet addr:192.168.33.1 Bcast:192.168.33.255 Mask:255.255.255.0
inet6 addr: fe80::800:27ff:fe00:0/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:4204 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 (0.0 B) TX bytes:188146 (188.1 KB)
Alle Ideen, wie unstet bekommen die richtige IP zuweisen? (Dies ist vagrant 1.9.1, Gastgeber ist Ubuntu 16, Gast ist CentOS 6.
bearbeiten: Dies ist die Ausgabe von vagrant up
:
$ vagrant up dev
Bringing machine 'dev' up with 'virtualbox' provider...
==> dev: Clearing any previously set forwarded ports...
==> dev: Clearing any previously set network interfaces...
==> dev: Preparing network interfaces based on configuration...
dev: Adapter 1: nat
dev: Adapter 2: hostonly
==> dev: Forwarding ports...
dev: 22 (guest) => 2222 (host) (adapter 1)
==> dev: Running 'pre-boot' VM customizations...
==> dev: Booting VM...
==> dev: Waiting for machine to boot. This may take a few minutes...
dev: SSH address: 127.0.0.1:2222
dev: SSH username: vagrant
dev: SSH auth method: private key
==> dev: Machine booted and ready!
==> dev: Checking for guest additions in VM...
dev: The guest additions on this VM do not match the installed version of
dev: VirtualBox! In most cases this is fine, but in rare cases it can
dev: prevent things such as shared folders from working properly. If you see
dev: shared folder errors, please make sure the guest additions within the
dev: virtual machine match the version of VirtualBox you have installed on
dev: your host and reload your VM.
dev:
dev: Guest Additions Version: 4.3.26
dev: VirtualBox Version: 5.1
==> dev: Setting hostname...
==> dev: Configuring and enabling network interfaces...
==> dev: Mounting shared folders...
dev: /vagrant => /home/johnny/dev/lumify
dev: /home/vagrant/.m2 => /home/johnny/.m2
==> dev: Machine already provisioned. Run `vagrant provision` or use the `--provision`
==> dev: flag to force provisioning. Provisioners marked to run always will still run.
was ist die Ausgabe von 'vagrant up' Befehl? es ist komisch, wie Sie eine zweite Netzwerkschnittstelle mit der richtigen IP haben sollten (es wird nur im Gast nicht der Host angezeigt) –
Ich habe die Ausgabe von 'vagrant up' hinzugefügt. – Johnny