-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmnt.vm
executable file
·36 lines (30 loc) · 947 Bytes
/
mnt.vm
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#!/bin/bash
# This starts the Fortix Virutal Machin
# Mounts the VM remote directory local
# Runs the local mailserver mailcathcer
# Sets up ssh tunnel for xdebug
# Connects to the server
# start virtual machine
VBoxManage startvm "Fortix" --type headless
echo "Waiting for network"
while ! ping -c1 fortix &>/dev/null;
do
echo "Ping Fail - `date`";
done ;
echo "Network to VM detected"
echo "Waiting for boot to complete."
sleep 10s
echo "Fortix Ready - `date`" ;
# Starting mailcatcher mail server
echo "Starting mailcatcher mail server"
echo "Available on http://mail:8080"
ssh fortix startmail
# Mount virtual server to local Fizban
echo "Mounting Machine to local drive ~/Fortix/"
sshfs -o follow_symlinks Fortix:/home/peter/ ~/Fortix/
# Set up ssh tunnel for phpstorm and xdebug
echo "Setting up ssh tunnel for phpstorm xdebug"
ssh -R 9000:localhost:9000 fortix
# Connect to the server
echo "Connecting to Fortix"
ssh fortix