Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HTTP_PROXY and HTTPS_PROXY are not automatically forwarded to the Vagrant VM #23

Closed
dinkargupta opened this issue Nov 30, 2016 · 5 comments

Comments

@dinkargupta
Copy link

dinkargupta commented Nov 30, 2016

System information

Geth version: 1.3.5
OS & Version: Windows 8.1
Commit hash : (if develop)

On firing Vagrant up, I am facing the following issue

==> default: Running provisioner: shell...
default: Running: C:/Users/00000/AppData/Local/Temp/vagrant-shell20161130-4056-1lsawh4.sh
==> default: mesg:
==> default: ttyname failed
==> default: :
==> default: Inappropriate ioctl for device
==> default: Cannot add PPA: 'ppa:~ethereum/ubuntu/ethereum'.
==> default: ERROR: '~ethereum' user or team does not exist.
The SSH command responded with a non-zero exit status. Vagrant
assumes that this means the command failed. The output for this command
should be in the log above. Please read the output to determine what
went wrong.

Are there steps I am missing ? also what's the password used for ubuntu user for this virtual box image ? if that's available, I can try logging into the machine separately and check issue with ppa. I have http_proxy and https_proxy set.

@zbobbert
Copy link

I had this same issue and was able to work around it by editing the vagrant/bootstrap.sh script. First, I copied my resolved http_proxy and https_proxy variables into the top of the script. Then I added sudo -E before the add-apt-repository.

Run vagrant destroy to clean up the broken vm, then run vagrant up again.

@patrickmn
Copy link
Contributor

patrickmn commented Nov 30, 2016

This is likely a connectivity issue, and based on your proxy environment variables being set, the solution should be to forward that to Vagrant:

Run vagrant plugin install vagrant-proxyconf

Change your quorum-examples/Vagrantfile to this:

Vagrant.configure(2) do |config|
  config.vm.box = "ubuntu/xenial64"
  config.vm.provision :shell, path: "vagrant/bootstrap.sh"
  config.vm.provider "virtualbox" do |v|
    v.memory = 4096
  end
  config.proxy.http = "http://yourproxy:8080"
  config.proxy.https = "http://yourproxy:8080"
  config.proxy.no_proxy = "localhost,127.0.0.1"
end

Then do vagrant destroy/vagrant up

You can ssh into the machine using vagrant ssh

Edit: Setting the proxy variables in bootstrap.sh as per zbobbert's reply should work as well.

@patrickmn patrickmn changed the title Windows install issue - vagrant up errors HTTP_PROXY and HTTPS_PROXY are not automatically forwarded to the Vagrant VM Nov 30, 2016
@patrickmn
Copy link
Contributor

I will add a note to the quorum-examples README about this. Thanks guys.

@dinkargupta
Copy link
Author

Thanks a lot. it worked ! notes in readme will surely help

@dinkargupta
Copy link
Author

dinkargupta commented Dec 1, 2016

Couple of more changes needed for making the example work if you are on Windows (I am on 8.1)

In order to login into VM through putty, the private_key file needs to be converted using puttygen and then only putty accepts the key file to login.

I loaded the /quorum-examples/.vagrant/machines/default/virtualbox/private_key into puttygen
then used the 'save private key' option to save the file as quoram-private-key.ppk and used that in putty ssh connection setting... after that I was able to login into the VM

  1. after logging in you need to convert the shell scripts from windows format to linux (there's a carriage return which will cause failure of scripts). So do the following
    sed -i -e 's/\r$//' init.sh
    sed -i -e 's/\r$//' start.sh
    sed -i -e 's/\r$//' stop.sh (basically all executable before you use these)
    you can also use dos2unix

After that... the steps mentioned work (./init.sh, followed by ./start.sh)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants