Is it possible to install SangomaOS in lxd container?

Hi every one, i looking for options to install sangomaOS in LXD container. Can anyone help me with this initiative.

after a little search in the forum I came across this topic Lxd-p2c Sangoma 7 Distro (FreePBX) migration help - #4 by Duli but apparently the script is already running. and i want to ask if there is another option in which we can make a container from an existing machine or a virtual machine. or to install directly from an iso file.

Apparently, you haven´t read the post you have linked to.

It explicitly says you can create a SangomaOS lxc container from a virtual machine running SangomaOS:

And so on…

oh, my mistake, maybe when composing the post, I apologize for that. I read the post But just to ask did you try to open the link in the post to the script http://github.com/lxc/lxd/lxd-p2c

I read the post but this method is old and script not existing now have lxd-migrate but its work only on ubuntu OS. My question is what is actual method to migrate vm SangomaOS to LXD. its have any documentation ? Which tool can i use ?

Yes, I think lxd-p2c is no longer maintained. You should give lxd-migrate a try.

I´m sorry. I don´t know any other method for doing it.

Does this require any kernel modules?

I think not

Yes lxd-migrate should work here.

finally had time to play around with lxd-migrate and the new ./bin.linux.lxd-migrate script following the steps from here
Linux Containers - LXD - Has been moved to Canonical
but after migrating it i have the following problem
lxc exec freepbx bash

Exception: SQLSTATE[HY000] [2002] Connection refused::SQLSTATE[HY000] [2002] Connection refused in file /var/www/html/admin/libraries/utility.functions.php on line 120

Caused by
PDOException: SQLSTATE[HY000] [2002] Connection refused in file /var/www/html/admin/libraries/BMO/Database.class.php on line 144
Stack trace:

  1. Exception->() /var/www/html/admin/libraries/utility.functions.php:120
  2. die_freepbx() /var/www/html/admin/libraries/BMO/Database.class.php:150
  3. PDOException->() /var/www/html/admin/libraries/BMO/Database.class.php:144
  4. PDO->__construct() /var/www/html/admin/libraries/BMO/Database.class.php:144
  5. FreePBX\Database->__construct() /var/www/html/admin/libraries/BMO/FreePBX.class.php:77
  6. FreePBX->__construct() /var/www/html/admin/bootstrap.php:144
  7. require_once() /etc/freepbx.conf:11
  8. include_once() /var/lib/asterisk/bin/fwconsole:12
    Exception: SQLSTATE[HY000] [2002] Connection refused::SQLSTATE[HY000] [2002] Connection refused in file /var/www/html/admin/libraries/utility.functions.php on line 120

Caused by
PDOException: SQLSTATE[HY000] [2002] Connection refused in file /var/www/html/admin/libraries/BMO/Database.class.php on line 144
Stack trace:

  1. Exception->() /var/www/html/admin/libraries/utility.functions.php:120
  2. die_freepbx() /var/www/html/admin/libraries/BMO/Database.class.php:150
  3. PDOException->() /var/www/html/admin/libraries/BMO/Database.class.php:144
  4. PDO->__construct() /var/www/html/admin/libraries/BMO/Database.class.php:144
  5. FreePBX\Database->__construct() /var/www/html/admin/libraries/BMO/FreePBX.class.php:77
  6. FreePBX->__construct() /var/www/html/admin/bootstrap.php:144
  7. require_once() /etc/freepbx.conf:11
  8. include_once() /var/lib/asterisk/bin/fwconsole:12
    [root@freepbx ~]#
    [root@freepbx ~]# systemctl start mysql
    Failed to get D-Bus connection: No such file or directory
    [root@freepbx ~]#

If anyone can help I would be grateful

host LXD ubuntu 22.04 installed with snap lxd version 5.10

this is from log of container

lxc freepbx7 20230523140549.865 ERROR conf - …/src/src/lxc/conf.c:turn_into_dependent_mounts:3948 - No such file or directory - Failed to recursively turn old root mount tree into dependent mount. Continuing…

After a long time, I finally found a solution to a problem that actually turned out to be in the host server and directly in cgroup2. Ubuntu 22.04 uses cgroup2 which is actually where my server is.
Running older container operating systems on more modern host systems that use CGroupV2 can cause this error.

To resolve the issue, you must boot your host system in CGroupV1 mode by changing your kernel boot arguments to include:

systemd.unified_cgroup_hierarchy=0

this is done as follows:
add the following string

systemd.unified_cgroup_hierarchy=0

to the

GRUB_CMDLINE_LINUX

line in

/etc/default/grub

like this

and then run

sudo update-grub

1 Like

Yes, it is possible and work perfectly !

to make this project i used the script from here

https://github.com/lxc/lxd/releases/download/lxd-5.13/bin.linux.lxd-migrate

I followed the directions from here

Linux Containers - LXD - Has been moved to Canonical

and after a few minutes I had a container that started with a problem, this problem is explained how to solve it in post 10

1 Like