Skip to content

Instantly share code, notes, and snippets.

@maravedi
Last active December 12, 2016 11:54
Show Gist options
  • Save maravedi/aa365f3a25c06cf64358 to your computer and use it in GitHub Desktop.
Save maravedi/aa365f3a25c06cf64358 to your computer and use it in GitHub Desktop.
Setting up Homestead 2.0.7 on Windows 7 32-bit

#Introduction For the most part, you can follow the instructions given by Jeffrey Way at Laracasts - Say Hello to Laravel Homestead 2.

If you are like me and also have a 32-bit installation of Windows with low RAM, the there are a few exceptions.

#Setting up 32-bit Homestead Firstly, the default homestead VM is a 64-bit version of Ubuntu, so you'll need to change that. Thankfully, someone has created a 32-bit version of homestead already. To do this, you will need to go to C:\Users\myusername\AppData\Roaming\Composer\vendor\laravel\homestead\scripts\ and then edit the homestead.rb file.

Following the instructions from here, within the homestead.rb file you will need to change the line

config.vm.box = "laravel/homestead" to config.vm.box = "antoniofrignani/laravel-homestead-settler-32"

and then save the file.

Make sure that if you made a homestead VM already, that you destroy it and then delete its folder from the C:\Users\myusername\VirtualBox VMs\ directory.

Afterwards, you should be able successfully to run homestead up.

#Configuring VM Memory Another issue that I ran into was that the current PC I'm working on only has a measly 2GB of ram. The default settings for homestead allocate 2GB of ram to the VM! You can change this in two ways. First, you could go back into the homestead.rb file (see above for the path) and modify the line vb.customize ["modifyvm", :id, "--memory", settings["memory"] ||= "2048"] as needed. Second, you can just change the memory settings in the homestead.yaml file that should be in the directory C:\Users\myusername\.homestead\. I chose to make my changes in the homestead.yaml file, just because it's more accessible than the homestead.rb file.

#My Working homestead.yaml File Lastly, you might be interested in seeing my working homestead.yaml file.

ip: "192.168.10.10"
memory: 512
cpus: 1

authorize: ~/.ssh/github_rsa.pub

keys:
    - ~/.ssh/github_rsa

folders:
    - map: ~/Documents/Github
      to: /home/vagrant/Projects

sites:
    - map: homestead.app
      to: /home/vagrant/Projects/Laravel/public

databases:
    - homestead

variables:
    - key: APP_ENV
      value: local

#proc_open(): fork failed errors# From here

If composer shows proc_open() fork failed on some commands:

PHP Fatal error: Uncaught exception 'ErrorException' with message 'proc_open(): fork failed - Cannot allocate memory' in phar

This could be happening because the VPS runs out of memory and has no Swap space enabled.

free -m

total used free shared buffers cached
Mem: 2048 357 1690 0 0 237
-/+ buffers/cache: 119 1928
Swap: 0 0 0

To enable the swap you can use for example:

/bin/dd if=/dev/zero of=/var/swap.1 bs=1M count=1024
/sbin/mkswap /var/swap.1
/sbin/swapon /var/swap.1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment