vagrant 1.1.4 with cygwin working much better than git bash

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

vagrant 1.1.4 with cygwin working much better than git bash

wenlock
Hey,

After struggling with this for about a week, I'm finally throwing in the towel on trying to get my git bash shell working with vagrant 1.1.4.   

I discovered that besides the vagrant shell issues (which aren't that big a deal), there are other issues with ssh and vagrant up that don't seem to work correctly.    

I reset my vagrant box to use cygwin instead, and things started working much better for both the guest and the host OS.   Using cyg-get to setup the initial deployment.   Here are the setup steps i did that might come in handy to others trying to run in the same scenario.

My environment was:
Host OS: Windows 8
Guest OS: Windows 2008 R2
Vagrant : 1.1.4 with provider = virtualbox

Do this both on the windows host and windows guest:

1) Get chocolatey to deploy cygwin:

@powershell -NoProfile -ExecutionPolicy unrestricted -Command "iex ((new-object net.webclient).DownloadString('http://chocolatey.org/install.ps1'))" && SET PATH=%PATH%;%systemdrive%\chocolatey\bin

2) Setup cygwin packages:
    cyg-get openssh
    cyg-get wget
    cyg-get shutdown

    Optional if your developing:
     cyg-get vim
     cyg-get git    
     
 3) Fix the home folder to match %USERPROFILE% folder so that you don't get two .vagrant.d folders 
      For each account your going to use cygwin for (lets say MyAccount) login to the account and from command prompt do:
       move c:\cygwin\home\MyAccount c:\cygwin\home\MyAccount.old
       mklink /J c:\Cygwin\home\vagrant  %userprofile%     


Do this for the guest system that you plan to package:

1) create a vagrant account with vagrant password on host OS.  Remember to do step 3 from above for cygwin\home folder.

2) ssh-host-config
    Select yes for priv seperation
    Select yes for sshd service
    Select ntsec for value of Daemon for CYGWIN
    no for cyg_server name change
    provide a password
3) start the sshd service
     net start sshd
4) For each account you will use ssh for (including vagrant) setup some .ssh defaults:
      ssh-user-config
      Select yes for each auth method you want to use (i did all as yes), we break this for the vagrant account on the next step for insecure private keys.

5) Setup insecure private keys for vagrant

    Login as vagrant
     chmod 700 ~/.ssh
     cd .ssh
     mv authorized_keys authorized_keys.bak
     wget https://raw.github.com/mitchellh/vagrant/master/keys/vagrant.pub -O authorized_keys --no-check-certificate

6) If you want to test the ssh connection, from the client machine running ssh, setup the id_rsa file (this was the host OS in my case).
wget https://raw.github.com/mitchellh/vagrant/master/keys/vagrant -O ~/.ssh/id_rsa --no-check-certificate
chmod 700 ~/.shh/id_rsa

           ssh vagrant@localhost 

          You should be logged into the guest OS if all went well.

Now your ready to use that guest OS for packaging.


The only open issue I have is vagrant halt tries to execute shutdown -h now  for windows cygwin.    If I can find a way to convence it to execute shutdown -s now that would be nice.    For now I halt the box with valgrant halt --force.

Thanks,
Edward 

--
You received this message because you are subscribed to the Google Groups "Vagrant" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/groups/opt_out.
 
 
Reply | Threaded
Open this post in threaded view
|

Re: vagrant 1.1.4 with cygwin working much better than git bash

wenlock


On Friday, March 29, 2013 11:25:17 AM UTC-7, mocchi wrote:
Hey,

After struggling with this for about a week, I'm finally throwing in the towel on trying to get my git bash shell working with vagrant 1.1.4.   

I discovered that besides the vagrant shell issues (which aren't that big a deal), there are other issues with ssh and vagrant up that don't seem to work correctly.    

I reset my vagrant box to use cygwin instead, and things started working much better for both the guest and the host OS.   Using cyg-get to setup the initial deployment.   Here are the setup steps i did that might come in handy to others trying to run in the same scenario.

My environment was:
Host OS: Windows 8
Guest OS: Windows 2008 R2
Vagrant : 1.1.4 with provider = virtualbox

Do this both on the windows host and windows guest:

1) Get chocolatey to deploy cygwin:

@powershell -NoProfile -ExecutionPolicy unrestricted -Command "iex ((new-object net.webclient).DownloadString('http://chocolatey.org/install.ps1'))" && SET PATH=%PATH%;%systemdrive%\chocolatey\bin

I forgot to mention.  Install cyg-get from command prompt :

     cinst cyg-get
 
2) Setup cygwin packages:
    cyg-get openssh
    cyg-get wget
    cyg-get shutdown

    Optional if your developing:
     cyg-get vim
     cyg-get git    
     
 3) Fix the home folder to match %USERPROFILE% folder so that you don't get two .vagrant.d folders 
      For each account your going to use cygwin for (lets say MyAccount) login to the account and from command prompt do:
       move c:\cygwin\home\MyAccount c:\cygwin\home\MyAccount.old
       mklink /J c:\Cygwin\home\vagrant  %userprofile%     


Do this for the guest system that you plan to package:

1) create a vagrant account with vagrant password on host OS.  Remember to do step 3 from above for cygwin\home folder.

2) ssh-host-config
    Select yes for priv seperation
    Select yes for sshd service
    Select ntsec for value of Daemon for CYGWIN
    no for cyg_server name change
    provide a password
3) start the sshd service
     net start sshd
4) For each account you will use ssh for (including vagrant) setup some .ssh defaults:
      ssh-user-config
      Select yes for each auth method you want to use (i did all as yes), we break this for the vagrant account on the next step for insecure private keys.

5) Setup insecure private keys for vagrant

    Login as vagrant
     chmod 700 ~/.ssh
     cd .ssh
     mv authorized_keys authorized_keys.bak
     wget https://raw.github.com/mitchellh/vagrant/master/keys/vagrant.pub -O authorized_keys --no-check-certificate

6) If you want to test the ssh connection, from the client machine running ssh, setup the id_rsa file (this was the host OS in my case).
wget https://raw.github.com/mitchellh/vagrant/master/keys/vagrant -O ~/.ssh/id_rsa --no-check-certificate
chmod 700 ~/.shh/id_rsa

           ssh vagrant@localhost 

          You should be logged into the guest OS if all went well.

Now your ready to use that guest OS for packaging.


The only open issue I have is vagrant halt tries to execute shutdown -h now  for windows cygwin.    If I can find a way to convence it to execute shutdown -s now that would be nice.    For now I halt the box with valgrant halt --force.

Thanks,
Edward 

--
You received this message because you are subscribed to the Google Groups "Vagrant" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/groups/opt_out.
 
 
Reply | Threaded
Open this post in threaded view
|

Re: vagrant 1.1.4 with cygwin working much better than git bash

wenlock
In reply to this post by wenlock


On Friday, March 29, 2013 11:25:17 AM UTC-7, mocchi wrote:
Hey,

After struggling with this for about a week, I'm finally throwing in the towel on trying to get my git bash shell working with vagrant 1.1.4.   

I discovered that besides the vagrant shell issues (which aren't that big a deal), there are other issues with ssh and vagrant up that don't seem to work correctly.    

I reset my vagrant box to use cygwin instead, and things started working much better for both the guest and the host OS.   Using cyg-get to setup the initial deployment.   Here are the setup steps i did that might come in handy to others trying to run in the same scenario.

My environment was:
Host OS: Windows 8
Guest OS: Windows 2008 R2
Vagrant : 1.1.4 with provider = virtualbox

Do this both on the windows host and windows guest:

1) Get chocolatey to deploy cygwin:

@powershell -NoProfile -ExecutionPolicy unrestricted -Command "iex ((new-object net.webclient).DownloadString('http://chocolatey.org/install.ps1'))" && SET PATH=%PATH%;%systemdrive%\chocolatey\bin

2) Setup cygwin packages:
    cyg-get openssh
    cyg-get wget
    cyg-get shutdown

    Optional if your developing:
     cyg-get vim
     cyg-get git    
     
 3) Fix the home folder to match %USERPROFILE% folder so that you don't get two .vagrant.d folders 
      For each account your going to use cygwin for (lets say MyAccount) login to the account and from command prompt do:
       move c:\cygwin\home\MyAccount c:\cygwin\home\MyAccount.old
       mklink /J c:\Cygwin\home\vagrant  %userprofile%     

          Typo error:    mklink /J c:\Cygwin\home\MyAccount %userprofile%
              vagrant would be simillar expect you replace MyAccount with vagrant account name. 

Do this for the guest system that you plan to package:

1) create a vagrant account with vagrant password on host OS.  Remember to do step 3 from above for cygwin\home folder.

2) ssh-host-config
    Select yes for priv seperation
    Select yes for sshd service
    Select ntsec for value of Daemon for CYGWIN
    no for cyg_server name change
    provide a password
3) start the sshd service
     net start sshd
4) For each account you will use ssh for (including vagrant) setup some .ssh defaults:
      ssh-user-config
      Select yes for each auth method you want to use (i did all as yes), we break this for the vagrant account on the next step for insecure private keys.

5) Setup insecure private keys for vagrant

    Login as vagrant
     chmod 700 ~/.ssh
     cd .ssh
     mv authorized_keys authorized_keys.bak
     wget https://raw.github.com/mitchellh/vagrant/master/keys/vagrant.pub -O authorized_keys --no-check-certificate

6) If you want to test the ssh connection, from the client machine running ssh, setup the id_rsa file (this was the host OS in my case).
wget https://raw.github.com/mitchellh/vagrant/master/keys/vagrant -O ~/.ssh/id_rsa --no-check-certificate
chmod 700 ~/.shh/id_rsa

           ssh vagrant@localhost 

          You should be logged into the guest OS if all went well.

Now your ready to use that guest OS for packaging.


The only open issue I have is vagrant halt tries to execute shutdown -h now  for windows cygwin.    If I can find a way to convence it to execute shutdown -s now that would be nice.    For now I halt the box with valgrant halt --force.

Thanks,
Edward 

--
You received this message because you are subscribed to the Google Groups "Vagrant" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/groups/opt_out.
 
 
Reply | Threaded
Open this post in threaded view
|

Re: vagrant 1.1.4 with cygwin working much better than git bash

wenlock
Posted on wiki page: https://github.com/wenlock/vagrant/wiki/Setting-up-vagrant-for-windows-under-cygwin

On Friday, March 29, 2013 11:28:39 AM UTC-7, wenlock wrote:


On Friday, March 29, 2013 11:25:17 AM UTC-7, mocchi wrote:
Hey,

After struggling with this for about a week, I'm finally throwing in the towel on trying to get my git bash shell working with vagrant 1.1.4.   

I discovered that besides the vagrant shell issues (which aren't that big a deal), there are other issues with ssh and vagrant up that don't seem to work correctly.    

I reset my vagrant box to use cygwin instead, and things started working much better for both the guest and the host OS.   Using cyg-get to setup the initial deployment.   Here are the setup steps i did that might come in handy to others trying to run in the same scenario.

My environment was:
Host OS: Windows 8
Guest OS: Windows 2008 R2
Vagrant : 1.1.4 with provider = virtualbox

Do this both on the windows host and windows guest:

1) Get chocolatey to deploy cygwin:

@powershell -NoProfile -ExecutionPolicy unrestricted -Command "iex ((new-object net.webclient).DownloadString('http://chocolatey.org/install.ps1'))" && SET PATH=%PATH%;%systemdrive%\chocolatey\bin

2) Setup cygwin packages:
    cyg-get openssh
    cyg-get wget
    cyg-get shutdown

    Optional if your developing:
     cyg-get vim
     cyg-get git    
     
 3) Fix the home folder to match %USERPROFILE% folder so that you don't get two .vagrant.d folders 
      For each account your going to use cygwin for (lets say MyAccount) login to the account and from command prompt do:
       move c:\cygwin\home\MyAccount c:\cygwin\home\MyAccount.old
       mklink /J c:\Cygwin\home\vagrant  %userprofile%     

          Typo error:    mklink /J c:\Cygwin\home\MyAccount %userprofile%
              vagrant would be simillar expect you replace MyAccount with vagrant account name. 

Do this for the guest system that you plan to package:

1) create a vagrant account with vagrant password on host OS.  Remember to do step 3 from above for cygwin\home folder.

2) ssh-host-config
    Select yes for priv seperation
    Select yes for sshd service
    Select ntsec for value of Daemon for CYGWIN
    no for cyg_server name change
    provide a password
3) start the sshd service
     net start sshd
4) For each account you will use ssh for (including vagrant) setup some .ssh defaults:
      ssh-user-config
      Select yes for each auth method you want to use (i did all as yes), we break this for the vagrant account on the next step for insecure private keys.

5) Setup insecure private keys for vagrant

    Login as vagrant
     chmod 700 ~/.ssh
     cd .ssh
     mv authorized_keys authorized_keys.bak
     wget https://raw.github.com/mitchellh/vagrant/master/keys/vagrant.pub -O authorized_keys --no-check-certificate

6) If you want to test the ssh connection, from the client machine running ssh, setup the id_rsa file (this was the host OS in my case).
wget https://raw.github.com/mitchellh/vagrant/master/keys/vagrant -O ~/.ssh/id_rsa --no-check-certificate
chmod 700 ~/.shh/id_rsa

           ssh vagrant@localhost 

          You should be logged into the guest OS if all went well.

Now your ready to use that guest OS for packaging.


The only open issue I have is vagrant halt tries to execute shutdown -h now  for windows cygwin.    If I can find a way to convence it to execute shutdown -s now that would be nice.    For now I halt the box with valgrant halt --force.

Thanks,
Edward 

--
You received this message because you are subscribed to the Google Groups "Vagrant" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/groups/opt_out.