LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 11-23-2022, 02:09 PM   #1
vesperto
LQ Newbie
 
Registered: Jun 2006
Location: Portugal
Distribution: gentoo and slackware and other(s)
Posts: 28

Rep: Reputation: Disabled
slackware as an LXC container


Greetings,

I'm trying to run slackware64-15 as an LXC container in a gentoo host. It always fails with:
Code:
# lxc-create --name slack02 --template=slackware
/usr/share/lxc/templates/lxc-slackware: line 717: type: slackpkg: not found
'slackpkg' command is missing.
which makes sense, since i don't have slackpkg installed in gentoo. (I know it'll pull down debootstrap if i install Debian templates.)

So can i just grab slackpkg from the mirrors? I have no container's rootfs yet, so where do i put it?


[In another incarnation i installed slackware as a kvm/qemu vm, loopmounted the file-based .img, copied it to rootfs/ and gave it a go but it's using the host's init (OpenRC) instead of the container's (sysv).]
 
Old 11-23-2022, 03:18 PM   #2
slac-in-the-box
Member
 
Registered: Mar 2010
Location: oregon
Distribution: slackware64-15.0 / slarm64-current
Posts: 780
Blog Entries: 1

Rep: Reputation: 432Reputation: 432Reputation: 432Reputation: 432Reputation: 432
Code:
echo $PATH
displays a colon separated list of directories where your system looks for executable programs. Putting slackpkg in one of those directories will allow it to be found when executed by the lxc script... If slackpkg needs something that is located in a different path on gentoo than where it would be on slackware, you might have to create some symbolic links to help slackpkg find the gentoo resource.

Last edited by slac-in-the-box; 11-23-2022 at 03:20 PM.
 
Old 11-23-2022, 03:40 PM   #3
LuckyCyborg
Senior Member
 
Registered: Mar 2010
Posts: 3,550

Rep: Reputation: 3404Reputation: 3404Reputation: 3404Reputation: 3404Reputation: 3404Reputation: 3404Reputation: 3404Reputation: 3404Reputation: 3404Reputation: 3404Reputation: 3404
Quote:
Originally Posted by vesperto View Post
Greetings,

I'm trying to run slackware64-15 as an LXC container in a gentoo host. It always fails with:
Code:
# lxc-create --name slack02 --template=slackware
/usr/share/lxc/templates/lxc-slackware: line 717: type: slackpkg: not found
'slackpkg' command is missing.
which makes sense, since i don't have slackpkg installed in gentoo. (I know it'll pull down debootstrap if i install Debian templates.)

So can i just grab slackpkg from the mirrors? I have no container's rootfs yet, so where do i put it?


[In another incarnation i installed slackware as a kvm/qemu vm, loopmounted the file-based .img, copied it to rootfs/ and gave it a go but it's using the host's init (OpenRC) instead of the container's (sysv).]
I do not think that /usr/share/lxc/templates/lxc-slackware is supposed to be used in a Gentoo Linux operating system.

Because it uses the Slackware package tools, slackpkg or installpkg, etc. So, I believe that's supposed to be used in a Slackware host.

Anyway, I will never understand why people refuses to understand that the LXC containers aren't virtual machines and why they insists to run CentOS under Slackware or Slackware under Gentoo, as LXC containers...

Last edited by LuckyCyborg; 11-23-2022 at 03:59 PM.
 
1 members found this post helpful.
Old 11-24-2022, 03:42 PM   #4
vesperto
LQ Newbie
 
Registered: Jun 2006
Location: Portugal
Distribution: gentoo and slackware and other(s)
Posts: 28

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by slac-in-the-box View Post
Code:
echo $PATH
displays a colon separated list of directories where your system looks for executable programs. Putting slackpkg in one of those directories will allow it to be found when executed by the lxc script... If slackpkg needs something that is located in a different path on gentoo than where it would be on slackware, you might have to create some symbolic links to help slackpkg find the gentoo resource.
So i tried:
Code:
# PATH=/mnt/slack/bin:/mnt/slack/sbin:/mnt/slack/usr/sbin:/mnt/slack/usr/bin:${PATH} lxc-create --name slack07 --template=slackware
with /mnt/slack being the loopmounted .img file from the vm i had previously created. But then i got
Code:
cat: /etc/slackware-version: No such file or directory
so i guess there's more to it, like LuckyCyborg implied.
 
Old 11-24-2022, 03:46 PM   #5
vesperto
LQ Newbie
 
Registered: Jun 2006
Location: Portugal
Distribution: gentoo and slackware and other(s)
Posts: 28

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by LuckyCyborg View Post
I do not think that /usr/share/lxc/templates/lxc-slackware is supposed to be used in a Gentoo Linux operating system.

Because it uses the Slackware package tools, slackpkg or installpkg, etc. So, I believe that's supposed to be used in a Slackware host.

Anyway, I will never understand why people refuses to understand that the LXC containers aren't virtual machines and why they insists to run CentOS under Slackware or Slackware under Gentoo, as LXC containers...
You can create other OS images, especially Debian-based, just fine. It's a bit akward that the slackware template distributed by gentoo was created to run on a slackware host (but i'll look into that).
Trying the same ina Devuan host yields the same result, so it may be packaging related.

I'd explain why i want a different host OS but it's besides the point.

Care to suggest reading material as to how to create a slackware template?
 
Old 11-24-2022, 04:35 PM   #6
slac-in-the-box
Member
 
Registered: Mar 2010
Location: oregon
Distribution: slackware64-15.0 / slarm64-current
Posts: 780
Blog Entries: 1

Rep: Reputation: 432Reputation: 432Reputation: 432Reputation: 432Reputation: 432
Quote:
Originally Posted by vesperto;6394173.

Care to suggest reading material as to how to create a slackware template?
The slackware template itself is good reading material: it is basically just a list of everything that needs to happen.

Last edited by slac-in-the-box; 11-24-2022 at 05:17 PM. Reason: added closing quote bracket
 
2 members found this post helpful.
Old 11-24-2022, 05:11 PM   #7
slac-in-the-box
Member
 
Registered: Mar 2010
Location: oregon
Distribution: slackware64-15.0 / slarm64-current
Posts: 780
Blog Entries: 1

Rep: Reputation: 432Reputation: 432Reputation: 432Reputation: 432Reputation: 432
Quote:
Originally Posted by vesperto View Post
So i tried:
Code:
# PATH=/mnt/slack/bin:/mnt/slack/sbin:/mnt/slack/usr/sbin:/mnt/slack/usr/bin:${PATH} lxc-create --name slack07 --template=slackware
with /mnt/slack being the loopmounted .img file from the vm i had previously created. But then i got
Code:
cat: /etc/slackware-version: No such file or directory
so i guess there's more to it, like LuckyCyborg implied.
well, presuming that you did not chroot into /mnt/slac, your "cat /etc/slackware-version" was looking in gentoo's /etc: root (/) is gentoo host, + etc, takes you to gentoo's /etc. to get to slackware's the way you have it mounted you would have to try
Code:
cat /mnt/slac/etc/slackware-version
To install onto gentoo host, slackware packages, you can use Pat's installpkg script at /sbin/installpkg (on a slackware system, so at /mnt/slac/sbin/installpkg the way you have it setup)... you could download slackpkg from nearby mirror and install it with that installpkg script.

You have to install slackpkg on gentoo since the template is using it.
Or you can manually download your slackware directory tree on the gentoo host, and then modify the slackware-lxc template to use the installpkg script to install the same packages in the template's list of packages...

I have only used lxc to mirror an all slackware bare-metal network stack comprised of a dozen servers, for sandbox and study without having to have separate machines in sandbox for every bare metal machine in the stack... exeperiment in lxc, and then put into bare metal production, but all is slackware, and not mixed os host/client lxc setup, so LuckyCyborg is right in caution, and it might not be stable... But linux is linux, and its amazing, and you'll probably get it going with a few tweaks to gentoo.

Last edited by slac-in-the-box; 11-24-2022 at 05:19 PM.
 
1 members found this post helpful.
Old 10-24-2023, 10:18 AM   #8
camerabambai
Member
 
Registered: Mar 2010
Distribution: Slackware
Posts: 408

Rep: Reputation: 54
A good news, Slackware container now available from lxc image repository

Code:
lxc-create --name name -t download

....
oracle	7	amd64	default	20231024_07:46
oracle	7	arm64	default	20231024_08:12
oracle	8	amd64	default	20231024_07:46
oracle	8	arm64	default	20231024_08:13
oracle	9	amd64	default	20231024_07:46
oracle	9	arm64	default	20231024_08:23
plamo	7.x	amd64	default	20231024_01:33
plamo	8.x	amd64	default	20231024_01:33
rockylinux	8	amd64	default	20231024_02:06
rockylinux	8	arm64	default	20231024_02:06
rockylinux	9	amd64	default	20231024_02:06
rockylinux	9	arm64	default	20231024_02:06
slackware	15.0	amd64	default	20231023_23:08
slackware	current	amd64	default	20231023_23:08
..
 
6 members found this post helpful.
Old 02-02-2024, 09:37 AM   #9
andrixnet
Member
 
Registered: Oct 2012
Location: Romania
Distribution: Slackware
Posts: 167

Rep: Reputation: Disabled
But how can one obtain a single file downloadable URL for a template to be used in ProxmoxVE?
 
1 members found this post helpful.
Old 02-02-2024, 09:37 AM   #10
andrixnet
Member
 
Registered: Oct 2012
Location: Romania
Distribution: Slackware
Posts: 167

Rep: Reputation: Disabled
But how can one obtain a single file downloadable URL for a template to be used in ProxmoxVE?
 
1 members found this post helpful.
  


Reply

Tags
container, lxc, slackware, virtualization



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] File lxc-slackware in package lxc needs updated drumz Slackware 7 11-13-2021 02:13 PM
Slackware-current, migration from LXC 2 to LXC 4 petejc Slackware 4 08-31-2021 01:54 PM
[SOLVED] "lxc list" vs "lxc-ls" yknivag Linux - Virtualization and Cloud 1 03-09-2017 05:53 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 03:58 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration