Vagrant SSH ничего не делает, он просто переходит на следующую строку - PullRequest
0 голосов
/ 22 февраля 2019

Я новичок в vagrant и пытаюсь подключиться к своей виртуальной машине.

C:\Users\my_username\Desktop\Vagrant\Ubuntu>vagrant up
Bringing machine 'default' up with 'hyperv' provider...
==> default: Verifying Hyper-V is enabled...
==> default: Verifying Hyper-V is accessible...
    default: Configuring the VM...
==> default: Starting the machine...
==> default: Waiting for the machine to report its IP address...
    default: Timeout: 120 seconds
    default: IP: 172.20.x.x
==> default: Waiting for machine to boot. This may take a few minutes...
    default: SSH address: 172.20.x.x:22
    default: SSH username: vagrant
    default: SSH auth method: private key
==> default: Machine booted and ready!

Vagrant requires administrator access for pruning SMB shares and
may request access to complete removal of stale shares.
==> default: Preparing SMB shared folders...
    default: You will be asked for the username and password to use for the SMB
    default: folders shortly. Please use the proper username/password of your
    default: account.
    default:
    default: Username: my_username
    default: Password (will be hidden):

Vagrant requires administrator access to create SMB shares and
may request access to complete setup of configured shares.
==> default: Mounting SMB shared folders...
    default: C:/Users/my_username/Desktop/Vagrant/Ubuntu => /vagrant
==> default: Machine already provisioned. Run `vagrant provision` or use the `--provision`
==> default: flag to force provisioning. Provisioners marked to run always will still run.

C:\Users\my_username\Desktop\Vagrant\Ubuntu>vagrant ssh

C:\Users\my_username\Desktop\Vagrant\Ubuntu>vagrant ssh

В прошлый раз я выключил компьютер без раздумий, и это, вероятно, причина, по которой он не работает.Тем не менее, есть ли способ, как войти в эту виртуальную машину, не уничтожая ее?

Вот несколько журналов ошибок, я сократил их, чтобы они были читабельными.

(те ------ строки сделаны мной, ошибка почти такая же, отличается только эта строка, которую вы можете видеть там)

ЖУРНАЛЫ EERORS (КРАТКОЕ):

 INFO subprocess: Starting process: ["C:\\WINDOWS\\System32\\WindowsPowerShell\\v1.0\\/powershell.EXE", "-NoLogo", "-NoProfile", "-NonInteractive", "-ExecutionPolicy", "Bypass", "$env:PSModulePath=$env:PSModulePath+';C:\\HashiCorp\\Vagrant\\embedded\\gems\\2.2.3\\gems\\vagrant-2.2.3\\plugins\\providers\\hyperv\\scripts\\utils'; &('C:\\HashiCorp\\Vagrant\\embedded\\gems\\2.2.3\\gems\\vagrant-2.2.3\\plugins\\providers\\hyperv\\scripts\\get_vm_status.ps1')", "-VmId", "'74cdf86e-daba-454f-91ab-34617cadec07'", "-ErrorAction", "Stop"]
-----------------------------------------------------------------
 INFO subprocess: Starting process: ["C:\\WINDOWS\\System32\\WindowsPowerShell\\v1.0\\/powershell.EXE", "-NoLogo", "-NoProfile", "-NonInteractive", "-ExecutionPolicy", "Bypass", "$env:PSModulePath=$env:PSModulePath+';C:\\HashiCorp\\Vagrant\\embedded\\gems\\2.2.3\\gems\\vagrant-2.2.3\\plugins\\providers\\hyperv\\scripts\\utils'; &('C:\\HashiCorp\\Vagrant\\embedded\\gems\\2.2.3\\gems\\vagrant-2.2.3\\plugins\\providers\\hyperv\\scripts\\get_vm_status.ps1')", "-VmId", "'74cdf86e-daba-454f-91ab-34617cadec07'", "-ErrorAction", "Stop"]
-----------------------------------------------------------------
 INFO subprocess: Starting process: ["C:\\WINDOWS\\System32\\WindowsPowerShell\\v1.0\\/powershell.EXE", "-NoLogo", "-NoProfile", "-NonInteractive", "-ExecutionPolicy", "Bypass", "$env:PSModulePath=$env:PSModulePath+';C:\\HashiCorp\\Vagrant\\embedded\\gems\\2.2.3\\gems\\vagrant-2.2.3\\plugins\\providers\\hyperv\\scripts\\utils'; &('C:\\HashiCorp\\Vagrant\\embedded\\gems\\2.2.3\\gems\\vagrant-2.2.3\\plugins\\providers\\hyperv\\scripts\\get_vm_status.ps1')", "-VmId", "'74cdf86e-daba-454f-91ab-34617cadec07'", "-ErrorAction", "Stop"]
