Package-check usage in a virtual machine?!?

I would like to use package-check without to install it on my main system…

First i tried to install/run it via github actions: https://github.com/YunoHost-Apps/pyinventory_ynh/pull/22 but this doesn’t work, because debian is not available and ubuntu doesn’t work:

image

Crosspost: https://github.com/YunoHost/package_check/issues/93

So i tried to use it in a docker container. But it seems not to work. Maybe LXC isn’t useable in Docker?

I have a local proxmox server running. So i created a fresh debian buster LXC container.

Install doesn’t look good:

jens@ynh-package-check:~/package_check$ ./sub_scripts/lxc_build.sh 
> Update et install lxc lxctl
> Install git, curl and lynx
> Création d'une machine debian buster minimaliste.
> Autoriser l'ip forwarding, pour router vers la machine virtuelle.
> Ajoute un brige réseau pour la machine virtualisée
> Active le bridge réseau
> Configuration réseau du conteneur
./sub_scripts/lxc_build.sh: line 119: lsb_release: command not found
./sub_scripts/lxc_build.sh: line 119: [: !=: unary operator expected
> Configuration réseau de la machine virtualisée
> Configure le parefeu
> Vérification du contenu du resolv.conf
nameserver 192.168.6.1
./sub_scripts/lxc_build.sh: line 145: lsb_release: command not found
./sub_scripts/lxc_build.sh: line 145: [: !=: unary operator expected
> Démarrage de la machine
> Test la configuration dns
>>> The dns isn't working (Current dns = 192.168.6.1)
>>>Force to use the default dns
>>> Try to use the dns address 
>>> The dns isn't working (Current dns = )
>>>Force to use the dns from the config file
nameserver 192.168.6.1
>>> Try to use the dns address 192.168.6.1
>>> The dns isn't working (Current dns = 192.168.6.1)
>>>The dns is still broken, use FDN dns
nameserver 80.67.169.12
>>> Try to use the dns address 192.168.6.1
> Update et install aptitude sudo git
lxc-attach: pchecker_lxc: attach.c: lxc_attach: 1095 Failed to get init pid
lxc-attach: pchecker_lxc: attach.c: lxc_attach: 1095 Failed to get init pid
> Installation des paquets standard et ssh-server
lxc-attach: pchecker_lxc: attach.c: lxc_attach: 1095 Failed to get init pid
> Renseigne /etc/hosts sur l'invité
> Ajoute l'user pchecker
> Autorise pchecker à utiliser sudo sans mot de passe
> Mise en place de la connexion ssh vers l'invité.
write (10.1.4.2): No route to host
write (10.1.4.2): No route to host
write (10.1.4.2): No route to host
ssh: connect to host 10.1.4.2 port 22: No route to host
ssh: connect to host 10.1.4.2 port 22: No route to host
> Installation de Yunohost...
ssh: connect to host 10.1.4.2 port 22: No route to host
> Disable apt-daily to prevent it from messing with apt/dpkg lock
lxc-attach: pchecker_lxc: attach.c: lxc_attach: 1095 Failed to get init pid
lxc-attach: pchecker_lxc: attach.c: lxc_attach: 1095 Failed to get init pid
lxc-attach: pchecker_lxc: attach.c: lxc_attach: 1095 Failed to get init pid
lxc-attach: pchecker_lxc: attach.c: lxc_attach: 1095 Failed to get init pid
lxc-attach: pchecker_lxc: attach.c: lxc_attach: 1095 Failed to get init pid
lxc-attach: pchecker_lxc: attach.c: lxc_attach: 1095 Failed to get init pid
lxc-attach: pchecker_lxc: attach.c: lxc_attach: 1095 Failed to get init pid
lxc-attach: pchecker_lxc: attach.c: lxc_attach: 1095 Failed to get init pid
lxc-attach: pchecker_lxc: attach.c: lxc_attach: 1095 Failed to get init pid
lxc-attach: pchecker_lxc: attach.c: lxc_attach: 1095 Failed to get init pid
> Post install Yunohost
ssh: connect to host 10.1.4.2 port 22: No route to host
ssh: connect to host 10.1.4.2 port 22: No route to host
ssh: connect to host 10.1.4.2 port 22: No route to host
> Ajout du sous domaine de test
ssh: connect to host 10.1.4.2 port 22: No route to host
> Ajout de l'utilisateur de test
ssh: connect to host 10.1.4.2 port 22: No route to host

> Vérification de l'état de Yunohost
ssh: connect to host 10.1.4.2 port 22: No route to host
> Arrêt de la machine virtualisée
> Suppression des règles de parefeu
> Création d'un snapshot

Maybe LXC in LXC doesn’t work, too?
I will try a installation in a proxmox debian buster VM (QEMU/KVM not LXC)…

I guess first you should try to fix this :

./sub_scripts/lxc_build.sh: line 119: lsb_release: command not found

by trying to apt install lsb-release

I will try it and created a PR to install this via lxc_build.sh: https://github.com/YunoHost/package_check/pull/94

After install it looks now:

jens@ynh-package-check:~$ ./package_check/sub_scripts/lxc_build.sh 
> Update et install lxc lxctl
> Install git, curl and lynx
> Suppression du conteneur existant.
lxc-destroy: pchecker_lxc: tools/lxc_destroy.c: main: 271 Destroyed container pchecker_lxc
> Création d'une machine debian buster minimaliste.
> Autoriser l'ip forwarding, pour router vers la machine virtuelle.
> Ajoute un brige réseau pour la machine virtualisée
> Active le bridge réseau
> Configuration réseau du conteneur
> Configuration réseau de la machine virtualisée
> Configure le parefeu
> Vérification du contenu du resolv.conf
nameserver 192.168.6.1
> Démarrage de la machine
> Test la configuration dns
>>> The dns isn't working (Current dns = 192.168.6.1)
>>>Force to use the default dns
>>> Try to use the dns address 
>>> The dns isn't working (Current dns = )
>>>Force to use the dns from the config file
nameserver 192.168.6.1
>>> Try to use the dns address 192.168.6.1
>>> The dns isn't working (Current dns = 192.168.6.1)
>>>The dns is still broken, use FDN dns
nameserver 80.67.169.12
>>> Try to use the dns address 192.168.6.1
> Update et install aptitude sudo git
lxc-attach: pchecker_lxc: attach.c: lxc_attach: 1095 Failed to get init pid
lxc-attach: pchecker_lxc: attach.c: lxc_attach: 1095 Failed to get init pid
> Installation des paquets standard et ssh-server
lxc-attach: pchecker_lxc: attach.c: lxc_attach: 1095 Failed to get init pid
> Renseigne /etc/hosts sur l'invité
> Ajoute l'user pchecker
> Autorise pchecker à utiliser sudo sans mot de passe
> Mise en place de la connexion ssh vers l'invité.
Host 10.1.4.2 not found in /home/jens/.ssh/known_hosts
write (10.1.4.2): No route to host
write (10.1.4.2): No route to host
write (10.1.4.2): No route to host
ssh: connect to host 10.1.4.2 port 22: No route to host
ssh: connect to host 10.1.4.2 port 22: No route to host
> Installation de Yunohost...
ssh: connect to host 10.1.4.2 port 22: No route to host
> Disable apt-daily to prevent it from messing with apt/dpkg lock
lxc-attach: pchecker_lxc: attach.c: lxc_attach: 1095 Failed to get init pid
lxc-attach: pchecker_lxc: attach.c: lxc_attach: 1095 Failed to get init pid
lxc-attach: pchecker_lxc: attach.c: lxc_attach: 1095 Failed to get init pid
lxc-attach: pchecker_lxc: attach.c: lxc_attach: 1095 Failed to get init pid
lxc-attach: pchecker_lxc: attach.c: lxc_attach: 1095 Failed to get init pid
lxc-attach: pchecker_lxc: attach.c: lxc_attach: 1095 Failed to get init pid
lxc-attach: pchecker_lxc: attach.c: lxc_attach: 1095 Failed to get init pid
lxc-attach: pchecker_lxc: attach.c: lxc_attach: 1095 Failed to get init pid
lxc-attach: pchecker_lxc: attach.c: lxc_attach: 1095 Failed to get init pid
lxc-attach: pchecker_lxc: attach.c: lxc_attach: 1095 Failed to get init pid
> Post install Yunohost
ssh: connect to host 10.1.4.2 port 22: No route to host
ssh: connect to host 10.1.4.2 port 22: No route to host
ssh: connect to host 10.1.4.2 port 22: No route to host
> Ajout du sous domaine de test
ssh: connect to host 10.1.4.2 port 22: No route to host
> Ajout de l'utilisateur de test
ssh: connect to host 10.1.4.2 port 22: No route to host

> Vérification de l'état de Yunohost
ssh: connect to host 10.1.4.2 port 22: No route to host
> Arrêt de la machine virtualisée
> Suppression des règles de parefeu
> Création d'un snapshot

Any advice?

Merp …

lxc-attach: pchecker_lxc: attach.c: lxc_attach: 1095 Failed to get init pid

sounds like the container did not properly start … Would need to dig in to understand why …

Though I’m personally working since a few days on a big rework of the entire package_check scripts, and among other things will now be based on lxd instead of lxc, which imho is much less tedious to configure (c.f. the current scripts managing the lxc that need to handle the entire network configuration by hand and test if the DNS is working etc…)

Alternatively you could just come to the app packaging chat room and ask for an access to the dev CI where you’ll be able to submit jobs (you just need to provide us with an SSH key)

Though of course one should be able to selfhost package_check …

Think i will wait until the refactory will land…

In the end it would be great if everyone can easy setup this own CI instance, just by install package_check_ynh on a own Yunohost instance… As i written here: https://github.com/YunoHost/issues/issues/1694#issuecomment-747277930