brandon-rhodes / fopnp

Foundations of Python Network Programming (Apress) — scripts and examples
1.37k stars 640 forks source link

Vagrant stuck on 'SSH auth method: private key' #27

Closed BewareMyPower closed 6 years ago

BewareMyPower commented 7 years ago

OS: Ubuntu 16.04 After sudo apt-get install virtualbox and vagrant, I entered following commands:

$ vagrant init brandon-rhodes/playground
$ vagrant up --provider virtualbox

and then stuck on 'default: SSH auth method: private key' Here's the error message:

Timed out while waiting for the machine to boot. 
...
If the box appears to be booting properly, you may want to increase the timeout ("config.vm.boot_timeout") value.
$ vagrant box list 
brandon-rhodes/playground (virtualbox, 1.0)
$ vagrant ssh
ssh_exchange_identification: read: Connection reset by peer
$ vagrant --version
Vagrant 1.8.1
$ vagrant up --provider virtualbox
Bringing machine 'default' up with 'virtualbox' provider...
==> default: Checking if box 'brandon-rhodes/playground' is up to date...
==> default: VirtualBox VM is already running.
$ ./build.sh
...
Downloading/unpacking cryptography>=1.5 (from paramiko->-r /root/requirements2.txt (line 13))
  Running setup.py (path:/tmp/pip_build_root/cryptography/setup.py) egg_info for package cryptography
    error in cryptography setup command: Invalid environment marker: python_version < '3'
    Complete output from command python setup.py egg_info:
    error in cryptography setup command: Invalid environment marker: python_version < '3'
----------------------------------------
Cleaning up...
Command python setup.py egg_info failed with error code 1 in /tmp/pip_build_root/cryptography
Storing debug log for failure in /root/.pip/pip.log
The command '/bin/sh -c pip install -r /root/requirements2.txt' returned a non-zero code: 1
brandon-rhodes commented 6 years ago

(I have been preparing for a conference but am done now — so am returning to my GitHub backlog!) When SSH isn't letting you connect to the virtual machine, you may need to bring up the virtual machine console using the GUI in order to see if an error message is displayed telling you what the problem is. Are you able to bring up the VM's console?

BewareMyPower commented 6 years ago

I have just found that my virtualbox can only run a 32-bits guest, and I am sure intel virtualization in BIOS is enabled. I also removed Hyper-V, but it's still not working.

T-x/AMD-V hardware acceleration is not available on your system. Your 64-bit guest will fail to detect a 64-bit CPU and will not be able to boot.

OK, finally I've found where the problem is. My Ubuntu 16.04 is a guest machine on VMware Workstation, the virtualbox in it doesn't support 64-bits guest (but I don't know why). Then I try to install virtualbox on my host machine (win10) and succeed to run this playground. And thanks for your reply, I wouldn't try to solve this problem if it was not for your reply.

brandon-rhodes commented 6 years ago

I'm so glad my reply was helpful, and that you got it to work!