昨晚我的流浪汉工作得非常好.我刚打开电脑,点击vagrant up,这就是我得到的:
==> default: Clearing any previously set network interfaces...
==> default: Preparing network interfaces based on configuration...
default: Adapter 1: nat
default: Adapter 2: hostonly
==> 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: Error: Connection timeout. Retrying...
default: Error: Connection timeout. Retrying...
default: …Run Code Online (Sandbox Code Playgroud) 由于宅基地2.0宅基地laravel没有工作
我不知道为什么'homestead init'在mydirectory/.homestead中创建一个Homestead.yaml文件,而不是在项目目录中.Homestead up OR Vagrant up创建以下消息
已存在名为"homestead"的VirtualBox计算机.
Bringing machine 'default' up with 'virtualbox' provider...
==> default: Importing base box 'laravel/homestead'...
==> default: Matching MAC address for NAT networking...
==> default: Checking if box 'laravel/homestead' is up to date...
A VirtualBox machine with the name 'homestead' already exists.
Please use another name or delete the machine with the existing
name, and try again.
Run Code Online (Sandbox Code Playgroud) 这是我的Python3项目hiearchy:
projet
\
script.py
web
\
index.html
Run Code Online (Sandbox Code Playgroud)
从script.py,我想运行一个服务该web文件夹内容的http服务器.
这里建议这段代码运行一个简单的http服务器:
import http.server
import socketserver
PORT = 8000
Handler = http.server.SimpleHTTPRequestHandler
httpd = socketserver.TCPServer(("", PORT), Handler)
print("serving at port", PORT)
httpd.serve_forever()
Run Code Online (Sandbox Code Playgroud)
但这实际上是服务project,而不是web.如何指定要提供的文件夹的路径?
我有一个3个VM的集群.这是Vagrantfile:
# -*- mode: ruby -*-
# vi: set ft=ruby :
hosts = {
"host0" => "192.168.33.10",
"host1" => "192.168.33.11",
"host2" => "192.168.33.12"
}
Vagrant.configure("2") do |config|
config.vm.box = "precise64"
config.vm.box_url = "http://files.vagrantup.com/precise64.box"
config.ssh.private_key_path = File.expand_path('~/.vagrant.d/insecure_private_key')
hosts.each do |name, ip|
config.vm.define name do |machine|
machine.vm.hostname = "%s.example.org" % name
machine.vm.network :private_network, ip: ip
machine.vm.provider "virtualbox" do |v|
v.name = name
# #v.customize ["modifyvm", :id, "--memory", 200]
end
end
end
end
Run Code Online (Sandbox Code Playgroud)
这曾经工作,直到我最近升级:
ssh -i ~/.vagrant.d/insecure_private_key vagrant@192.168.33.10
Run Code Online (Sandbox Code Playgroud)
相反,vagrant要求输入密码.
似乎最近版本的vagrant(我在1.7.2上)为每台机器创建了一个安全的私钥.我通过跑步发现了它
vagrant ssh-config
Run Code Online (Sandbox Code Playgroud)
输出显示每个主机的不同密钥.我通过区分它们来验证键是不同的. …
我正在运行VirtualBox 5.0.24和Vagrant 1.8.5在数字海洋VPS上运行Ubuntu 14.04 LTS Precise
我正在使用的盒子ubuntu/precise64
一切正常,但当我这样做vagrant up时挂在
SSH auth method: Private key
Run Code Online (Sandbox Code Playgroud)
并退出给予时间.现在,我可以考虑增加执行时间,但在发出错误之前已经花了很长时间.我不知道我做错了什么.这是我的VAGRANTFILE
# -*- mode: ruby -*-
# vi: set ft=ruby :
# All Vagrant configuration is done below. The "2" in Vagrant.configure
# configures the configuration version (we support older styles for
# backwards compatibility). Please don't change it unless you know what
# you're doing.
Vagrant.configure("2") do |config|
# The most common configuration options are documented and commented …Run Code Online (Sandbox Code Playgroud) 我正在关注在Homestead上运行Laravel 5.1的官方指南.
但是,当我尝试vagrant up它时,它会挂起homestead-7: 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 the box appears to be booting properly, you may want to increase
the timeout ("config.vm.boot_timeout") value.
Run Code Online (Sandbox Code Playgroud)
我的SSH密钥是使用生成的ssh-keygen -t rsa -C "you@homestead".
无法访问机器vagrant ssh,它输出ssh_exchange_identification: read: Connection reset by peer.
尝试vagrant destroy并删除 …
我在我的流浪者盒子里有一个新用户(trusty64),我正试着ssh到它.相反登录的vagrant后用户vagrant up,我想登录到我的用户名.
到目前为止我做了什么
ssh-keygenssh-copy-id -p 2222 -i shash@127.0.0.1并且Vagrantfile的一部分看起来像这样
config.vm.box = "ubuntu/trusty64"
config.ssh.username = "shash"
config.ssh.forward_agent = true
config.ssh.private_key_path = "~/.ssh/authorized_keys"
Run Code Online (Sandbox Code Playgroud)
我可以ssh -p '2222' 'shash@127.0.0.1'直接登录,但是当我给出时,vagrant up我不断收到以下错误
default: Warning: Connection timeout. Retrying...
default: Warning: Authentication failure. Retrying...
default: Warning: Authentication failure. Retrying...
Run Code Online (Sandbox Code Playgroud)
任何帮助整理这个真的很感激.谢谢!
完整的设置指南非常有用
我有一个奇怪的问题vagrant ssh。类似的问题,例如Vagrant 在 SSH 密钥更新后要求输入密码,或(vagrant & ssh) 需要密码,或Vagrant ssh 身份验证失败对我没有帮助。
所以,剧情。
我有一台运行 Ubuntu 14.04.3 的虚拟机。所有设置都是根据这篇文章进行的:https : //blog.engineyard.com/2014/building-a-vagrant-box。
注意:我可以使用带有 vagrant 的 insecure_private_key(转换为 *.ppk)的 Putty ssh 到这个虚拟机,它位于“C:/Users/Gino/.vagrant.d/insecure_private_key。密码没有被提示。
然后我打包了这个虚拟机,用这个包初始化 vagrant 并运行vagrant up. 我收到“ Warning: Authentication failure. Retrying...”错误。但是尽管如此我可以vagrant ssh到这台机器,但它要求我输入密码。如果我尝试ssh使用带有必要密钥的 Putty(如第一段中所示),它也会要求我输入密码。
我vagrant halt编辑了这台机器,在 VirtualBox VM 的列表中找到它并手动运行它。之后,我尝试ssh使用具有相同密钥的 Putty 访问这台机器并成功 - 我可以在没有任何密码的情况下登录。
的结果vagrant ssh-config,如果需要:
h:\VagrantBoxes\main-server32>vagrant ssh-config
Host default
HostName 127.0.0.1
User vagrant
Port 2222 …Run Code Online (Sandbox Code Playgroud) vagrant ×7
ssh ×5
virtualbox ×3
vagrantfile ×2
homestead ×1
laravel ×1
laravel-5.1 ×1
python ×1
python-3.x ×1
ssh-keys ×1
ubuntu ×1