换了台新机,要把之前的 vagrant 迁移过来,兴高采烈的 vagrant package
打包,AirDrop 迁移到新机导入后,却发现启动时卡在 ssh 阶段,具体是这样的:
default: Warning: Connection timeout. Retrying...
default: Warning: Authentication failure. Retrying...
default: Warning: Authentication failure. Retrying..
搜了半天,找到大概的原因在于 vagrant 读取 ~/.vagrant.d/insecure_private_key
,然而这个私钥又读取有问题。。。
vagrant init xxx
之后先修改 Vagrantfile 配置项 config.ssh.insert_key = false
vagrant up
wget https://raw.githubusercontent.com/mitchellh/vagrant/master/keys/vagrant.pub -O .ssh/authorized_keys
chmod 700 .ssh
chmod 600 .ssh/authorized_keys
chown -R vagrant:vagrant .ssh
vagrant reload
有部分说,vagrant package
之前先 rm /etc/udev/rules.d/70-persistent-net.rule
,以便排除网卡配置的干扰,不知可行性如何