gpt4 book ai didi

ubuntu - 无法在 Vagrant 中运行 ubuntu/trusty32

转载 作者:行者123 更新时间:2023-12-04 19:16:18 26 4
gpt4 key购买 nike

我在 Core i3 上使用 Ubuntu 15.10 64 位。我已经安装了 Vagrant 1.8.1 和 VirtualBox。

我做了以下事情:

$ vagrant box add ubuntu/trusty32 
$ vagrant init ubuntu/trusty32
$ vagrant up

做完 vagrant up ,我得到下面显示的错误。如果我打开 VirtualBox,我可以看到系统已启动并等待用户名和密码。

注意:我在获取 hashicorp/precise32 时没有任何问题。在 Vagrant 中运行。我只有 ubuntu/trusty32 有问题.
~/vagrant$ vagrant up
Bringing machine 'default' up with 'virtualbox' provider...
==> default: Importing base box 'ubuntu/trusty32'...
==> default: Matching MAC address for NAT networking...
==> default: Checking if box 'ubuntu/trusty32' is up to date...
==> default: Setting the name of the VM: vagrant_default_1459678892518_13508
==> 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: Forwarding ports...
default: 22 (guest) => 2222 (host) (adapter 1)
==> 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
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 up这就是我得到的
~/vagrant$ vagrant up
Bringing machine 'default' up with 'virtualbox' provider...
==> default: Checking if box 'ubuntu/trusty32' is up to date...
==> default: VirtualBox VM is already running.

我也试过 $ vagrant ssh我得到了以下信息。
~/vagrant$ vagrant ssh
ssh_exchange_identification: read: Connection reset by peer

这是我的 Vagrantfile

谁能让我知道是什么问题?

最佳答案

你可以试试

$ vagrant reload

或者
$ vagrant halt && vagrant up

看看你是否有更好的运气。

我刚刚尝试了您的确切步骤系列,它对我有用。此外,盒子上的默认超时时间是 300 秒(5 分钟),所以发生了一些奇怪的事情。如果上述命令不起作用,您可以尝试通过 VirtualBox 界面启动它,或者通过更改 Vagrantfile 以使 GUI 显示如下...

改变这个:
# 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

对此:
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

并尝试 $ vagrant up再次。显示的新窗口/gui 可能有其他信息。

如果以上都失败了,你可以试试
$ vagrant up --debug > vagrant_up.log 2>&1 && vagrant halt

它将使用调试标志引导机器并将内容输出到文件 vagrant_up.log在您的 vagrant再次关闭机器之前的目录。然后,您可以在此处发布生成的日志。

编辑

通过此答案的评论进行更多故障排除后,发布了此图片:

vb.gui

这表明 Virtualbox/vagrant 正在等待网络适配器继续启动序列。

您可以通过修改 Vagrantfile 来解决此问题。再次启用网络接口(interface)。

将如下一行添加到 config您的 Vagrantfile 的部分应该允许机器启动:
config.vm.network "private_network", ip: 192.168.30.10

关于ubuntu - 无法在 Vagrant 中运行 ubuntu/trusty32,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36384377/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com