Я пытаюсь настроить виртуальную машину Virtualbox на работу с Vagrant.До сих пор я не смог подключиться к машине.
Я использую Vagrant 2.2.4 и Virtualbox 6.0.8r130520 (официальный пакет Oracle для Debian / Ubuntu 18: deb [arch = amd64] http://download.virtualbox.org/virtualbox/debian bionic contrib ")
Я использую частную сеть со статическим ip ссылка в моем Vagrantfile:
config.vm.network "private_network", ip: "192.168.33.10"
Дополнительно:
v.customize ["modifyvm", :id, "--natdnshostresolver1", "on"]
v.customize ["modifyvm", :id, "--natdnsproxy1", "on"]
Вот вывод vagrant up:
Bringing machine 'test' up with 'virtualbox' provider...
==> test: Importing base box 'dev'...
==> test: Matching MAC address for NAT networking...
==> test: Setting the name of the VM: test
==> test: Fixed port collision for 22 => 2222. Now on port 2200.
==> test: Clearing any previously set network interfaces...
==> test: Preparing network interfaces based on configuration...
test: Adapter 1: nat
test: Adapter 2: hostonly
==> test: Forwarding ports...
test: 22 (guest) => 2200 (host) (adapter 1)
==> test: Running 'pre-boot' VM customizations...
==> test: Booting VM...
==> test: Waiting for machine to boot. This may take a few minutes...
test: SSH address: 127.0.0.1:2200
test: SSH username: username
test: SSH auth method: password
Timed out while waiting for the machine to boot. This means that
Vagrant was unable to communicate with the guest machine within
the configured ("config.vm.boot_timeout" value) time period.
If you look above, you should be able to see the error(s) that
Vagrant had when attempting to connect to the machine. These errors
are usually good hints as to what may be wrong.
If you're using a custom box, make sure that networking is properly
working and you're able to connect to the machine. It is a common
problem that networking isn't setup properly in these boxes.
Verify that authentication configurations are also setup properly,
as well.
If the box appears to be booting properly, you may want to increase
the timeout ("config.vm.boot_timeout") value.
Показывает статус Vagrant:
Current machine states:
test running (virtualbox)
The VM is running. To stop this VM, you can run `vagrant halt` to
shut it down forcefully, or you can run `vagrant suspend` to simply
suspend the virtual machine. In either case, to restart it again,
simply run `vagrant up`.
Вывод ping 192.168.33.10:
PING 192.168.33.10 (192.168.33.10) 56(84) bytes of data.
From 192.168.33.1 icmp_seq=1 Destination Host Unreachable
From 192.168.33.1 icmp_seq=5 Destination Host Unreachable
From 192.168.33.1 icmp_seq=6 Destination Host Unreachable
Я попытался установить public_network вместо private_network в Vagrantfile, но нетразница ссылка .
вывод ifconfig:
ens2: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 10.64.62.141 netmask 255.255.255.254 broadcast 10.64.62.141
inet6 fe80::dc1c:3cff:fe64:2047 prefixlen 64 scopeid 0x20<link>
inet6 2001:bc8:47a0:1f46::1 prefixlen 127 scopeid 0x0<global>
ether de:1c:3c:64:20:47 txqueuelen 1000 (Ethernet)
RX packets 764159 bytes 2552235354 (2.5 GB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 473453 bytes 124372499 (124.3 MB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536
inet 127.0.0.1 netmask 255.0.0.0
inet6 ::1 prefixlen 128 scopeid 0x10<host>
loop txqueuelen 1000 (Local Loopback)
RX packets 35498 bytes 451319135 (451.3 MB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 35498 bytes 451319135 (451.3 MB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
vboxnet0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 192.168.33.1 netmask 255.255.255.0 broadcast 192.168.33.255
inet6 fe80::800:27ff:fe00:0 prefixlen 64 scopeid 0x20<link>
ether 0a:00:27:00:00:00 txqueuelen 1000 (Ethernet)
RX packets 0 bytes 0 (0.0 B)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 434 bytes 42136 (42.1 KB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
вывод маршрута -n:
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
0.0.0.0 10.64.62.140 0.0.0.0 UG 0 0 0 ens2
10.64.62.140 0.0.0.0 255.255.255.254 U 0 0 0 ens2
192.168.33.0 0.0.0.0 255.255.255.0 U 0 0 0 vboxnet0
Я что-то пропустил? Это поле работает локально. Любая помощь или предложения будут с благодарностью.