gpt4 book ai didi

Vagrant 盒 : can't login with password from VirtualBox GUI

转载 作者:行者123 更新时间:2023-12-03 08:34:44 29 4
gpt4 key购买 nike

我正在学习使用 Vagrant,并尝试从 VirtualBox GUI 内部启动 Vagrant 机器(以推荐的方式“vagrant init ubuntu/trusty64; vagrant up”构建的 ubuntu/trusty64)(双击 Vagrant 机器的图标)。但我无法登录:没有用户名,没有密码。

我是否需要添加特定条款,或者还有其他更简单的方法来做到这一点?

谢谢你。

最佳答案

问题澄清后更新

您应该可以登录为

user: vagrant
password: vagrant

这是 base box creation documentation 中描述的约定:

Also, even though Vagrant uses key-based authentication by default, it is a general convention to set the password for the "vagrant" user to "vagrant". This lets people login as that user manually if they need to.



如果您有一个未设置 vagrant 用户密码的框(或者您只是不知道),您可以执行以下操作:
me@somebox$ vagrant ssh
vagrant@vagrant-ubuntu-trusty-64:~$ sudo passwd vagrant
Enter new UNIX password: <type invisible new password here>
Retype new UNIX password: <re-type invisible new password here>
passwd: password updated successfully

现在您可以登录,例如通过 VirtualBox GUI。

原答案 (基本上说明你不应该做上面的事情)

基本思想是,您不必使用虚拟机提供程序工具来处理 vagrant。因此,一旦您认为必须使用 VirtualBox GUI,您就做错了。

只需在终端中尝试(或在 cmd.exe 中,如果您在 Windows 上):
me@somebox$ vagrant init ubuntu/trusty64
me@somebox$ vagrant up
me@somebox$ vagrant ssh
vagrant@vagrant-ubuntu-trusty-64:~$

如果一切正常,您应该在以 vagrant 用户身份登录的新机器内的命令行上。

关于 Vagrant 盒 : can't login with password from VirtualBox GUI,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26524691/

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