*New 12.1 series Release:
2020-04-05: XigmaNAS 12.1.0.4.7509 - released

*New 11.3 series Release:
2020-04-05: XigmaNAS 11.3.0.4.7509 - released!


We really need "Your" help on XigmaNAS https://translations.launchpad.net/xigmanas translations. Please help today!

Producing and hosting XigmaNAS costs money. Please consider donating for our project so that we can continue to offer you the best.
We need your support! eg: PAYPAL

[EXTENSION] Bastille Manager, Yet another user friendly jail manager!

XigmaNAS Extensions / Add-ons

Moderator: crest

Forum rules
Set-Up GuideFAQsForum Rules
User avatar
JoseMR
Hardware & Software Guru
Hardware & Software Guru
Posts: 1050
Joined: 16 Apr 2014 04:15
Location: PR
Contact:
Status: Offline

[EXTENSION] Bastille Manager, Yet another user friendly jail manager!

#1

Post by JoseMR »

A ZERO dependency Jail/Container Manager Extension for XigmaNAS.
Containers creation and management the easy way!

Bastille Home
Bastille on GitHub
Bastille Manager Extension on GitHub
Help with Translations

Basic Features
  • Quick basic Jail creation and management.
    Thin Jail creation by default saves disk space and easy to backup.
    Quickly base upgrade/change on thin containers.
    Thick Jail creation option for fully independent containers.
    Jail quick rename ability.
    Jail images export and import.
    Jail conversion from Thinjail to Thickjail.
    Zero dependencies, Jails are lightweight, Bastille is too.
    The Extension can run as either with the WebGUI or CLI only.
    The WebGUI reads Jail data on real-time, CLI changes are reflected in the WebGUI instantly.
    Non tied WebGUI, a possible PHP future incompatibility wont stop your Jails from running normally.
    Built-in text editor for flexible jail.conf and related configuration files adjustment.
    Built-in Container backup and restore within the WebGU(see export/import).
Advanced Features
  • Full ZFS support for granular management and portability(more on this here).
    Template support, create and share Jail templates(CLI for now).
    Read-only root, confining the root user.
    Isolated Networks, secure Jails behind the firewall(Advanced).
    Target Multiple Jails, Execute commands inside one, few, or many Jails(Advanced).
Most of the above features may requires Bastille 0.6x or later, new installs always get latest, but existing users can use the WebGUI to upgrade or simply execute `bastille-init -x` to re-fetch latest files and configure it.

This extension can be easily installed with the OneButtonInstaller

CHANGELOG

Dashboard:
Live_Dashboard.png

More screenshots(outdated):
Extension_Usage.png

Minimum supported platforms version is 11.2 x64:
Bastille_Container_Manager.png

How to install:
Create a directory(or a ZFS dataset, advanced) called "bastille" with 750 perms in any permanent data location, then CD into it and execute the fetch command like shown in the example below:

Code: Select all

mkdir -p -m 0750 /mnt/Data/extensions/bastille
cd /mnt/Data/extensions/bastille
Then execute the install command below to start the automated setup:

Code: Select all

fetch --no-verify-peer https://raw.githubusercontent.com/JRGTH/xigmanas-bastille-extension/master/bastille-init && chmod +x bastille-init && ./bastille-init && echo "=> Done!"
After that you can start creating jails from either the WebGUI or the shell, you may need to type "rehash" once to register "bastille" command under csh.

Extension usage:

Code: Select all

xigmanas: ~# bastille-init -h
Usage: bastille-init -[option] | [container]
Options:
        -s  Start All Bastille Containers.
        -p  Stop All Bastille Containers.
        -r  Restart All Bastille Containers.
        -u  Upgrade Bastille/Extension packages.
        -v  Display product versions.
        -g  Enables the addon GUI.
        -t  Disable the addon GUI.
        -B  Backup a Bastille container.
        -R  Restore a Bastille container.
        -Z  Activate ZFS for Bastille Extension.
        -x  Reset Bastille/Extension config.
        -U  Uninstall Bastille (Extension files only).
        -h  Display this help message.

Advanced Usage: bastille-init [option] [container] [release] | [newrelease]
Options:
        update|--update  Update a container to base -pX release.
        upgrade|--upgrade  Upgrade a container release to X.Y-RELEASE.

Note: Thick containers update/upgrade may depend on securelevel/allow.chflags.
xigmanas: ~#
Note: The extension can be used as either with the easy click and create WebGUI, or as a simple command line utility when the WebGUI is disabled, since the WebGUI read data on real-time, changes made on CLI will also be reflected in the WebGUI as well wen turned on.

===============================================================
Networking:
The extension default behavior is to pick the first active local network interface to quickly start creating shared IP based jails(non vnet) for standard usage, but advanced users can directly edit the config files with the built-in editor for their special networking needs.

Storage:
The extension default behavior is to create standard jails in its permanent extension location, but advanced ZFS users can also edit "bastille.conf" to set the desired ZFS options regarding their needs before bastille first base release boostrap.

Packages:
This extension does not use pkg tool to install bastille, it fetch directly from the Bastille devel GitHub master repository so the user will always get the latest bastille fixes and features for convenience.

Jail types:
Thin* jails or compact jails uses the basejail concept based on nullfs mounts and a single FreeBSD base release can be shared across multiples containers, they use low space initially.

Thick** jails or full jails uses a complete FreeBSD base release distribution, they use more space unlike thin jails but are self contained.

*The term "Thin" used here may also refers to the basejail concept based on nullfs mounts.
**The term "Thick" used here may also refers to Full self contained jails/containers.

Credits and Thanks:
Credits to Michael Zoon, Michael Schneider and the XigmaNAS Development Team for keep this project alive and forward.

Special thanks:
Thanks to crest for the great support and help on the make of extensions, thanks to Christer Edwards for the BastilleBSD development and bmac2 for the Bastille Templates development.

Disclaimer: This Extension is provided AS-IS, and I'm NOT responsible for any data loss or damage caused by the use of it, use solely at your own risk.

Regards
You do not have the required permissions to view the files attached to this post.
System: FreeBSD 12 RootOnZFS Mirror, MB: Supermicro X8SI6-F, Xeon X3450, 16GB DDR3 ECC RDIMMs.
XigmaNAS RootOnZFS
Addons at GitHub
BastilleBSD
Boot Environments Intro
Resources Home Page

cookiemonster
Advanced User
Advanced User
Posts: 221
Joined: 23 Mar 2014 02:58
Location: UK
Status: Offline

Re: Bastille Jail/Container Manager Extension

#2

Post by cookiemonster »

Whoa! I don't know how I managed to miss this. It is really good to see another innovation in XigmaNAS for jails. Thebrig is such a fantastic functionality but has been in need for attention in a while, so I look forward to seeing Bastille perhaps addressing it.
Is the intention to bring it on par with thebrig JoseMR, or is completely different roadmap for it?
Main: Xigmanas 11.2.0.4 x64-full-RootOnZFS on Supermicro X8DT3. zroot on mirrorred pair of CRUCIAL_CT64M225. Memory: 72GB ECC; 2 Xeon E5645 CPUs; Storage: (HBA) - LSI SAS 9211-4i with 3 SATA x 1 Tb in raidZ1, 1 x 3 Tb SAS drive as single stripe.
Spare1: HP DL580 G5; 128 GB ECC RAM; 4 CPU; 8 x 500 GB disks on H210i
Spare2: HP DL360 G7; 6 GB ECC RAM; 1 Xeon CPU; 5 x 500 GB disks on H210i
Spare3: HP DL380 G7; 24 GB ECC RAM; 2 Xeon E5645 CPUs; 8 x 500 GB disks on IBM M1015 flashed to LSI9211-IT

User avatar
JoseMR
Hardware & Software Guru
Hardware & Software Guru
Posts: 1050
Joined: 16 Apr 2014 04:15
Location: PR
Contact:
Status: Offline

Re: Bastille Jail/Container Manager Extension

#3

Post by JoseMR »

cookiemonster wrote:
13 Oct 2019 18:29
Whoa! I don't know how I managed to miss this. It is really good to see another innovation in XigmaNAS for jails. Thebrig is such a fantastic functionality but has been in need for attention in a while, so I look forward to seeing Bastille perhaps addressing it.
Is the intention to bring it on par with thebrig JoseMR, or is completely different roadmap for it?
Hi cookiemonster.

The idea of this Extension is to make a very simple GUI container manager Extension in which the user can just quickly create shared IP jails by simply providing basic information such as the Name, Release and IP, but is not limited too, while at the same time providing direct jail.conf/fstab/bastille.conf files edition for advanced users with the built-in text editor.

Also its dependency free, small footprint core(BastilleBSD) 100% written in shell may be appealing for the power-users, also it keeps the traditional jail management and configuration scheme so the user can use the Bastille built-in command quick/easy syntax, or just use the traditional jls, jexec etc. as well.

===========================

Bastille is developed by Christer Edwards, and the code is available at GutHub.

XigmaNAS Bastille Extension code also available at GitHub.

Regards
System: FreeBSD 12 RootOnZFS Mirror, MB: Supermicro X8SI6-F, Xeon X3450, 16GB DDR3 ECC RDIMMs.
XigmaNAS RootOnZFS
Addons at GitHub
BastilleBSD
Boot Environments Intro
Resources Home Page

User avatar
JoseMR
Hardware & Software Guru
Hardware & Software Guru
Posts: 1050
Joined: 16 Apr 2014 04:15
Location: PR
Contact:
Status: Offline

Re: [EXTENSION] Bastille Manager, Container creation and management made easy!

#4

Post by JoseMR »

The public release is already available at GitHub and can be installed on XigmaNAS 11.2 x64 and later versions.

Regards
System: FreeBSD 12 RootOnZFS Mirror, MB: Supermicro X8SI6-F, Xeon X3450, 16GB DDR3 ECC RDIMMs.
XigmaNAS RootOnZFS
Addons at GitHub
BastilleBSD
Boot Environments Intro
Resources Home Page

User avatar
JoseMR
Hardware & Software Guru
Hardware & Software Guru
Posts: 1050
Joined: 16 Apr 2014 04:15
Location: PR
Contact:
Status: Offline

Re: [EXTENSION] Bastille Manager, Yet another user friendly jail manager!

#5

Post by JoseMR »

Update!

Hello, there is a big update for Bastille pending, and cedward(Bastille Developer) planned it for the 11/25 hopefully.

This Bastille update will enable Thickjail feature on the Bastille Manager Extension upon available:
create.png
Additionally I've added the ability to select additional distfiles during base release download:
tarballs.png
This will overrides the configuration once during download, if none is selected the Extension will obey the bastille.conf file by default.

Stay tuned!
Regards
You do not have the required permissions to view the files attached to this post.
System: FreeBSD 12 RootOnZFS Mirror, MB: Supermicro X8SI6-F, Xeon X3450, 16GB DDR3 ECC RDIMMs.
XigmaNAS RootOnZFS
Addons at GitHub
BastilleBSD
Boot Environments Intro
Resources Home Page

User avatar
JoseMR
Hardware & Software Guru
Hardware & Software Guru
Posts: 1050
Joined: 16 Apr 2014 04:15
Location: PR
Contact:
Status: Offline

Re: [EXTENSION] Bastille Manager, Yet another user friendly jail manager!

#6

Post by JoseMR »

Hello, Bastille Manager Extension now can fully Enable ZFS with a simple command execution from the shell for ease and convenience.

Prerequisites:
1) Install Bastille Extension with either OBI or manual setup.
2) Go to "Extensions > Bastille > Configuration" and configure the ZFS settings from there like shown in the below example:
Screenshot from 2019-11-28 20-09-49.png
The above example is for a XigmaNAS basic setup with a with a ZFS pool called "data" .


However for a RootOnZFS installation with a Dataset called "Data" created during XigmaNAS RootOnZFS install, then config looks as follow:
Screenshot from 2019-11-22 05-31-29.png

If the entered ZFS parameters are correct, you should see that ZFS support is "Available but not enabled" under "Extensions > Bastille > Maintenance" like shown below:
Screenshot from 2019-11-22 05-28-41.png
At this point all you need to do is to execute "bastille-init -Z" and the script will take care of the "bastille" dataset configuration for you, heres the sample output below:

Code: Select all

