我正在嘗試在Windows VM Ware上運行Linux Ubuntu 32位盒。我正在關注UDACITY課程,他們告訴我要安裝這些軟件。我不太瞭解如何運行這些軟件。我試圖在Stack上找到答案,但它都在不同的操作系統上,而不是Windows上。我通過啓用GUI來嘗試一些編輯,並且我還在Vagrantfile中添加了Vagrant配置。Windows上的Vagrant ssh身份驗證失敗
有使用ssh認證問題:
錯誤:
[email protected] /C/Users/e2sn7cy/fullstack/vagrant (master)
$ vagrant up
Bringing machine 'default' up with 'virtualbox' provider...
==> default: Checking if box 'ubuntu/trusty32' is up to date...
==> 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: 8000 => 1234 (adapter 1)
default: 8080 => 8080 (adapter 1)
default: 5000 => 4321 (adapter 1)
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: Connection timeout. Retrying...
default: Warning: Connection timeout. Retrying...
default: Warning: Connection timeout. Retrying...
default: Warning: 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
# -*- mode: ruby -*-
# vi: set ft=ruby :
VAGRANTFILE_API_VERSION = "2"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
config.vm.provider :virtualbox do |vb|
vb.gui = true
end
Vagrant.configure("2") do |config|
config.ssh.private_key_path = "~/.ssh/id_rsa"
config.ssh.forward_agent = true
end
config.vm.provision "shell", path: "pg_config.sh"
# config.vm.box = "hashicorp/precise32"
config.vm.box = "ubuntu/trusty32"
config.vm.network "forwarded_port", guest: 8000, host: 1234
config.vm.network "forwarded_port", guest: 8080, host: 8080
config.vm.network "forwarded_port", guest: 5000, host: 4321
end
我pg_config.sh
apt-get -qqy update
apt-get -qqy install postgresql python-psycopg2
apt-get -qqy install python-flask python-sqlalchemy
apt-get -qqy install python-pip
pip install bleach
pip install oauth2client
pip install requests
pip install httplib2
su postgres -c 'createuser -dRS vagrant'
su vagrant -c 'createdb'
su vagrant -c 'createdb forum'
su vagrant -c 'psql forum -f /vagrant/forum/forum.sql'
vagrantTip="[35m[1mThe shared directory is located at /vagrant\nTo access your shared files: cd /vagrant(B[m"
echo -e $vagrantTip > /etc/motd
嘿,我只使用了默認配置,我剛剛編輯了兩行三行,然後再次改變了它,但仍然無法正常工作。 (https://www.udacity.com/wiki/ud197/install-vagrant)我已經使用此鏈接進行安裝。 –
是的,我已經打開我的GUI模式,它要求的用戶名和密碼,但我不知道 –
嘗試用戶:root pwd:vagrant – KaziJee