Hi team,
for one reason or another, I would like to run multiple instances of XAMPP-VM on a mac simultaneously (am running the latest VM version [7.3.0-0] on mojave)
It is obvious that this is not what the maker intended - and I can find very little documentation, but it may just be possible to make it happen.
I have burned a couple of days trying to figure out how to do it - learned a lot about the structure of the virtual machine implementation (and this version of linux).
Still a solution has eluded me thus far. Any viable solutions would be much appreciated.
Ideally I want two XAMPP-VM apps in Applications, and when I run each I get a separate XMAPP controller.
What I tried:
a) I tried copying the XAMPP-VM app in the applications directory and because they both point to ~/.bitnami..., I believe they ran the same stack
b) I managed to rename the 2nd VM to xampp2 and had it located on ~/.bitnami/stackman/machines/xampp2. This might have worked, but the two implementations had the same MAC address and hence (I assume) received the same IP address from OSX's bootdp.plist DHCP server and would not run simultaneously. I tried many ways to change the VMs MAC address and I believe that when I succeeded, I could not restart the VM. The terminal lost contact and although I could shut down the VM, I could not start it again. I changed the MAC address by adding the file 00-default.link to the /etc/systemd/network folder containing:
[match]
MACAddress=b6:16:31:ed:2c:68
[Link]
MACAddress=b6:16:31:ed:2c:69
c) I deleted ~/.bitnami and the XAMPP-VM app, and reinstalled XAMPP-VM. I noted that every time I did this, the IP address incremented. I guess, but have not proved yet, that
means that every time I delete ~/.bitnami and then run XAMPP-VM. this action recreates the ~/.bitnami folder and also creates a unique MAC address. Maybe this is why I
can't change the MAC address - because it does not match a calculated MAC address somewhere else???
d) Perhaps a viable strategy to try next might be to
i) move the current ./bitnami structure to a safe place
ii) make a copy of the XAMPP-VM app. Run it and make a new bitnami structure, with a (hopefully) new mac address and a new IP address.
iii) in the new version rename ~/.bitnami/stackman/machines/xampp to ~/.bitnami/stackman/machines/xampp2
iv) change the app's Contents/Resources/metadata.json to
"stacks": [
{
"description": "XAMPP",
"id": "xampp2",
"name": "XAMPP",
"version": "7.3.0-0",
"requiredMemory": 1024,
"resourcesDir": "machines/xampp2",
etc.
(note the rest of this file seems to be ignored)
Also - another thing that has me a little confused: Mounting other filesystems. This might be necessary to understand because if I get two+ VMs running and try to mount two similarly names /opt/lampp volumes - I am sure that will cause a problem. What I did...
1) Via the terminal (VM) I copied /opt/lampp to lampp2. Set symbolic link lampp2/lampp -> /opt/lampp2/xampp.
2) I then created a directory ~/.bitnami/stackman/machines/xampp/volumes/root2
3) added
{
"id": "root2",
"kind": "",
"remoteDir": "/opt/lampp2"
}
to ~/.bitnami/stackman/machines/xampp/metadata.json
4) The VM starts OK. The XAMPP-VM has both mounts shown in the control panel (Volumes tab).
I can still mount /opt/lampp on ~/.bitnami/stackman/machines/xampp/volumes/root
Unfortunately I can't mount /opt/lampp2 on ~/.bitnami/stackman/machines/xampp/volumes/root2 because Error ... I lack the permission to do so.
This is despite both root and root2 having the same permissions and /opt/lampp and /opt/lampp2 having the same permissions.
Arrgghh.