Windows 10 + PuPHPet + Vagrant + DigitalOcean

Started by Joshua Dickerson, October 04, 2015, 03:16:01 PM

Previous topic - Next topic

Joshua Dickerson

I like to use configuration management systems because it allows me to keep track of changes and one-click start a new VM. I use DigitalOcean1 as a host because they offer a $5/m option on an SSD and I don't need all of the extra tools that AWS has. I use PuPHPet to create my provisioning scripts because it is really easy - just click what I want and that's it. I use Windows as my OS - if you give me grief about it, you can keep it to yourself, I like it.

Initially I had a site that I setup with CentOS and just punching in a bunch of `yum install` commands. I had WP installed but I never got around to completing the site. After about a year I decided I was going to scrap WP and install a forum. I don't run any forums and this way I can dogfood my work. It's a private site that I probably won't be posting on here but it really doesn't matter.

PuPHPet has a DigitalOcean deploy target which is awesome. Even tells you what you need to do to get Vagrant to work with it. You need to run two very simple commands: `vagrant plugin install vagrant-digitalocean` and `vagrant box add dummy https://github.com/smdahlen/vagrant-digitalocean/raw/master/box/digital_ocean.box`2. I did that, created the archive, ran `vagrant up` and starting getting issues.

Vagrant stalls
It just stopped with after it created the VM and set the IP. I didn't know why. I could access the VM but it didn't setup any programs or sync any scripts. I was confused but then I enabled the `--debug` flag. I recommend you always do this. There will be tons of lines scrolling across the screen, but if something happens, you want to know what it was.

After I enabled the debug flag I saw errors about the SSH key.

PuTTYgen doesn't create real SSH keys
I figured this out after an entire day (like 18 hours) of trial and error. I finally decided to start an Ubuntu VM (with PuPHPet/Vagrant) locally and attempt to run it. Boom! It worked. I got another error, but at least now I could narrow down the issues.

I just copied the SSH keys from my Linux install over to Windows. Then open puttygen, load that private key in there, and create a new putty style key. I named it with "putty key" so I knew that it was only for PuTTY and not for rsync (more about rsync later).

PuPHPet has a bug with Nginx
If you see an error about 'false' being a string, go to your config.yaml and remove 'false' and replace it with false. In other words, remove the single quotes from the boolean. It is a bug that should be fixed eventually, but Juan Treminio is a busy guy and PuPHPet isn't his priority. It is easier to just find the Nginx section and replace that before you vagrant up.

Cygwin rsync doesn't work out of the box
First off, it didn't add the Cygwin bin path to %PATH%. Then, apparently it can't find it. Finally, there is an issue with Vagrant that makes it not work. I found a tutorial on how to fix that. Instead of explaining it all here, just go to the tutorial.

I might update this with the errors at some point, but I don't want to break things again just to give you all of the errors that I found. If you have questions about this setup or are having problems, I might be able to help you out. Good luck.

Footnotes
1. shameless referral link
2. really wish I could format that as inline code
Come work with me at Promenade Group



Need help? See the wiki. Want to help SMF? See the wiki!

Did you know you can help develop SMF? See us on Github.

How have you bettered the world today?

Joshua Dickerson

Come work with me at Promenade Group



Need help? See the wiki. Want to help SMF? See the wiki!

Did you know you can help develop SMF? See us on Github.

How have you bettered the world today?

青山 素子

Quote from: Joshua Dickerson on October 04, 2015, 03:16:01 PM
PuTTYgen doesn't create real SSH keys
I figured this out after an entire day (like 18 hours) of trial and error. I finally decided to start an Ubuntu VM (with PuPHPet/Vagrant) locally and attempt to run it. Boom! It worked. I got another error, but at least now I could narrow down the issues.

I just copied the SSH keys from my Linux install over to Windows. Then open puttygen, load that private key in there, and create a new putty style key. I named it with "putty key" so I knew that it was only for PuTTY and not for rsync (more about rsync later).

Not entirely true. All the keys PuTTY generates can be fully compatible with OpenSSH. The major difference is the format of the key. PuTTY uses a custom binary format for the PPK files. If you're going to be loading them in OpenSSH, there's a dialog in PuTTYgen that shows the OpenSSH public key format. You also can export the private key in both RC 4716 and OpenSSH formats. If you generate a key with PuTTYgen, make sure you use 2048 bits or higher, it still defaults to the less secure 1024.


Quote from: Joshua Dickerson on October 04, 2015, 03:16:01 PM
Cygwin rsync doesn't work out of the box
First off, it didn't add the Cygwin bin path to %PATH%. Then, apparently it can't find it. Finally, there is an issue with Vagrant that makes it not work. I found a tutorial on how to fix that. Instead of explaining it all here, just go to the tutorial.

The Cygwin tools aren't normally added to the path because they can take precidence on Windows builtin ones. It's pretty common practice. Vagrant on Windows should be able to use the Cygwin version directly without things being added to the path.
Motoko-chan
Director, Simple Machines

Note: Unless otherwise stated, my posts are not representative of any official position or opinion of Simple Machines.


Joshua Dickerson

It defaults to 2048. I guess I should have done a conversion from the menu and a lot easier to do it that way.

It needs to know where to find rsync.
Come work with me at Promenade Group



Need help? See the wiki. Want to help SMF? See the wiki!

Did you know you can help develop SMF? See us on Github.

How have you bettered the world today?

Advertisement: