Page 1 of 1

[SOLVED with chroot] Older App's with snap?

PostPosted: 2017-12-23 16:00
by bester69
Hi,
I was wondering, can i use snap in order to install some very old linux app's versions.

I was thinking of using a wheezy Virtual machine in order to build the snap's app, so then i can install it in stretch... is this possible?? :roll:


thanks.

Re: Older App's with snap?

PostPosted: 2017-12-23 16:20
by anticapitalista
Try it and let us know how it went.

Re: Older App's with snap?

PostPosted: 2017-12-23 17:57
by stevepusser
Examples?

Wheezy is still maintained and gets security updates, but any older and you will get abandoned library versions with known security holes, and that will happen to Wheezy in six months.

Re: Older App's with snap?

PostPosted: 2017-12-23 18:15
by bester69
stevepusser wrote:Examples?

Wheezy is still maintained and gets security updates, but any older and you will get abandoned library versions with known security holes, and that will happen to Wheezy in six months.


ok, My question, is .. can i install thoses ones in stretch by creating a snap?.. Imagine the scenario when an old app has been abandoned (i.e. an older one than wheezy) and you would like to use it. Snap make use of apparmor isolation, i think there are not big risks.

Re: Older App's with snap?

PostPosted: 2017-12-23 18:49
by deborah-and-ian
can i install thoses ones in stretch by creating a snap?


I think you'll have more luck asking over at the snapcraft forums[1] or just trying to build a snap yourself[2].

[1] https://forum.snapcraft.io/categories
[2] https://docs.snapcraft.io/build-snaps/

Re: Older App's with snap?

PostPosted: 2017-12-23 20:30
by anticapitalista
bester69 wrote:
stevepusser wrote:Examples?

Wheezy is still maintained and gets security updates, but any older and you will get abandoned library versions with known security holes, and that will happen to Wheezy in six months.


ok, My question, is .. can i install thoses ones in stretch by creating a snap?.. Imagine the scenario when an old app has been abandoned (i.e. an older one than wheezy) and you would like to use it. Snap make use of apparmor isolation, i think there are not big risks.


... and again I answer, try it and let us know how it went.

Re: Older App's with snap?

PostPosted: 2017-12-25 11:34
by pcalvert
You may be able to run a small Wheezy system on Stretch inside an LXC container. Just another potential way to solve the problem...

Phil

Re: Older App's with snap?

PostPosted: 2017-12-25 19:01
by bester69
pcalvert wrote:You may be able to run a small Wheezy system on Stretch inside an LXC container. Just another potential way to solve the problem...

Phil

That sound interesting, I will take it a look, Is it easy to deploy?

thanks

Re: Older App's with snap?

PostPosted: 2017-12-25 20:25
by HuangLao
just run wheezy in a VM or chroot and block all internet access to that VM or chroot. Lots of people run old OS's this way, even satellites etc...

Re: Older App's with snap?

PostPosted: 2017-12-26 08:27
by bester69
HuangLao wrote:just run wheezy in a VM or chroot and block all internet access to that VM or chroot. Lots of people run old OS's this way, even satellites etc...

I cant use VM solution, I cant virtualize 64 bits systems....
I didnt know chroot was able to use it in that way, so i can install a wheezy system and then, run wheezy's apps from streetch by using chroot??. I have to test this!!. thanks.

Re: Older App's with snap?

PostPosted: 2017-12-26 09:56
by bester69
bester69 wrote:
HuangLao wrote:just run wheezy in a VM or chroot and block all internet access to that VM or chroot. Lots of people run old OS's this way, even satellites etc...

I cant use VM solution, I cant virtualize 64 bits systems....
I didnt know chroot was able to use it in that way, so i can install a wheezy system and then, run wheezy's apps from streetch by using chroot??. I have to test this!!. thanks.


Ive seen chroot works, thats very cool to play with btrfs's snapshots, I can now run olders apps and some frankendebian apps without having to restore my sytem backup by playing with "chroots the snapshots".

This is very cool!!, you can run several differents versions at the same time. :o

Re: Older App's with snap?

PostPosted: 2017-12-26 12:03
by pcalvert
bester69 wrote:That sound interesting, I will take it a look, Is it easy to deploy?

Not really. Expect to read a bunch of documentation and/or tutorials to get everything working. Even so, I'm not sure how mature LXC is on Debian at present.

Phil

Re: Older App's with snap?

PostPosted: 2017-12-26 13:01
by bester69
pcalvert wrote:
bester69 wrote:That sound interesting, I will take it a look, Is it easy to deploy?

Not really. Expect to read a bunch of documentation and/or tutorials to get everything working. Even so, I'm not sure how mature LXC is on Debian at present.

Phil

ok, THANKS Phill
I tried LXD, but i gave it up, It seems some difficult to deploy, at the moment I will pick chroot solution for my own, Im really delighted with it, i didnt know chroot could work that way.

Ive just installed a Wheezy's VLC/chromium and runned in stretch with chroot and debootstrap; its very easy do implement.
(sudo debootstrap --variant=minbase wheezy tt/ http://ftp.us.debian.org/debian )--> Minimal debian

Re: Older App's with snap?

PostPosted: 2017-12-26 13:16
by Head_on_a_Stick
bester69 wrote:(sudo debootstrap --variant=minbase wheezy tt/ http://ftp.us.debian.org/debian )--> Minimal debian

I like to debootstrap containers into btrfs subvolumes so that they are independently bootable (once a kernel is installed ofc) :)

EDIT: any filesystem trees (including subvolumes) installed under /var/lib/machines/ can be managed via machinectl(1):
Code: Select all
~ $ machinectl --all --no-pager
MACHINE CLASS     SERVICE        OS   VERSION ADDRESSES
.host   host      -              arch -       192.168.1.69...
chroot  container systemd-nspawn arch -       -

2 machines listed.
~ $

EDIT2: that won't work with wheezy though 'cos it doesn't use systemd.

Re: [SOLVED with chroot] Older App's with snap?

PostPosted: 2017-12-26 22:02
by bester69
Any limitation/consideration with running an application within chroot?,

Ive seen some applicactions seems to get problems with dbus and some daemon..I dont know if can run anything..and the properly way to do it; Im mounting like this running kodi16.1 with success in stretch (adding /run/dbus and /dev/shm to typical chroot mount points.):

Running Jessie_kodi 16.1 in Stretch debian with chroot:
run kodi
###run.sh###
Code: Select all
export APP=$1
ruta=/media/jessie
sudo cp /home/myuser/scripts/linux_app.sh $ruta/
#Mount folders
echo /run /sys /proc /dev/pts /dev/shm /dev | xargs -n1 |sudo xargs -I{} umount $ruta/{}
sleep 5
echo /dev /dev/shm /dev/pts /proc /sys /run | xargs -n1 |sudo xargs -I{} mount -o bind {} $ruta/{}
#Launch Script in chroot
sudo chroot $ruta /linux_app.sh $APP
sleep 2
#Exit Umount
echo /run /sys /proc /dev/pts /dev/shm /dev | xargs -n1 |sudo xargs -I{} umount $ruta/{}

###linux_app.sh###
Code: Select all
mount  -t btrfs -o subvol=home /dev/sda2 /home
mount  -t btrfs -o subvol=kodi /dev/sda8 /media/kodi
su myuser -c $1
sleep 5
su myuser -c "pkill -x $1"
sleep 2
su myuser -c "pkill -x $1 -9"
umount -a
su myuser -c "exit"