xigmanas: ~# bastille-init -Z
Enabling ZFS on Bastille Extension...
Do you really wish to enable ZFS for Bastille Extension? [y/N]:y
Proceeding...
Renaming existing 'bastille' directory
Creating a new ZFS dataset for 'bastille'
Synchronizing 'bastille' data on new dataset
ZFS Enabled for Bastille Extension successfully.
Initializing bastille...
xigmanas: ~#
If all went well you should see that ZFS support is "Enabled" under "Extensions > Bastille > Maintenance" like shown below:
Screenshot from 2019-11-22 05-52-19.png
That's all, just remember that this should be made before bootstrapping bastille, i.e. right after Bastille Extension install and ZFS properly configured, otherwise the change will require for manual work.

Note: If you see either "Disabled" or "Invalid ZFS configuration" under "Extensions > Bastille > Maintenance", or you already bootstrapped(fetched a release or created jails) bastille-init will not enable ZFS on such setup, additionally the "bastille.old" directory will be preserved and is up to the user to delete it manually.

EDIT: Added ability to restore from existing .tgz archives on ZFS setups, useful if the user later wants to upgrade to ZFS without loosing their jails.

Regards
You do not have the required permissions to view the files attached to this post.
System: FreeBSD 12 RootOnZFS Mirror, MB: Supermicro X8SI6-F, Xeon X3450, 16GB DDR3 ECC RDIMMs.
XigmaNAS RootOnZFS
Addons at GitHub
BastilleBSD
Boot Environments Intro
Resources Home Page

User avatar
JoseMR
Hardware & Software Guru
Hardware & Software Guru
Posts: 1050
Joined: 16 Apr 2014 04:15
Location: PR
Contact:
Status: Offline

Re: [EXTENSION] Bastille Manager, Yet another user friendly jail manager!

#7

Post by JoseMR »

Hello, as for version 1.0.17 now the Dashboard will display real containers release version(freebsd-version) for convenience.
Screenshot from 2019-11-28 04-36-29.png

Also I've added the ability to quickly upgrade/downgrade thin containers base release by safely editing the fstab mountpoint to point for the user selected release, the script will perform some validations and error handling before proceed with the changes, and after success the user can start the container and perform the required pkg upgrade/maintenance as usual.
Screenshot from 2019-11-28 04-45-18.png
Just select "Release" from the drop-down menu and change to your like.

Sample container changed/upgraded from 12.0 to 12.1 release:
Screenshot from 2019-11-28 04-49-55.png
Regards
You do not have the required permissions to view the files attached to this post.
System: FreeBSD 12 RootOnZFS Mirror, MB: Supermicro X8SI6-F, Xeon X3450, 16GB DDR3 ECC RDIMMs.
XigmaNAS RootOnZFS
Addons at GitHub
BastilleBSD
Boot Environments Intro
Resources Home Page

doktornotor
Advanced User
Advanced User
Posts: 200
Joined: 16 May 2017 00:22
Status: Offline

Re: [EXTENSION] Bastille Manager, Yet another user friendly jail manager!

#8

Post by doktornotor »

JoseMR wrote:
28 Nov 2019 09:52
Hello, as for version 1.0.17 now the Dashboard will display real containers release version(freebsd-version) for convenience.
Still cannot get anything newer than 1.0.6 both via OBI and manually... :?: :?

User avatar
JoseMR
Hardware & Software Guru
Hardware & Software Guru
Posts: 1050
Joined: 16 Apr 2014 04:15
Location: PR
Contact:
Status: Offline

Re: [EXTENSION] Bastille Manager, Yet another user friendly jail manager!

#9

Post by JoseMR »

doktornotor wrote:
28 Nov 2019 17:34
JoseMR wrote:
28 Nov 2019 09:52
Hello, as for version 1.0.17 now the Dashboard will display real containers release version(freebsd-version) for convenience.
Still cannot get anything newer than 1.0.6 both via OBI and manually... :?: :?
Hi doktornotor that's pretty weird, I've just tried OBI now and installed the extension v1.0.17.
OBI_Bastille_Install.png

Either you can try executing "bastille-init -x" to reset the Extension config, or just go to [Extensions > Bastille > Maintenance] and click on "Uninstall"(Uninstall removes Ext files only, and respect user cache/jails) then let OBI install the Extension again.

Note that you may need to re-configure the Bastille confiig under [Extensions > Bastille > Configuration] especially ZFS setting if any.

Regards
You do not have the required permissions to view the files attached to this post.
System: FreeBSD 12 RootOnZFS Mirror, MB: Supermicro X8SI6-F, Xeon X3450, 16GB DDR3 ECC RDIMMs.
XigmaNAS RootOnZFS
Addons at GitHub
BastilleBSD
Boot Environments Intro
Resources Home Page

doktornotor
Advanced User
Advanced User
Posts: 200
Joined: 16 May 2017 00:22
Status: Offline

Re: [EXTENSION] Bastille Manager, Yet another user friendly jail manager!

#10

Post by doktornotor »

Ok, uninstall + reinstall in OBI worked. The "in-place" reinstall feature did not. Weird.

Thanks!

User avatar
JoseMR
Hardware & Software Guru
Hardware & Software Guru
Posts: 1050
Joined: 16 Apr 2014 04:15
Location: PR
Contact:
Status: Offline

Re: [EXTENSION] Bastille Manager, Yet another user friendly jail manager!

#11

Post by JoseMR »

doktornotor wrote:
29 Nov 2019 12:50
Ok, uninstall + reinstall in OBI worked. The "in-place" reinstall feature did not. Weird.

Thanks!
Hi, thanks for confirm working with Uninstall/Reinstall method, it may happen that I changed paths/repos in the extension script, in that case deleting the extension "version" file also force an upgrade, I will look into it and try reproduce though.

Regards
System: FreeBSD 12 RootOnZFS Mirror, MB: Supermicro X8SI6-F, Xeon X3450, 16GB DDR3 ECC RDIMMs.
XigmaNAS RootOnZFS
Addons at GitHub
BastilleBSD
Boot Environments Intro
Resources Home Page

User avatar
JoseMR
Hardware & Software Guru
Hardware & Software Guru
Posts: 1050
Joined: 16 Apr 2014 04:15
Location: PR
Contact:
Status: Offline

Re: [EXTENSION] Bastille Manager, Yet another user friendly jail manager!

#12

Post by JoseMR »

NEW Feature UPDATE: As for version 1.0.19 Added freebsd-update support.

Bastille Manager Extension now fully supports "freebsd-update" mechanism to update/upgrade your containers through the extension script "bastille-init", so you will not be stuck with outdated containers anymore.

Here I try will explain on how to update/upgrade either thin and thick containers through the CLI.

===============
Thin Containers (Easy)
===============


How to Update a basejail to -pX release(affects are child thin containers):
1) Simply execute "bastille-init update X.Y-RELEASE"
update_to_pX.png
Sample output below(truncated to shorten text):

Code: Select all

xigmanas: ~# bastille-init update 12.0-RELEASE
src component not installed, skipped
Looking up update.FreeBSD.org mirrors... 3 mirrors found.
Fetching metadata signature for 12.0-RELEASE from update2.freebsd.org... done.
Fetching metadata index... done.
Inspecting system... done.
Preparing to download files... done.
Fetching 132 patches.....10....20....30....40....50....60....70....80....90....100....110....120....130. done.
Applying patches... done.
Fetching 1 files...  done.
The following files will be removed as part of updating to
12.0-RELEASE-p12:
/usr/share/zoneinfo/Etc/UCT
The following files will be added as part of updating to
12.0-RELEASE-p12:
/usr/share/zoneinfo/Asia/Qostanay
The following files will be updated as part of updating to
12.0-RELEASE-p12:
/bin/freebsd-version
/boot/loader
/boot/loader.efi
~~~~~~~~~~~~~~~~~~
/rescue/expr
/rescue/fastboot
/rescue/fasthalt

WARNING: FreeBSD 12.0-RELEASE is approaching its End-of-Life date.
It is strongly recommended that you upgrade to a newer
release within the next 2 months.
Installing updates... done.
xigmanas: ~#

How to Upgrade a thin container:
1) Simply go to [Extensions > Bastille > Utilities] and select "Release".
From there you can quickly upgrade a thin container base by simply changing to a newer base release due its shared base nature, and literally you can also downgrade a base release by selecting a lower version one by defect, also if said base is not found the script will bootstrap(fetch) it for you
base_change.png
After upgrading/changing the base release you can start the container normally.
=============
End Thin Containers
=============



===================
Thick Containers (Advanced)
===================


UPDATE: As for version 1.0.23, there is no longer the need to mess with securelevel nor allow.chflags in order to simply update a Thickjail.

==============
End Thick Containers
==============


Usage:

Code: Select all

xigmanas: ~# bastille-init -h
Usage: bastille-init -[option] | [container]
Options:
        -s  Start All Bastille Containers.
        -p  Stop All Bastille Containers.
        -r  Restart All Bastille Containers.
        -u  Upgrade Bastille/Extension packages.
        -v  Display product versions.
        -g  Enables the addon GUI.
        -t  Disable the addon GUI.
        -B  Backup a Bastille container.
        -R  Restore a Bastille container.
        -Z  Activate ZFS for Bastille Extension.
        -x  Reset Bastille/Extension config.
        -U  Uninstall Bastille (Extension files only).
        -h  Display this help message.

Advanced Usage: bastille-init [option] [container] [release] | [newrelease]
Options:
        update|--update  Update a container to base -pX release.
        upgrade|--upgrade  Upgrade a container release to X.Y-RELEASE.

Note: Thick containers update/upgrade may depend on securelevel/allow.chflags.
xigmanas: ~#
Hope this guide can help.
Regards
You do not have the required permissions to view the files attached to this post.
System: FreeBSD 12 RootOnZFS Mirror, MB: Supermicro X8SI6-F, Xeon X3450, 16GB DDR3 ECC RDIMMs.
XigmaNAS RootOnZFS
Addons at GitHub
BastilleBSD
Boot Environments Intro
Resources Home Page

User avatar
JoseMR
Hardware & Software Guru
Hardware & Software Guru
Posts: 1050
Joined: 16 Apr 2014 04:15
Location: PR
Contact:
Status: Offline

Re: [EXTENSION] Bastille Manager, Yet another user friendly jail manager!

#13

Post by JoseMR »

As for version 1.0.21 the update process has been improved and now the "freebsd-update" db will be placed in the extension directory to save boot disk space and required by embedded platforms, also the "freebsd-update" command will be run from the extension directory as well for safety.

Regards
System: FreeBSD 12 RootOnZFS Mirror, MB: Supermicro X8SI6-F, Xeon X3450, 16GB DDR3 ECC RDIMMs.
XigmaNAS RootOnZFS
Addons at GitHub
BastilleBSD
Boot Environments Intro
Resources Home Page

User avatar
JoseMR
Hardware & Software Guru
Hardware & Software Guru
Posts: 1050
Joined: 16 Apr 2014 04:15
Location: PR
Contact:
Status: Offline

Re: [EXTENSION] Bastille Manager, Yet another user friendly jail manager!

#14

Post by JoseMR »

Hello, as for version 1.0.22 the Containers and Base Releases can be updated by the Extension GUI as well for convenience.

Note: This feature still respect for highly secured Thick Containers, so be aware that after allowing "securelevel = 0" and "allow.chflags =1", return this values back to default after updating/upgrading.

Screenshots:
Thin_Update.png
Thick_Update.png

*Upgrades under Thick Containers are by CLI only for interactive progress.

Regards
You do not have the required permissions to view the files attached to this post.
System: FreeBSD 12 RootOnZFS Mirror, MB: Supermicro X8SI6-F, Xeon X3450, 16GB DDR3 ECC RDIMMs.
XigmaNAS RootOnZFS
Addons at GitHub
BastilleBSD
Boot Environments Intro
Resources Home Page

li463749780
NewUser
NewUser
Posts: 13
Joined: 09 Aug 2018 19:03
Status: Offline

Re: [EXTENSION] Bastille Manager, Yet another user friendly jail manager!

#15

Post by li463749780 »

Hello, how do you localize this project.
Chinese

User avatar
JoseMR
Hardware & Software Guru
Hardware & Software Guru
Posts: 1050
Joined: 16 Apr 2014 04:15
Location: PR
Contact:
Status: Offline

Re: [EXTENSION] Bastille Manager, Yet another user friendly jail manager!

#16

Post by JoseMR »

li463749780 wrote:
07 Dec 2019 07:37
Hello, how do you localize this project.
Chinese
Hello, this project is under development and there is no WebGUI translations as of yet, however I will try to post for translation help in Launchpad for this project asap for volunteers to help with.

Regards
System: FreeBSD 12 RootOnZFS Mirror, MB: Supermicro X8SI6-F, Xeon X3450, 16GB DDR3 ECC RDIMMs.
XigmaNAS RootOnZFS
Addons at GitHub
BastilleBSD
Boot Environments Intro
Resources Home Page

li463749780
NewUser
NewUser
Posts: 13
Joined: 09 Aug 2018 19:03
Status: Offline

Re: [EXTENSION] Bastille Manager, Yet another user friendly jail manager!

#17

Post by li463749780 »

JoseMR wrote:
07 Dec 2019 23:25
li463749780 wrote:
07 Dec 2019 07:37
Hello, how do you localize this project.
Chinese
Hello, this project is under development and there is no WebGUI translations as of yet, however I will try to post for translation help in Launchdad for this project asap for volunteers to help with.

Regards
Okay thank you. Send a link at that time

Bjork
Starter
Starter
Posts: 26
Joined: 11 Dec 2019 12:36
Status: Offline

Re: [EXTENSION] Bastille Manager, Yet another user friendly jail manager!

#18

Post by Bjork »

Hi!

I'm completely new to jails and Bastille. I'm running embedded XigmaNAS from a USB-stick and I've set up Bastille to store everything on another USB-stick, in the folder /mnt/jaildisk/extensions/.

I've set up a jail (jail1), using a 12.1 base, and I have assigned it an IP. I can SSH to it just fine, it looks and behaves exactly like when I SSH to the XigmaNAS itself, complete with root access and everything.

I'm just wondering how to use it... I was hoping that I could just ssh into my jail through its ip (which I can) and then install things like webmin, openvpn, etc. However, nothing seems to be stored in the jail - leading to all of the changes being gone after a reboot of XigmaNAS.

Is there something that I'm missing in order to do what I'm attempting to do?

Grateful for any help and advice!
/Jan

User avatar
JoseMR
Hardware & Software Guru
Hardware & Software Guru
Posts: 1050
Joined: 16 Apr 2014 04:15
Location: PR
Contact:
Status: Offline

Re: [EXTENSION] Bastille Manager, Yet another user friendly jail manager!

#19

Post by JoseMR »

li463749780 wrote:
08 Dec 2019 11:46
Okay thank you. Send a link at that time
Hello, sorry for the delay.

The Bastille Jail/Container Manager translations can be submitted in Launchpad/Bastille Manager

Hopefully is all ok, been a while since my last project in Launchpad.

Regards
System: FreeBSD 12 RootOnZFS Mirror, MB: Supermicro X8SI6-F, Xeon X3450, 16GB DDR3 ECC RDIMMs.
XigmaNAS RootOnZFS
Addons at GitHub
BastilleBSD
Boot Environments Intro
Resources Home Page

User avatar
JoseMR
Hardware & Software Guru
Hardware & Software Guru
Posts: 1050
Joined: 16 Apr 2014 04:15
Location: PR
Contact:
Status: Offline

Re: [EXTENSION] Bastille Manager, Yet another user friendly jail manager!

#20

Post by JoseMR »

Bjork wrote:
17 Dec 2019 13:19
Hi!

I'm completely new to jails and Bastille. I'm running embedded XigmaNAS from a USB-stick and I've set up Bastille to store everything on another USB-stick, in the folder /mnt/jaildisk/extensions/.
Hi, can I ask you why you chose an unreliable and slow USB stick to store FreeBSD containers?

I'm afraid you will have performance/speed issues while setting/installing applications inside jails, as well as for unexpected behaviors, not to mention the lost of all your complex jails settings due further USB stick damage/corruption, I will strongly suggest you to store the containers in a permanent data location on either HDD/SSD.

Bjork wrote:
17 Dec 2019 13:19
I've set up a jail (jail1), using a 12.1 base, and I have assigned it an IP. I can SSH to it just fine, it looks and behaves exactly like when I SSH to the XigmaNAS itself, complete with root access and everything.

I'm just wondering how to use it... I was hoping that I could just ssh into my jail through its ip (which I can) and then install things like webmin, openvpn, etc. However, nothing seems to be stored in the jail - leading to all of the changes being gone after a reboot of XigmaNAS.

Is there something that I'm missing in order to do what I'm attempting to do?

Grateful for any help and advice!
/Jan
This does not sound to me you are actually installing stuff inside a jail, did you formatted and mount the USB stick properly?.

Please provide more information about your XigmaNAS/Extensions setup so I can try reproduce here, however I can't test with your exact setup since it is non optimal unfortunately.

what does the command "df -h" returns on your XigmaNAS host.

EDIT: I've created a 12.1 thin jail under XigmaNAS Embedded 12.1.0.4 - Ingva (revision 7091) and installer/configured Webmin into it, the jail settings are persistent on reboots as expected, also I've read on another post that you use Unionfs for Jail setup, Unionfs is known to cause unexpected behaviors, so please try to avoid it and use Nullfs instead.

Regards
System: FreeBSD 12 RootOnZFS Mirror, MB: Supermicro X8SI6-F, Xeon X3450, 16GB DDR3 ECC RDIMMs.
XigmaNAS RootOnZFS
Addons at GitHub
BastilleBSD
Boot Environments Intro
Resources Home Page

Bjork
Starter
Starter
Posts: 26
Joined: 11 Dec 2019 12:36
Status: Offline

Re: [EXTENSION] Bastille Manager, Yet another user friendly jail manager!

#21

Post by Bjork »

JoseMR wrote:
17 Dec 2019 14:24
Hi, can I ask you why you chose an unreliable and slow USB stick to store FreeBSD containers?

I'm afraid you will have performance/speed issues doing so while setting/installing applications inside jails, as well as for unexpected behaviors, not to mention the lost of all your complex jails settings due the USB stick damage/corruption, I will strongly suggest you to store the containers in a permanent data location on either HDD/SSD.
Yes, my ignorance is showing through. My plan is to add a small ssd to my server in order to do more permanent things, but I want to be able to make things work first and learn what I can, and then I can start something more permanent. The XigmaNAS installation loads everything into ram when booting, so I get great performance there (except boot times) and as long as I make backups things work great. It's the jails that I need to worry about, but I'm going to have to work them out before I can get to performance improvement and reliability.
JoseMR wrote:
17 Dec 2019 14:24
This does not sound to me you are actually installing stuff inside a jail, did you formatted and mount the USB stick properly?.

Please provide more information about your XigmaNAS/Extensions setup so I can try reproduce here, however I can't test with your exact setup since it is non optimal unfortunately.

what does the command "df -h" returns on your XigmaNAS host.

EDIT: I've created a 12.1 thin jail under XigmaNAS Embedded 12.1.0.4 - Ingva (revision 7091) and installer/configured Webmin into it, the jail settings are persistent on reboots as expected, also I've read on another post that you use Unionfs for Jail setup, Unionfs is known to cause unexpected behaviors, so please try to avoid it and use Nullfs instead.

Regards
I actually did a clean install of XigmaNAS and have not done any mounting of unionfs after I installed the last XigmaNAS Embedded version. I assumed that I could just log into the Bastille jail with ssh and have it work independently of the original OS, but that seems not to be the case. Do I need to do something with filesystems or the fstab file in the jails folder in order to make it work? - I have attempted to do the bare minimum in order to not overreach and mess things up. Do I need to format the USB-stick with MBR? (I'm on a legacy bios, so all boot drives need to be MBR, which is a pain in and of itself, but since the server is not actually booting from that disk I thought GPT would be okay for jails)

If I use commands like "pkg install openvpn" on a new 12.1 thin jail without doing any editing of jail.conf or the fstab for that jail, should it work and be persistent? The folder structure of /mnt/jaildisk/extensions/bastille is perfectly accessible and selectable when I setup a new jail, and when ssh-ing to the new IP, the folders are there.

...

I should also mention that the Bastille Manager suddenly no longer appears in the extensions menu when I'm logged in to the XigmaNAS Web-interface. It appears as "installed" under "OneButtonInstaller", but it does not have it's own menu option anymore. ... I'm getting really confused...

This is the return of "df -h"

Filesystem Size Used Avail Capacity Mounted on
/dev/md0 120M 104M 15M 87% /
devfs 1.0K 1.0K 0B 100% /dev
/dev/md1 1.2G 970M 254M 79% /usr/local
procfs 4.0K 4.0K 0B 100% /proc
/dev/da1s1a 3.7G 312M 3.4G 8% /cf
/dev/ufsid/5df8bf7387c4c9cc 14G 1.0G 12G 8% /mnt/jaildisk
Stockholm 3.2T 7.4G 3.1T 0% /volumes/Stockholm
Stockholm/STSkarpoMedia 3.1T 1.6G 3.1T 0% /volumes/Stockholm/STSkarpoMedia
Stockholm/STMMeilenMedia 3.1T 350K 3.1T 0% /volumes/Stockholm/STMMeilenMedia
Stockholm/STStockholmMedia 6.1T 2.9T 3.1T 48% /volumes/Stockholm/STStockholmMedia
/dev/md2 496M 4.7M 481M 1% /var
tmpfs 256M 52K 256M 0% /var/tmp

User avatar
JoseMR
Hardware & Software Guru
Hardware & Software Guru
Posts: 1050
Joined: 16 Apr 2014 04:15
Location: PR
Contact:
Status: Offline

Re: [EXTENSION] Bastille Manager, Yet another user friendly jail manager!

#22

Post by JoseMR »

Bjork wrote:
17 Dec 2019 16:34
I actually did a clean install of XigmaNAS and have not done any mounting of unionfs after I installed the last XigmaNAS Embedded version. I assumed that I could just log into the Bastille jail with ssh and have it work independently of the original OS, but that seems not to be the case. Do I need to do something with filesystems or the fstab file in the jails folder in order to make it work? - I have attempted to do the bare minimum in order to not overreach and mess things up. Do I need to format the USB-stick with MBR? (I'm on a legacy bios, so all boot drives need to be MBR, which is a pain in and of itself, but since the server is not actually booting from that disk I thought GPT would be okay for jails)
Hi, it does not matter if the USB stick is formatted in MBR or GPT, and formatting in MBR is just recommended on legacy BIOS that can't boot properly from GPT, but does not meant all of the storage drives need to be necessarily formatted as MBR, so its all fine there.
Bjork wrote:
17 Dec 2019 16:34
If I use commands like "pkg install openvpn" on a new 12.1 thin jail without doing any editing of jail.conf or the fstab for that jail, should it work and be persistent? The folder structure of /mnt/jaildisk/extensions/bastille is perfectly accessible and selectable when I setup a new jail, and when ssh-ing to the new IP, the folders are there.
You can't simply SSH to the new jail IP, you will just SSH to the host(XigmaNAS) itself since the jail is using a shared IP, unless the SSH server is properly configured/started on the jail otherwise, all you need to do is to use one of the commands below to login and use any commands inside the actual jail environment:

By using BastilleBSD:

Code: Select all

bastille console jail_name
By using jexec:

Code: Select all

jexec jail_name_or_ID

Bjork wrote:
17 Dec 2019 16:34
I should also mention that the Bastille Manager suddenly no longer appears in the extensions menu when I'm logged in to the XigmaNAS Web-interface. It appears as "installed" under "OneButtonInstaller", but it does not have it's own menu option anymore. ... I'm getting really confused...
Looks like there is something borked out in that setup unfortunately, between make sure to update the Postinit/Shutdown command of the Bastille extension in case you change the extension paths under: [System > Advanced > Command Scripts].

Bjork wrote:
17 Dec 2019 16:34
This is the return of "df -h"

Filesystem Size Used Avail Capacity Mounted on
/dev/md0 120M 104M 15M 87% /
devfs 1.0K 1.0K 0B 100% /dev
/dev/md1 1.2G 970M 254M 79% /usr/local
procfs 4.0K 4.0K 0B 100% /proc
/dev/da1s1a 3.7G 312M 3.4G 8% /cf
/dev/ufsid/5df8bf7387c4c9cc 14G 1.0G 12G 8% /mnt/jaildisk
Stockholm 3.2T 7.4G 3.1T 0% /volumes/Stockholm
Stockholm/STSkarpoMedia 3.1T 1.6G 3.1T 0% /volumes/Stockholm/STSkarpoMedia
Stockholm/STMMeilenMedia 3.1T 350K 3.1T 0% /volumes/Stockholm/STMMeilenMedia
Stockholm/STStockholmMedia 6.1T 2.9T 3.1T 48% /volumes/Stockholm/STStockholmMedia
/dev/md2 496M 4.7M 481M 1% /var
tmpfs 256M 52K 256M 0% /var/tmp
Thanks, the mountpoint for "/mnt/jaildisk" looks good indeed.

Regards
System: FreeBSD 12 RootOnZFS Mirror, MB: Supermicro X8SI6-F, Xeon X3450, 16GB DDR3 ECC RDIMMs.
XigmaNAS RootOnZFS
Addons at GitHub
BastilleBSD
Boot Environments Intro
Resources Home Page

Bjork
Starter
Starter
Posts: 26
Joined: 11 Dec 2019 12:36
Status: Offline

Re: [EXTENSION] Bastille Manager, Yet another user friendly jail manager!

#23

Post by Bjork »

JoseMR wrote:
17 Dec 2019 19:34
Hi, it does not matter if the USB stick is formatted in MBR or GPT, and formatting in MBR is just recommended on legacy BIOS that can't boot properly from GPT, but does not meant all of the storage drives need to be necessarily formatted as MBR, so its all fine there.
Yeah, that's what I guessed. I would have been surprised if Bastille cared about the boot sector of the storage drives.
JoseMR wrote:
17 Dec 2019 19:34
You can't simply SSH to the new jail IP, you will just SSH to the host(XigmaNAS) itself since the jail is using a shared IP, unless the SSH server is properly configured/started on the jail otherwise, all you need to do is to use one of the commands below to login and use any commands inside the actual jail environment:

By using BastilleBSD:

Code: Select all

bastille console jail_name
By using jexec:

Code: Select all

jexec jail_name_or_ID
Huh... that makes things different than what I expected. I did set up the jail to use an IP different from the XigmaNAS host, but I guess I need to set up ssh and stuff again on the jail? Do I need to set up any kind of folder structure with nullfs or something like that in order to set things up?
JoseMR wrote:
17 Dec 2019 19:34
Looks like there is something borked out in that setup unfortunately, between make sure to update the Postinit/Shutdown command of the Bastille extension in case you change the extension paths under: [System > Advanced > Command Scripts].
Haven't changed the extension path... I'm probably going to delete the extension manager, format the drive, and start over from square one every time things get borked until I get a config that works smoothly.
JoseMR wrote:
17 Dec 2019 19:34
Thanks, the mountpoint for "/mnt/jaildisk" looks good indeed.
Thanks, I love it when my "mountpoints" look nice. :)

User avatar
JoseMR
Hardware & Software Guru
Hardware & Software Guru
Posts: 1050
Joined: 16 Apr 2014 04:15
Location: PR
Contact:
Status: Offline

Re: [EXTENSION] Bastille Manager, Yet another user friendly jail manager!

#24

Post by JoseMR »

Bjork wrote:
17 Dec 2019 19:58
Huh... that makes things different than what I expected. I did set up the jail to use an IP different from the XigmaNAS host, but I guess I need to set up ssh and stuff again on the jail? Do I need to set up any kind of folder structure with nullfs or something like that in order to set things up?
Hi, without going technical here, a FreeBSD jail/container is just like a Vanilla(fresh) FreeBSD installation, therefore you need to install/setup things inside each jail environment independently, hence there is no SSH nor stuff preinstalled/configured right after a jail creation other than the stock OS itself.

As for the Nullfs, it is used to map directories inside the jails in order for certain applications to access data from the host, such as web servers, medias servers etc., this can be either as read-write, or read-only depending on the jail/intended application, between Bastille Manager does supports for basic nullfs mounts/edits from the GUI.

Also this requires a learning curve for the user to be familiarized with FreeBSD and the command line, even if following how-to's.

Bjork wrote:
17 Dec 2019 19:58
Haven't changed the extension path... I'm probably going to delete the extension manager, format the drive, and start over from square one every time things get borked until I get a config that works smoothly.
Yeah, It would be good idea to just reinstall if this is a brand-new system and there is no important/personal data in it yet, rather than start troubleshooting.

Regards
System: FreeBSD 12 RootOnZFS Mirror, MB: Supermicro X8SI6-F, Xeon X3450, 16GB DDR3 ECC RDIMMs.
XigmaNAS RootOnZFS
Addons at GitHub
BastilleBSD
Boot Environments Intro
Resources Home Page

User avatar
JoseMR
Hardware & Software Guru
Hardware & Software Guru
Posts: 1050
Joined: 16 Apr 2014 04:15
Location: PR
Contact:
Status: Offline

Re: [EXTENSION] Bastille Manager, Yet another user friendly jail manager!

#25

Post by JoseMR »

UPDATE:
As for Bastille Manager version 1.0.23, there is no longer the need to mess with "securelevel/allow.chflags" in order to update/upgrade Thick containers since process done from host.

Just select "Update" from the Utility menu and execute the command for the jail in question, however the Thickjail Upgrade is still interactive and should be performed from the CLI by the system administrator.

Updated Usage:

Code: Select all

xigmanas: ~# bastille-init -h
Usage: bastille-init -[option] | [container]
Options:
        -s  Start All Bastille Containers.
        -p  Stop All Bastille Containers.
        -r  Restart All Bastille Containers.
        -u  Upgrade Bastille/Extension packages.
        -v  Display product versions.
        -g  Enables the addon GUI.
        -t  Disable the addon GUI.
        -B  Backup a Bastille container.
        -R  Restore a Bastille container.
        -Z  Activate ZFS for Bastille Extension.
        -x  Reset Bastille/Extension config.
        -U  Uninstall Bastille (Extension files only).
        -h  Display this help message.

Advanced Usage: bastille-init [option] [container] [release] | [newrelease]
Options:
        update|--update Update a container/release to base -pX release.
        upgrade|--upgrade Upgrade a container release to X.Y-RELEASE.
        upgrade_install|--upgrade_install Finish installing pending updates on Thick containers.
        clean|--clean Cleanup the FreeBSD update/upgrade cached files/folders.

xigmanas: ~#
Regards
System: FreeBSD 12 RootOnZFS Mirror, MB: Supermicro X8SI6-F, Xeon X3450, 16GB DDR3 ECC RDIMMs.
XigmaNAS RootOnZFS
Addons at GitHub
BastilleBSD
Boot Environments Intro
Resources Home Page

Bjork
Starter
Starter
Posts: 26
Joined: 11 Dec 2019 12:36
Status: Offline

Re: [EXTENSION] Bastille Manager, Yet another user friendly jail manager!

#26

Post by Bjork »

JoseMR wrote:
18 Dec 2019 00:40
Also this requires a learning curve for the user to be familiarized with FreeBSD and the command line, even if following how-to's.
I've noticed. :D

Seriously though, I think I'm getting it. Slowly, but surely. Thank you so much for all your help!

/Jan

cookiemonster
Advanced User
Advanced User
Posts: 221
Joined: 23 Mar 2014 02:58
Location: UK
Status: Offline

Re: [EXTENSION] Bastille Manager, Yet another user friendly jail manager!

#27

Post by cookiemonster »

Hi JoseMR. Is it possible to bring in theBrig jails into Bastille? I have a couple thin and thick.
Main: Xigmanas 11.2.0.4 x64-full-RootOnZFS on Supermicro X8DT3. zroot on mirrorred pair of CRUCIAL_CT64M225. Memory: 72GB ECC; 2 Xeon E5645 CPUs; Storage: (HBA) - LSI SAS 9211-4i with 3 SATA x 1 Tb in raidZ1, 1 x 3 Tb SAS drive as single stripe.
Spare1: HP DL580 G5; 128 GB ECC RAM; 4 CPU; 8 x 500 GB disks on H210i
Spare2: HP DL360 G7; 6 GB ECC RAM; 1 Xeon CPU; 5 x 500 GB disks on H210i
Spare3: HP DL380 G7; 24 GB ECC RAM; 2 Xeon E5645 CPUs; 8 x 500 GB disks on IBM M1015 flashed to LSI9211-IT

Bjork
Starter
Starter
Posts: 26
Joined: 11 Dec 2019 12:36
Status: Offline

Re: [EXTENSION] Bastille Manager, Yet another user friendly jail manager!

#28

Post by Bjork »

.... Buuut... Just one more thing... :D

I figured a lot of things out. I managed to do a lot of things (and I had to do them many, many, many times, since I did them in the wrong order multiple times...)

As I need my jail to access a folder on my host (/volumes/Stockholm) and its subdirectories, I added this to jail1/fstab

Code: Select all

/volumes/Stockholm	/mnt/jaildisk/extensions/bastille/jails/jail1/root/volumes/Stockholm	nullfs	rw	0	0
I really thought that that would do it, but for some reason I can only seem to reach one level down from that point. Is it because /volumes/Stockholm is on ZFS?

Edit: I tried enabling ZFS through CLI, but to no avail.

Code: Select all

xigmanas: ~# bastille-init -Z jail1
Bastille has been bootstrapped already, aborting.
/Jan

User avatar
JoseMR
Hardware & Software Guru
Hardware & Software Guru
Posts: 1050
Joined: 16 Apr 2014 04:15
Location: PR
Contact:
Status: Offline

Re: [EXTENSION] Bastille Manager, Yet another user friendly jail manager!

#29

Post by JoseMR »

Bjork wrote:
18 Dec 2019 13:51
.... Buuut... Just one more thing... :D

I figured a lot of things out. I managed to do a lot of things (and I had to do them many, many, many times, since I did them in the wrong order multiple times...)

As I need my jail to access a folder on my host (/volumes/Stockholm) and its subdirectories, I added this to jail1/fstab

Code: Select all

/volumes/Stockholm	/mnt/jaildisk/extensions/bastille/jails/jail1/root/volumes/Stockholm	nullfs	rw	0	0
I really thought that that would do it, but for some reason I can only seem to reach one level down from that point. Is it because /volumes/Stockholm is on ZFS?
Hello, you can add nullfs mounts from Bastille Manager under: [Extensions > Bastille > Utilities > Fstab], or manually, and both directories source/target must exist, failing to do so will prevent the jail from starting as expected, also if this was done with the jail already started the user may need to restart the jail in order to mount it.

Absolutely nothing to do with the filesystem, maybe I should add an auto-mount option if the user added nullfs entries through the GUI with the jail already started, so no jail reboot will be required.

Bjork wrote:
18 Dec 2019 13:51
Edit: I tried enabling ZFS through CLI, but to no avail.

Code: Select all

xigmanas: ~# bastille-init -Z jail1
Bastille has been bootstrapped already, aborting.
/Jan
Enabling ZFS in Bastille Manager is a very first step and this cannot be done after you already bootstrapped/created jails since the directories are already created, and ZFS will create datasets instead, so either start over or manually migrating this directories into datasets which may be a hassle for newcomers.

Also ZFS is intended for advanced/granular containers administration i.e. snapshots, clones, zfs send/recv etc, also I don't recommend it for USB sticks so you can skip this feature.

Regards
System: FreeBSD 12 RootOnZFS Mirror, MB: Supermicro X8SI6-F, Xeon X3450, 16GB DDR3 ECC RDIMMs.
XigmaNAS RootOnZFS
Addons at GitHub
BastilleBSD
Boot Environments Intro
Resources Home Page

User avatar
JoseMR
Hardware & Software Guru
Hardware & Software Guru
Posts: 1050
Joined: 16 Apr 2014 04:15
Location: PR
Contact:
Status: Offline

Re: [EXTENSION] Bastille Manager, Yet another user friendly jail manager!

#30

Post by JoseMR »

cookiemonster wrote:
18 Dec 2019 13:31
Hi JoseMR. Is it possible to bring in theBrig jails into Bastille? I have a couple thin and thick.
Hi cookiemonster, it is possible but it requires some manual work in order to be used by Bastille which uses the traditional jail.conf for administration.

I will try to create a basic Thin and a Thick jail on TheBrig and post the procedure on how to migrate them to Bastille as time permits, since currently working on BastilleBSD improvements.

Regards
System: FreeBSD 12 RootOnZFS Mirror, MB: Supermicro X8SI6-F, Xeon X3450, 16GB DDR3 ECC RDIMMs.
XigmaNAS RootOnZFS
Addons at GitHub
BastilleBSD
Boot Environments Intro
Resources Home Page

Post Reply

Return to “Extensions / Add-ons”