How to create freepbx Distro instance on Google Cloud GCP


(Chaudhary) #1

Hi Guys,
Can anyone please guide me how to create install freepbx distro instance on Google Cloud platform as image is available on freepbx.org in ISO format but what i understood is first we need to convert into tar.gz (which is not available anywhere) to save it on BUCKET then will create image from it and after that instance. I don’t have good internet due to which i’m unable to do so .
Second is live migration via CloudEndure in which I ran in to problem of agent installation and i could not fix it problem , no idea. .
Is there any good simple way to perform the same task .
I’ll be thankful to you .
Regards,
Ch Hassan


(Jimmy) #2

If you are using the most current version of the freepbx ISO, run this command and run the agent installation again…

ln -s /usr/src/kernels/3.10.0-957.10.1.el7.x86_64 /lib/modules/3.10.0-957.10.1.el7.x86_64/build


(Moussa) #3

Try to follow the steps in this link:

If you have issue with the most current distro iso, then try this iso image should work
https://downloads.freepbxdistro.org/ISO/SNG7-FPBX-64bit-1805-2.iso

I tested this iso on a local VM that is VHD. (VMDK
may work as well https://cloud.google.com/compute/docs/images/importing-virtual-disks ) wit fixed size.

Make sure you create a service account and download the JSON file https://cloud.google.com/compute/docs/vm-migration/using-cloud-endure

Here is some more guide https://www.youtube.com/watch?time_continue=39&v=R9JDCRCro-s

If you manage to have the VM instance up and running I recommend making Snapshot. I had issue updating the FreePBX system from the web interface. I recommend logging into your system via SSH and run the update from there.


(Chaudhary) #4

Thanks Jimmy and Moussa ,

I followed the tutorial to install freepbx-distro on google cloud via bucket-- > image—> instance— method. I successfully got the console of server but I’m unable to ssh the server. I’ll be thankful if anyone guides me . thanks.


(Moussa) #5

Make sure you have external IP for your Google cloud project.
Review firewall rules for your Google cloud project.

I usually use the gcloud sdk to access my project from my local machine:
https://cloud.google.com/sdk/install

You can also try the quickstart for your system:
https://cloud.google.com/sdk/docs/quickstarts

Run the following commands in your local machine terminal:

gcloud auth login

gcloud init

gcloud compute ssh your-project


(Chaudhary) #6

Thanks Moussa, I already have project ID on GCP and uploaded VHD file on GCP so I can’t use commands to install SDK. Uploading of vhd file to bucket already took many hours.


(Chaudhary) #7

When i used another method for ssh@server using console port 1 ( i set start-script and in value i put required fields ) but on window machine gets stuck with following details .

serialport: Connected to micro-primer-219913.us-east1-b.freepbxdistro port 1 (session ID: 81ed0760e400310d3d3ee17617cedad56366fbb7, active connections: 1).
SeaBIOS (version 1.8.2-20190710_061750-google)
Total RAM Size = 0x00000000f0000000 = 3840 MiB
2019/8/30 14:19:19 Begin firmware boot time (Seabios)
CPUs found: 1 Max CPUs supported: 1
found virtio-scsi at 0:3
virtio-scsi vendor=‘Google’ product=‘PersistentDisk’ rev=‘1’ type=0 removable=0
virtio-scsi blksize=512 sectors=23068672 = 11264 MiB
drive 0x000f2610: PCHS=0/0/0 translation=lba LCHS=1024/255/63 s=23068672
2019/8/30 14:19:19 End firmware boot time (Seabios)
Booting from Hard Disk 0…


(Moussa) #8

Just to be clear. The steps in [How-to] Install Freepbx distro (with commercial modules) on Google (cloud) Compute Engine are summurized as follow:

  1. Create FreePBX in VirtualBox.
  2. Upload it directly to your project using https://gcp.cloudendure.com/installer_linux.py
  3. Make sure that SSH is working

Can you tell me the steps you made to create your cloud FreePBX project?


(Chaudhary) #9

Thanks Moussa,

I created freepbx virtual machine disk (VHD) on VirtualBox of size 10 GB, removed printer,usb …
Then I uploaded vhd file to Bucket GCP and imported file for image and created instance using the same image on GCP. then i was able to login console of freepbx on browser using its public IP address. but ssh to server machine failed .
that 's all .
Before I tried to use cloudendure but failed to install agent on local machine … that’s why i used above method .


(Moussa) #10

OK, so you are able to get the FreePBX up and running.

The SSH might have failed due to the FreePBX’s Firewall (under Connectivity). If you disable the firewall and intrusion detection (under System Admin) you will see many trying to access your system.

Did you try the login using the gcloud sdk? This will be the safest.

Otherwise, in GCP, VPC Network >> Firewall rules >> Edit HTTP, HTTPS and SSH access to your own IP.

Try accessing the to login console of freepbx on browser using its public IP address and see if it work. If so, then disable the FreePBX’s Firewall and try SSH.


(Chaudhary) #11

yes, freepbx is up and running and on browser it is accessible (Freepbx GUI is OK) .
Now I disabled Intrusion detection system and firewall is already disabled. no luck to ssh the server (CLI) .
There is no firewall issue , I checked even in VPC i already added rule to allow all port and ips and taged that name inside the server after editing .
now i tried SDK it says
HTTPS error NOT found .
It is pertinent to mention i’m not using domain name . I’m using public ip .
very disappointed as i spent many hours for this work .


(Moussa) #12

You may open the server to the internet for testing but will not recommend to keep it open all the time. You will be hacked.

When you created the virtual machine disk (VHD) on VirtualBox did you had the network set as Bridged Adapter?

Did you try the login using the gcloud sdk? I also can not SSH to the server but I can login using the SDK.

Also you can try the steps in [How-to] Install Freepbx distro (with commercial modules) on Google (cloud) Compute Engine using this iso image https://downloads.freepbxdistro.org/ISO/SNG7-FPBX-64bit-1805-2.iso

One thing you may try is Google support. If your account is less than a year old you get free email support.


(Chaudhary) #13

i have network with bridged setting. i already have taken care of it.
I also followed the link to install sdk on local server but no success .
I followed the steps to download and install freepbx distro using the above same links.
nothing i can do but to get support unfortunately.


(Moussa) #14

It is OK. This is part of the learning process. On the positive side, after this is over, you would have learned something new.

If you solve this, please report back here with the solution.


(Chaudhary) #15

thanks for your help .
If i solve it i’ll definitely share with you here. let’s see.


(Chaudhary) #16

Hi Moussa ,
I would like to discuss with you that I don’t know how to download error file ( cloudendure.bin) from cloud to my machine in order to contact GCP team.
I want to try once more time and would like you to please give me some of your moments.
I’ll make new virtualbox machine (call it freepbx-distro) with settings
type: linux , version: other linux 64 bit , memory : 1024 MB , create virtual hard disk now : CREATE ( clicked create button) , VDI : next , dynamic allocated : yes , size = 20 GB , create ( entered) , select disk for boot (freepbx iso) , network : bridged ( hyper-v virtual ethernet adapter #2 is default but there are also other things in drop down list of bridged) , disabled audio & USB controller and serial port (com which is already disabled.) .
Ive currently done above steps If I’m wrong please do the correction . thanks.


(Moussa) #17

That is right. For now use this iso image https://downloads.freepbxdistro.org/ISO/SNG7-FPBX-64bit-1805-2.iso to avoid error in installing the cloudendure agent.


(Chaudhary) #18

Thanks
I got it . Now I’ll repeat the same with your given ISO file. Once the installation is finished I’ll let you know to import vm to GCP .


(Chaudhary) #19

That image (1.8 GB of ubuntu ) worked and i was successful to install agent and migrate to CloudEndure from local running machine. I was also launched target machine and it is running on GCP cloud and ssh to freepbx server is OK .
Now problem is only that I’m unable to access the dashboard on browser using its public address whatsoever it has . I configured rule on VPC (tag) and applied that tag in sever network tag settings. I also turned off firewall in my host system as well as on GCP freepbx server ( via command : service ufw stop) . I don’t know where is problem , why i can’t get the console on browser . thanks.


(Moussa) #20

First, do snapshot for your server. This should take 1-2 minutes.
I thought that the iso was for the distro image. If so, try sudo yum update.
Hope things work fine. Then try reboot
After restart, go to your VM instance >> EDIT >> under Firewalls, check :ballot_box_with_check:︎Allow HTTP traffic and :ballot_box_with_check:︎Allow HTTPS traffic. (Make sure that these rules are active in VPC.)
Save changes
Go back to your VM list, copy the external IP and see if it works