我有Vagrant box bento / ubuntu-16.04的问题,只有这个盒子流氓永远无法在创建
时ssh到构建的VM我尝试使用密钥配置ssh一次,使用用户名和密码设置一次仍然出现相同的错误,尝试删除该框并重新添加,同样的问题
使用: - ubuntu 16.04作为主操作系统 流浪汉1.9.4 Virtualbox:5.0.40 vagrantbox:bento / ubuntu-16.04 Vagrant文件“ssh using password”
Vagrant.configure("2") do |config|
config.vm.box = "bento/ubuntu-16.04"
config.vm.hostname = "myubuntu"
config.ssh.username = "soso"
config.ssh.password = "soso"
end
这是当我使用上面的vagrant文件运行vagrant时会发生什么。
$vagrant up
Bringing machine 'default' up with 'virtualbox' provider...
==> default: Importing base box 'bento/ubuntu-16.04'...
==> default: Matching MAC address for NAT networking...
==> default: Checking if box 'bento/ubuntu-16.04' is up to date...
==> default: Setting the name of the VM: issue_default_1497215548452_86309
==> default: Fixed port collision for 22 => 2222. Now on port 2202.
==> default: Clearing any previously set network interfaces...
==> default: Preparing network interfaces based on configuration...
default: Adapter 1: nat
==> default: Forwarding ports...
default: 22 (guest) => 2202 (host) (adapter 1)
==> default: Booting VM...
==> default: Waiting for machine to boot. This may take a few minutes...
default: SSH address: 127.0.0.1:2202
default: SSH username: soso
default: SSH auth method: password
soso@127.0.0.1's password:
soso@127.0.0.1's password:
default: Warning: Authentication failure. Retrying...
soso@127.0.0.1's password:
soso@127.0.0.1's password:
soso@127.0.0.1's password:
soso@127.0.0.1's password:
default: Warning: Authentication failure. Retrying...
soso@127.0.0.1's password:
当它开始向我询问密码时,这是“--debug”日志的一部分。这样可以保持循环并每秒显示一次。我不确定它是否相关。
INFO subprocess: Starting process: ["/usr/bin/VBoxManage", "showvminfo", "11fd95c4-1632-4fe9-93d8-4e3641e76b72", "--machinereadable"]
INFO subprocess: Command not in installer, restoring original environment...
DEBUG subprocess: Selecting on IO
DEBUG subprocess: stdout: name="issue_default_1497215719513_409"
groups="/"
ostype="Ubuntu (64-bit)"
UUID="11fd95c4-1632-4fe9-93d8-4e3641e76b72"
CfgFile="/home/abbas/VirtualBox VMs/issue_default_1497215719513_409/issue_default_1497215719513_409.vbox"
SnapFldr="/home/abbas/VirtualBox VMs/issue_default_1497215719513_409/Snapshots"
LogFldr="/home/abbas/VirtualBox VMs/issue_default_1497215719513_409/Logs"
hardwareuuid="11fd95c4-1632-4fe9-93d8-4e3641e76b72"
memory=1024
pagefusion="off"
vram=8
cpuexecutioncap=100
hpet="off"
chipset="piix3"
firmware="BIOS"
cpus=1
pae="on"
longmode="on"
cpuid-portability-level=0
bootmenu="messageandmenu"
boot1="disk"
boot2="dvd"
boot3="none"
boot4="none"
acpi="on"
ioapic="on"
biossystemtimeoffset=0
rtcuseutc="on"
hwvirtex="on"
nestedpaging="on"
largepages="on"
vtxvpid="on"
vtxux="on"
paravirtprovider="default"
VMState="running"
VMStateChangeTime="2017-06-11T21:15:21.448000000"
monitorcount=1
accelerate3d="off"
accelerate2dvideo="off"
teleporterenabled="off"
teleporterport=0
teleporteraddress=""
teleporterpassword=""
tracing-enabled="off"
tracing-allow-vm-access="off"
tracing-config=""
autostart-enabled="off"
autostart-delay=0
defaultfrontend=""
storagecontrollername0="IDE Controller"
storagecontrollertype0="PIIX4"
storagecontrollerinstance0="0"
storagecontrollermaxportcount0="2"
storagecontrollerportcount0="2"
storagecontrollerbootable0="on"
storagecontrollername1="SATA Controller"
storagecontrollertype1="IntelAhci"
storagecontrollerinstance1="0"
storagecontrollermaxportcount1="30"
storagecontrollerportcount1="1"
storagecontrollerbootable1="on"
"IDE Controller-0-0"="none"
"IDE Controller-0-1"="none"
"IDE Controller-1-0"="none"
"IDE Controller-1-1"="none"
"SATA Controller-0-0"="/home/abbas/VirtualBox VMs/issue_default_1497215719513_409/ubuntu-16.04-amd64-disk001.vmdk"
"SATA Controller-ImageUUID-0-0"="ada6bc87-b77f-4697-852d-313419f46319"
natnet1="nat"
macaddress1="080027E889C6"
cableconnected1="on"
nic1="nat"
nictype1="82540EM"
nicspeed1="0"
mtu="0"
sockSnd="64"
sockRcv="64"
tcpWndSnd="64"
tcpWndRcv="64"
Forwarding(0)="ssh,tcp,127.0.0.1,2202,,22"
nic2="none"
nic3="none"
nic4="none"
nic5="none"
nic6="none"
nic7="none"
nic8="none"
hidpointing="ps2mouse"
hidkeyboard="ps2kbd"
uart1="off"
uart2="off"
uart3="off"
uart4="off"
lpt1="off"
lpt2="off"
audio="pulse"
clipboard="disabled"
draganddrop="disabled"
SessionName="headless"
VideoMode="800,600,32"@0,0 1
vrde="on"
vrdeport=5925
vrdeports="5925"
vrdeaddress="127.0.0.1"
vrdeauthtype="null"
vrdemulticon="off"
vrdereusecon="off"
vrdevideochannel="off"
vrdeproperty[TCP/Ports]="5925"
vrdeproperty[TCP/Address]="127.0.0.1"
usb="off"
ehci="off"
xhci="off"
SharedFolderNameMachineMapping1="vagrant"
SharedFolderPathMachineMapping1="/home/abbas/issue"
VRDEActiveConnection="off"
VRDEClients=0
vcpenabled="off"
vcpscreens=0
vcpfile="/home/abbas/VirtualBox VMs/issue_default_1497215719513_409/issue_default_1497215719513_409.webm"
vcpwidth=1024
vcpheight=768
vcprate=512
vcpfps=25
GuestMemoryBalloon=0
GuestOSType="Linux26_64"
GuestAdditionsRunLevel=2
GuestAdditionsVersion="5.1.21 r115005"
GuestAdditionsFacility_VirtualBox Base Driver=50,1497215732634
GuestAdditionsFacility_VirtualBox System Service=50,1497215735252
GuestAdditionsFacility_Seamless Mode=0,1497215732634
GuestAdditionsFacility_Graphics Mode=0,1497215732634
DEBUG subprocess: Waiting for process to exit. Remaining to timeout: 32000
DEBUG subprocess: Exit status: 0
Vagrant文件“使用vagrant isecure key”
Vagrant.configure("2") do |config|
config.vm.box = "bento/ubuntu-16.04"
config.vm.hostname = "myubuntu"
config.ssh.username = "soso"
config.ssh.insert_key = false
## making sure it is using the right key
config.ssh.private_key_path = '/home/abbas/.vagrant.d/insecure_private_key'
end
这是当我使用上面的vagrant文件运行vagrant时会发生什么。
$vagrant up
Bringing machine 'default' up with 'virtualbox' provider...
==> default: Importing base box 'bento/ubuntu-16.04'...
==> default: Matching MAC address for NAT networking...
==> default: Checking if box 'bento/ubuntu-16.04' is up to date...
==> default: Setting the name of the VM: issue_default_1497216190372_85398
==> default: Fixed port collision for 22 => 2222. Now on port 2202.
==> default: Clearing any previously set network interfaces...
==> default: Preparing network interfaces based on configuration...
default: Adapter 1: nat
==> default: Forwarding ports...
default: 22 (guest) => 2202 (host) (adapter 1)
==> default: Booting VM...
==> default: Waiting for machine to boot. This may take a few minutes...
default: SSH address: 127.0.0.1:2202
default: SSH username: soso
default: SSH auth method: private key
default: Warning: Authentication failure. Retrying...
default: Warning: Authentication failure. Retrying...
default: Warning: Authentication failure. Retrying...
答案 0 :(得分:2)
除非您已创建自己的帐户,否则无法使用自己的username
登录。公共框的默认约定是创建vagrant
用户,因此除非明确指定或者您已经创建了自己的框(例如通过打包器)与特定用户,否则您需要使用{{ 1}}用户。
删除您的vagrant
和config.ssh.username
或替换为config.ssh.password
用户,它会让您登录