The way I like to develop is to create specific virtual machines for my web development.
The chore is to start the machine, mount the file system and then open up your IDE. All a nuisance that takes time. So, I’ve taken to writing a simple Bash script that will do the grunt work for you. All you have to do is put in your settings, save it and run it!
This will mount the VM’s web folder onto your file system and let you know it’s connected. All you need to do is then start your IDE of choice!
#!/bin/bash WEBIP='10.0.0.211' VM='Web Development' VMUSER='webadmin' VMMOUNT='/var/www' MOUNTPOINT='/home/user/mnt/sshmnt/' VBoxHeadless -s "$VM" & #This starts the VM you've chosen while :; do echo "Connecting..." if nc -zv -w5 $WEBIP 22 <<< '' &> /dev/null #Tests the connection is available then if sshfs $VMUSER@$WEBIP:$VMMOUNT $MOUNTPOINT #We have to test because even though the connection is available, the SSH #Server might not be ready then echo 'Connected!' exit fi else # echo "Can't connect" #Use this to debug is nc is working fi done