linux, SIP, Uncategorized, virtualization, VoIP

Install FreePBX 13 in the cloud using VirtualBox and dd

What you will need before you begin.

  1. A copy of the Finnix ISO
  2. You will need to install Virtualbox
  3. You will need your copy of FreePBX10

Lets Get Started With Our Virtual Machine

  1. Load VirtualBox and select the “New” button
  2. Name your virtual machine “FreePBX10”, Select Linux as “Type”, and set “Version” to Centos
  3. Set RAM and the hard drive size for your virtual machine. Since we are moving all of this over to your Linode your drive will need to be as small as you can make it. My FreePBX install ends up being about 3.5 Gigs, so I made my drive 4 Gigs total.
  4. Once your is VM is fully installed go ahead and right click it and click on “Settings”. Go To the “Storage” tab and select the IDE disk device which will say that it is empty. Click the disk icon and select “Choose a virtual CD/DVD disk file”. This is where you go ahead and choose the FreePBX 10 ISO that you downloaded. Think of this like loading a Live CD.
  5. In the VirtualBox main window, select your VM and click on “Start”. Write down the device and partition you install to.

Getting Started With Your Linode

  1. From the Linode manager Select  “create a new Linode”. Under the “Disks” section of the Linode Dashboard, click on “Create a new Disk”.
  2. Label this disk and choose a size for it. I set mine to 20 Gigs because I plan to do a lot of sales calls with the PBX. Leave the type as ext4. Once you finish up select “Save Changes”
  3. Make a swap disk here if you like.
  4. Select “Create a new Configuration Profile” . You will need to assign a Label. You will need to set your drives under the “Block Device Assignment” section. If you use anything other then /dev/sda for your root device you will need to update this information under “Root / boot device”
  5. Click on “Save Changes”
  6. Go back to the Linode main dashboard , and select “Rescue” from the tabs at the top. From here click the “Reboot into Rescue Mode” to boot into the Finnix recovery image. Use the Lish shell to access the Linode console. This console can be found under the “Remote Access” area
  7. Issue the commands “passwd” and then “service ssh start”.This sets the password on Finnix and lunches the SSH server for you to connect to your Linode.

Copying Over The Disk Image

  1. Shutdown your VM . Use command “shutdown -h now” or via the VirtualBox interface.
  2. You need to revisit you virtual machine “Storage” tab. Under “Controller: IDE”  Select the IDE desk device then find the CD disc icon and select it. Choose again the “Choose a virtual CD/DVD disk file” and choose your local Finnix copy.
  3. Restart your VM booting into the the Finnix ISO.
  4. Check what partitions you are dealing with on your VM by running “ls /dev/sd*
  5. Copy your system partition to your Linodes disk. Replace /dev/sda1 with your partition. Use your IP address, Change /dev/sda to your Linodes drive. The command is as follows dd if=/dev/sda1 | pv | ssh [email protected]″dd of=/dev/sda” . On my install I had to grab the sda2 partition from the VM to copy the the Linode
  6. Set back this could take a little time.

Set Up Your Linode

    1. Run “mount /dev/sda
    2. Open up /media/sda/etc/fstab and use the following fstab contents.
# /etc/fstab
# Created by anaconda on Thu Jul 28 20:57:44 2016
#
# Accessible filesystems, by reference, are maintained under '/dev/disk'
# See man pages fstab(5), findfs(8), mount(8) and/or blkid(8) for more info
#
/dev/sda                 /                   ext4    noatime,errors=remount-ro        0 1
/dev/sda                /boot               ext4    defaults        1 2
/dev/sdb                swap                swap    defaults        0 0
tmpfs                   /dev/shm            tmpfs   defaults        0 0
devpts                  /dev/pts            devpts  gid=5,mode=620  0 0
sysfs                   /sys                sysfs   defaults        0 0
proc                    /proc               proc    defaults        0 0
  1. Unlink the resolv.conf file by running the following commands.
  2. unlink /media/sda/etc/resolv.conf echo “# resolv.conf – DNS resolver configuration file” > /media/sda/etc/resolv.conf echo “options rotate” > /media/sda/etc/resolv.conf.tail
  3. Reboot your Linode.

Configure Your Network Interfaces

You will notice that you do not have a connection to the Internet at this point. We will have to configure the network interfaces to point to eth1.

    1. First open up “vim /etc/udev/rules.d/70-persistent-net.rules”
    2. Comment out the first line starting with SUBSYSTEM
    3. Allow the line that looks like the following to stay this is your Linode network interface that auto populated.

# PCI device 0x1af4:0x1000 (virtio-pci) (custom name provided by external tool)
SUBSYSTEM==”net”, ACTION==”add”, DRIVERS==”?*”, ATTR{address}==”f2:3c:94:79:b2:2
5″, ATTR{type}==”1″, KERNEL==”eth*”, NAME=”eth0″

  1. Copy the MAC address out of your configuration .Mine is f2:3c:94:79:b2:25 for this example.
  2. Go edit /etc/sysconfig/network/ifcfy-eth0 with the following for the HWADDR value you just copied. (f2:3c:94:79:b2:25)
  3. Reboot

Now have some pbx fun!

Leave a Reply