Ubuntu 12.04, Virtualbox 4.3 및 Vagrant 1.5.1이있는 서버가 있습니다. 그러나이 상자 http://puppet-vagrant-boxes.puppetlabs.com/centos-64-x64-vbox4210.box 를 사용하려고합니다 . “vagrant up”을 실행하면 다음 메시지가 나타납니다.
Bringing machine 'default' up with 'virtualbox' provider...
==> default: Importing base box 'centos-64-x64-vbox4210'...
==> default: Matching MAC address for NAT networking...
==> default: Setting the name of the VM: rafael_default_1396403974194_51967
==> 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 => 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: Error: Connection timeout. Retrying...
default: Error: Connection timeout. Retrying...
default: Error: Connection timeout. Retrying...
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.
이것은 내 방랑자 파일입니다
# Vagrantfile API/syntax version. Don't touch unless you know what you're doing!
VAGRANTFILE_API_VERSION = "2"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
# All Vagrant configuration is done here. The most common configuration
# options are documented and commented below. For a complete reference,
# please see the online documentation at vagrantup.com.
# Every Vagrant virtual environment requires a box to build off of.
config.vm.box = "centos-64-x64-vbox4210"
config.vm.boot_timeout = 600
# The url from where the 'config.vm.box' box will be fetched if it
# doesn't already exist on the user's system.
# config.vm.box_url = "http://domain.com/path/to/above.box"
# Create a forwarded port mapping which allows access to a specific port
# within the machine from a port on the host machine. In the example below,
# accessing "localhost:8080" will access port 80 on the guest machine.
# config.vm.network "forwarded_port", guest: 80, host: 8080
# Create a private network, which allows host-only access to the machine
# using a specific IP.
# config.vm.network "private_network", ip: "192.168.33.10"
# Create a public network, which generally matched to bridged network.
# Bridged networks make the machine appear as another physical device on
# your network.
# config.vm.network "public_network"
# If true, then any SSH connections made will enable agent forwarding.
# Default value: false
# config.ssh.forward_agent = true
# Share an additional folder to the guest VM. The first argument is
# the path on the host to the actual folder. The second argument is
# the path on the guest to mount the folder. And the optional third
# argument is a set of non-required options.
# config.vm.synced_folder "../data", "/vagrant_data"
# Enable provisioning with chef server, specifying the chef server URL,
# and the path to the validation key (relative to this Vagrantfile).
#
# The Opscode Platform uses HTTPS. Substitute your organization for
# ORGNAME in the URL and validation key.
#
# If you have your own Chef Server, use the appropriate URL, which may be
# HTTP instead of HTTPS depending on your configuration. Also change the
# validation key to validation.pem.
#
# config.vm.provision "chef_client" do |chef|
# chef.chef_server_url = "https://api.opscode.com/organizations/ORGNAME"
# chef.validation_key_path = "ORGNAME-validator.pem"
# end
#
# If you're using the Opscode platform, your validator client is
# ORGNAME-validator, replacing ORGNAME with your organization name.
#
# If you have your own Chef Server, the default validation client name is
# chef-validator, unless you changed the configuration.
#
# chef.validation_client_name = "ORGNAME-validator"
end
서버에 그래픽 인터페이스가없는 경우 어떻게 수정합니까? 감사.
답변
먼저 시도 하십시오 : 당신의 컴퓨터 구성에서 어떤 방랑 개인 키 를 확인하십시오
$ vagrant ssh-config
예:
$ vagrant ssh-config
Host default
HostName 127.0.0.1
User vagrant
Port 2222
UserKnownHostsFile /dev/null
StrictHostKeyChecking no
PasswordAuthentication no
IdentityFile C:/Users/konst/.vagrant.d/insecure_private_key
IdentitiesOnly yes
LogLevel FATAL
둘째, 수행 : yorn 자신의 시스템 개인 키 의 내용으로 insecure_private_key
파일의 내용 변경
답변
이 게시물에 나와있는 가상 상자의 GUI를 활성화하려고 시도 하십시오. 연결 끊김 연결 시간 초과가 발생 하고 주석의 단계를 따르십시오.
작동하지 않으면이 수정 사항을 vagrantfile에 추가하십시오.
다음 명령이 포함 된 “script.sh”라는 파일을 작성하십시오.
mkdir /home/vagrant/.ssh
wget --no-check-certificate -O authorized_keys 'https://github.com/mitchellh/vagrant/raw/master/keys/vagrant.pub'
mv authorized_keys /home/vagrant/.ssh
chown -R vagrant /home/vagrant/.ssh
chmod -R go-rwsx /home/vagrant/.ssh
그런 다음 이것을 vagrantfile에 추가하십시오.
# running script shell
config.vm.provision :shell, :path => "script.sh"
답변
부팅 단계 중 SSH 연결 시간 초과는 다음과 같은 여러 가지 이유로 발생할 수 있습니다.
- 시스템이 사용자 상호 작용을 기다립니다 (예 : 공유 파티션이 준비되지 않았습니다 ).
sshd
잘못된 구성,- 방화벽 구성 오류 (로컬이 아닌 경우)
- 개인 키가 일치하지 않습니다.
config.vm.boot_timeout
기간 시간이 너무 짧습니다 (괜찮습니다).- BIOS에서 가상화가 활성화되어 있는지 확인하십시오.
문제를 디버그하려면 다음과 같이 실행하십시오.
VAGRANT_LOG=debug vagrant up
명백한 것이 없다면 다른 터미널에서 vagrant ssh
또는 다음 방법으로 연결하십시오 .
vagrant ssh-config > vagrant-ssh; ssh -F vagrant-ssh default
SSH가 여전히 실패하면 GUI (예 :)를 사용하여 SSH를 다시 실행하십시오 config.gui = true
.
그렇지 않은 경우 실행중인 프로세스 (예 :)를 vagrant ssh -c 'pstree -a'
확인하거나을 확인하십시오 sshd_config
.
이 일회용 VM 경우, 당신은 항상 할 수있는 destroy
그와 up
다시. 또한 Vagrant 및 Virtualbox를 업그레이드하십시오.
답변
방화벽에서 포트 22를 열어보십시오.
Oracle VM VirtualBox Manager를 사용하여 VM을 직접 시작하거나
이것을 Vagrantfile에 추가하십시오
config.vm.provider :virtualbox do |vb|
vb.gui = true
end
“유랑”을 실행
기본 방랑자 자격 증명을 사용하여 로그인
user: vagrant
pass: vagrant
방화벽 규칙 추가
sudo ufw allow 22
답변
방금 비슷한 문제를 해결했습니다.
문제 : 게스트 개발 환경에 로그인하는 명령 vagrant ssh
시간이 초과되었습니다. 다른 호스트 시스템에서 정상적으로 작동합니다.
디버깅 단계 :
-
Vagrantfile에서 Virtualbox GUI (다른 답변에서 권장)를 사용하여 시간 초과의 원인을 알 수있었습니다. 우분투는 ssh 키를 대신 사용해야하기 때문에 로그인과 암호를 요구하지 않았습니다.
-
을 실행하는 대신
vagrant ssh
동등한 ssh 명령을 여러 번 실행하여 다른 ssh 옵션을 추가하고 제거했습니다. 시간 초과 오류 메시지 중 하나가 “[example.com]에 로그인 할 수 없습니다”라는 메시지를 읽습니다.이 문제는 [example.com]과 관련이 없으므로 의미가 없습니다. -
따라서 [example.com]과 관련이있을 수있는 .ssh / config를 살펴 보았습니다.
근본 원인 : .ssh / config Host
에서 실수로 설정 하지 않은 항목이있었습니다 . 따라서 (ssh 명령을 더 길게하기위한 바로 가기 임)을 포함 하여 모든 ssh 호출에 해당 구성 규칙을 적용하고있었습니다 vagrant ssh
.
해결 방법 : 모든 .ssh / config 항목이 Host
설정되어 있는지 확인하십시오 .
답변
생성 시도 insecure_private_key
insecure_private_key
아래 에있는를 제거 하여이 문제를 해결했습니다.~/.vagrant.d
아마도 이유는 insecure_private_key
파일이 오래되었을 수 있습니다
답변
나는 같은 문제가 있었다. SystemPrefereces-> Security-> Firewall에서 모든 것을 삭제하고 SystemPreferences-> Shared에서 모든 서비스를 제거했습니다. 그런 다음 원격 로그인을 다시 활성화했습니다. 내 경우에는 문제가 해결되었습니다. 그래도 문제가 해결되지 않으면이 사이트를 방문하여 직접 확인하십시오. (서버 팩스)