-----------------------------------------------------------------
 INFO subprocess: Starting process: ["C:\\WINDOWS\\System32\\WindowsPowerShell\\v1.0\\/powershell.EXE", "-NoLogo", "-NoProfile", "-NonInteractive", "-ExecutionPolicy", "Bypass", "$env:PSModulePath=$env:PSModulePath+';C:\\HashiCorp\\Vagrant\\embedded\\gems\\2.2.3\\gems\\vagrant-2.2.3\\plugins\\providers\\hyperv\\scripts\\utils'; &('C:\\HashiCorp\\Vagrant\\embedded\\gems\\2.2.3\\gems\\vagrant-2.2.3\\plugins\\providers\\hyperv\\scripts\\get_network_config.ps1')", "-VmId", "'74cdf86e-daba-454f-91ab-34617cadec07'", "-ErrorAction", "Stop"]
 INFO subprocess: Command not in installer, restoring original environment...
DEBUG subprocess: Selecting on IO
DEBUG subprocess: stdout: ===Begin-Output===
{
    "ip":  "172.20.166.100"
}
===End-Output===
DEBUG subprocess: Waiting for process to exit. Remaining to timeout: 31998
DEBUG subprocess: Exit status: 0
DEBUG provider: IP: 172.20.166.100
 INFO subprocess: Starting process: ["C:\\WINDOWS\\System32\\OpenSSH\\/ssh.EXE"]
 INFO subprocess: Command not in installer, restoring original environment...
DEBUG subprocess: Selecting on IO
DEBUG subprocess: stderr: usage: ssh [-46AaCfGgKkMNnqsTtVvXxYy] [-b bind_address] [-c cipher_spec]
           [-D [bind_address:]port] [-E log_file] [-e escape_char]
           [-F configfile] [-I pkcs11] [-i identity_file]
           [-J [user@]host[:port]] [-L address] [-l login_name] [-m mac_spec]
           [-O ctl_cmd] [-o option] [-p port] [-Q query_option] [-R address]
           [-S ctl_path] [-W host:port] [-w local_tun[:remote_tun]]
           destination [command]
DEBUG subprocess: Waiting for process to exit. Remaining to timeout: 32000
DEBUG subprocess: Exit status: 255
 INFO ssh: Invoking SSH: C:\WINDOWS\System32\OpenSSH\/ssh.EXE ["vagrant@172.20.166.100", "-p", "22", "-o", "LogLevel=FATAL", "-o", "Compression=yes", "-o", "DSAAuthentication=yes", "-o", "IdentitiesOnly=yes", "-o", "StrictHostKeyChecking=no", "-o", "UserKnownHostsFile=/dev/null", "-i", "C:/Users/lasoodom/Desktop/Vagrant/Ubuntu/.vagrant/machines/default/hyperv/private_key"]
DEBUG safe_exec: Converting command and arguments to common UTF-8 encoding for exec.
DEBUG safe_exec: Command: `"C:\\WINDOWS\\System32\\OpenSSH\\/ssh.EXE"` Args: `["vagrant@172.20.166.100", "-p", "22", "-o", "LogLevel=FATAL", "-o", "Compression=yes", "-o", "DSAAuthentication=yes", "-o", "IdentitiesOnly=yes", "-o", "StrictHostKeyChecking=no", "-o", "UserKnownHostsFile=/dev/null", "-i", "C:/Users/lasoodom/Desktop/Vagrant/Ubuntu/.vagrant/machines/default/hyperv/private_key"]`
DEBUG safe_exec: Converted - Command: `"C:\\WINDOWS\\System32\\OpenSSH\\/ssh.EXE"` Args: `["vagrant@172.20.166.100", "-p", "22", "-o", "LogLevel=FATAL", "-o", "Compression=yes", "-o", "DSAAuthentication=yes", "-o", "IdentitiesOnly=yes", "-o", "StrictHostKeyChecking=no", "-o", "UserKnownHostsFile=/dev/null", "-i", "C:/Users/lasoodom/Desktop/Vagrant/Ubuntu/.vagrant/machines/default/hyperv/private_key"]`

1 Ответ

0 голосов
/ 22 февраля 2019

Я смог заставить его работать, установив GIT Shell и затем запустив его через GIT Shell.

Если у кого-то из вас возникла такая же проблема, я бы порекомендовал посетить этот сайт: https://tech.osteel.me/posts/2015/01/25/how-to-use-vagrant-on-windows.html

...