Thursday, 3 November 2016

Useful Vagrant plugins

Some useful Vagrant plugins I've picked up along the way

vagrant-hostmanager
Updates your host file with entries

vagrant-reload
Allows you to reload the vm during provisioning

vagrant-share
Allows sharing access remotely to vms

vagrant-vbguest
For automatically updating the virtualbox plugins

vagrant-winnfsd
NFS for sharing folders

Monday, 11 January 2016

Vagrant not working after fresh Windows 10 x64 install

After recently re-installing Windows 10 x64 I discovered that to get vagrant to download box images, it uses an embedded version of curl. This requires the Microsoft Visual C++ 2010 Service Pack 1 Redistributable Package x86 version.

Wednesday, 16 December 2015

Occasionally making phpunit work with PhpStorm and homestead

When using homestead on vagrant I find that I need to use ssh/sftp setup for the server and interpreter for it to get the path mappings correct.

Settings I configure

"Build, Exection, Deployment" -> "Deployment"
Add an entry for the server and set its "Type" to be "SFTP".
In the "Connection" tab, set the details according to the information obtained by running "vagrant ssh-config".
Set the "Auth type" to "Key pair" and set the "Private key file" to be the location of the IdentityFile from the ssh-config.

In the "Mappings" tab, make sure that the deployment path remote server location matches the local path.

Set up the PHP interpreter by going to "PHP" and adding a remote Interpreter. Set the remote to be based on the "Deployment configuration", saves you setting up all the SSH information again.

In "PHP" -> "PHPUnit" add a "Remote Interpreter" and pick the one you set up.
Set the "custom autoloader" to be the location of your vendor/autoload.php and optionally set the location of you phpunit.xml in the "Test Runner" -> "Default configuration file"

Make sure xdebug is configured by doing similar to "sudo nano /etc/php/7.0/fpm/conf.d/20-xdebug.ini

xdebug.remote_enable = 1
xdebug.remote_connect_back = 1
xdebug.remote_port = 9000
xdebug.scream=0 
xdebug.cli_color=1
xdebug.show_local_vars=1

Restart the service for php by doing "sudo service php7.0-fpm restart" or similar.

Tuesday, 13 October 2015

Making node / npm / gulp / elixir work for Laravel using Homestead on Vagrant with Virtualbox on Windows

Wow what a title. More of a note to myself this one.

Problem: npm install or variants thereof cause errors, mainly related to long filenames when run inside a homestead virtualbox virtual machine on Windows.

A simple fix is to create a symbolic link inside the vm for the node_modules path so that it doesn't reside inside the folder being shared with the Windows file-system.

Modify the Vagrantfile or the scripts/homestead.rb file if using homestead to include the following as part of the config:

config.vm.provider "virtualbox" do |v|
    v.customize ["setextradata", :id, "VBoxInternal2/SharedFoldersEnableSymlinksCreate/v-root", "1"]
end

Then you'll need to run the Git Bash shell as admin, otherwise it won't let you create the symbolic links. The important part here is actually that winnfsd.exe starts as admin so you could change the compatibility in the properties to start as admin.

Start vagrant with a "vagrant up"

Once you've done "vagrant ssh", create a node_modules directory in your home directory, or somewhere similar and add a symbolic link to it within your Laravel project:

mkdir ~/node_modules
ln -sf ~/node_modules /home/vagrant/projectname

Then you can use

sudo npm install —no-bin-link

to install the node modules with. You might have to "sudo" depending on your configuration and whether you have further issues.

Thursday, 29 January 2015

New Windows 10 build 9933 coming?

It looks like 9933 might be coming soon...
Although it failed to download with an error 0x80246017, it looks as though there is a new build coming in the fast fbl_awsome1501 branch...

UPDATE:

Saturday, 24 January 2015

Windows 10 Pro Technical Preview Build 9926

I didn't bother to blog about the last couple of Windows 10 Technical Preview builds.  They'd been talked about a lot and hyped or criticised enough.

I wanted to take a couple of minutes though to say just how much I'm enjoying using Windows 8, Windows 8.1 and Windows 10. There's nothing wrong with them. Granted, the default user experience for Windows 8 was annoying, but so so easily rectified with something like Classic Shell.  I didn't really understand all the complaints, if your house has a front door that's horrible, but basically really good other than that, excellent central heating, insulation, double glazing, then for goodness sake, just do a little redecoration and get over it!

Technically it's all pretty darn good these days and new latest build is edging towards the solution that Microsoft were trying to implement as an answer to the single operating system to cover phones, tablets and desktops. The main complaints from the Windows world was the fact that the desktop experience really sucked when trying to compromise/enable user friendly interfaces for tablet users.

It really didn't work for those hard core desktop users, such as myself, who are developers/big application users.

I think that Microsoft have taken this on board with their continuum concept that allows us as users to chose to switch between the two experiences. This should work very well when using something like the Surface which doubles as a slightly chunky tablet and laptop.

Hang in there, try it out, don't just dismiss things because they don't immediately look how you're used to. Give it a chance. Give Microsoft feedback. With all the open source direction for the development environments, the IDE and runtime, this is a great time to be a developer. Enjoy it and explore a bit.

The latest build, 9926, is even better than the last few, which have been a bit buggy. I don't expect it to be perfect, so lets see how things go.

Cortana on the desktop doesn't quite work outside the US without a bit of tweaking, but this is the same as the Windows 8.1 developer preview for Windows phone was.

Generally a much improved interface I feel. The start bar search is much nicer and settings dialogs are a little more thought out and integrated. Time to learn where everything is again...

So far so good though...