Bringing machine 'default' up with 'virtualbox' provider...
==> default: Importing base box 'init_arch'...
==> default: Matching MAC address for NAT networking...
==> default: Setting the name of the VM: arch_vm_default_1446772433228_1359
==> default: Clearing any previously set network interfaces...
==> default: Preparing network interfaces based on configuration...
default: Adapter 1: nat
==> default: Forwarding ports...
default: 22 => 2222 (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
default: Warning: Connection timeout. Retrying...
default: Warning: Authentication failure. Retrying...
default: Warning: Authentication failure. Retrying...
default: Warning: Authentication failure. Retrying...
default: Warning: Authentication failure. Retrying...
我已经按照官网说的
mkdir ~/.ssh/
cd ~/.ssh
wget http://github.com/mitchellh/vagrant/raw/master/keys/vagrant
wget http://github.com/mitchellh/vagrant/raw/master/keys/vagrant.pub
mv vagrant.pub authorized_keys
然而 还是不对
ps:我并不是重头开始构建一个base box, 我是在别人的基础上开始制作的
请问,能告诉一下官网的这个页面吗?
通过 vagrant ssh-config 查看 IdentityFile ,确定使用的是哪个私钥
验证该私钥是否对应虚拟机上公钥
若不是对应key对
重新指定相应key对,配置文件Vagrantfile中操作
config.ssh.private_key_path = "/Users/xxxx/.ssh/id_rsa"
config.ssh.forward_agent = true
config.ssh.username="xxxx"//配置默认登录用户
再将公钥放到虚拟机中 ~/.ssh/authorized_keys 文件
接着reload看看~
官网说的是让你在虚拟机里面执行的。你是不是在主机上执行的啊?
先vagrant up 启动。然后看到Retrying...之后Ctrl+C。这时候虚拟机其实已经启动了。
然后运行vagrant ssh会让你输入密码。如果正常的话密码应该也是vagrant。进入虚拟机之行官网说的那个就好了。