AlexandreDey / ContainerBox

Tool on top of LXD to easily create and use graphical containers
GNU General Public License v3.0
41 stars 7 forks source link

ContainerBox fails if using SNAP version of LXD #3

Closed bmullan closed 6 years ago

bmullan commented 6 years ago

Alexandre

Since going forward LXD will only be delivered as a SNAP package (reference: https://discuss.linuxcontainers.org/t/lxd-3-1-has-been-released/1787) I created a VM of Ubuntu 18.04 and installed the SNAP version LXD and it works fine.

I installed everything else ContainerBox needs according to the README also

Running the install.sh I got the following errors:

/etc/ContainerBox/creator/templates/ubuntu: line 7: /usr/bin/lxc: No such file or directory Waiting for end of init /etc/ContainerBox/creator/templates/ubuntu: line 13: /usr/bin/lxc: No such file or directory /etc/ContainerBox/creator/templates/ubuntu: line 14: /usr/bin/lxc: No such file or directory /etc/ContainerBox/creator/templates/ubuntu: line 48: /usr/bin/lxc: No such file or directory /etc/ContainerBox/creator/templates/ubuntu: line 49: /usr/bin/lxc: No such file or directory /etc/ContainerBox/creator/templates/ubuntu: line 51: /usr/bin/lxc: No such file or directory /etc/ContainerBox/creator/templates/ubuntu: line 52: /usr/bin/lxc: No such file or directory /etc/ContainerBox/creator/templates/ubuntu: line 53: /usr/bin/lxc: No such file or directory /etc/ContainerBox/creator/create: line 16: /usr/bin/lxc: No such file or directory /etc/ContainerBox/creator/create: line 19: /usr/bin/lxc: No such file or directory /etc/ContainerBox/creator/create: line 20: /usr/bin/lxc: No such file or directory /etc/ContainerBox/creator/create: line 23: /usr/bin/lxc: No such file or directory /etc/ContainerBox/creator/create: line 26: /usr/bin/lxc: No such file or directory

I believe the SNAP version of LXD changes the path to /snap/bin/lxc instead of /usr/bin/lxc

Anyway I didn't know if you were aware of the move to the LXD SNAP ...

AlexandreDey commented 6 years ago

Hi,

The lxc path is set in the variable $LXC at the beginning of each script. You need to replace the value of this variable at the begining of each script so that it points to '/snap/bin/lxc' instead of '/usr/bin/lxc'.

Wasn't aware of the comming switch to snap, good to know, thanks !

Before the first version (once GUI and installation from ISO will be done), I will rework the install script so that it adapts to different install locations of the various dependencies.

Alexandre

bmullan commented 6 years ago

Just to document for others using SNAP LXD.

I had to edit the following files in the directory where I downloaded ContainerBox from Github to & change:

LXC=/usr/bin/lxc to LXC=/snap/bin/lxc

in the following files:

./ContainerBox/etc/creator/create ./ContainerBox/etc/creator/templates/ ./ContainerBox/etc/host/config ./ContainerBox/etc/host/start

This will then allow you to run ContainerBox in SNAP LXD.

Your next step would be to execute:

install.sh

AlexandreDey commented 6 years ago

ContainerBox moved to snap version of lxd as of commit 285bd64a47481bf25cdcde60aa935fa488ccc180