Align console prompts to style guide (container, sbc, use case)
This commit is contained in:
parent
98bafc4ab9
commit
a445c46d59
4 changed files with 186 additions and 186 deletions
|
|
@ -21,33 +21,33 @@ The systemd-nspawn tools like machinctl look for containers in `/var/lib/machine
|
|||
Following the Fedora server storage scheme, create a logical volume, create a file system and mount it to `/var/lib/machines`. The tools can use BTRFS properties, so this can be used as a filesystem in this case.
|
||||
If you don't want to follow the Fedora Server rationale, skip this step.
|
||||
+
|
||||
[source,]
|
||||
[source,console]
|
||||
----
|
||||
[…]# dnf install btrfs-progs
|
||||
[…]# lvcreate -L 20G -n machines {VGNAME}
|
||||
[…]# mkfs.btrfs -L machines /dev/mapper/{VGNAME}-machines
|
||||
[…]# mkdir /var/lib/machines
|
||||
[…]# vim /etc/fstab
|
||||
# dnf install btrfs-progs
|
||||
# lvcreate -L 20G -n machines {VGNAME}
|
||||
# mkfs.btrfs -L machines /dev/mapper/{VGNAME}-machines
|
||||
# mkdir /var/lib/machines
|
||||
# vim /etc/fstab
|
||||
(insert)
|
||||
/dev/mapper/{VGNAME}-machines /var/lib/machines auto 0 0
|
||||
|
||||
[…]# mount -a
|
||||
# mount -a
|
||||
----
|
||||
2. *Check and, if necessary, correct the SELinux labels*
|
||||
+
|
||||
Ensure that the directory belongs to root and can only be accessed by root (should be done by the installer).
|
||||
+
|
||||
[source,]
|
||||
[source,console]
|
||||
----
|
||||
[…]# restorecon -vFr /var/lib/machines
|
||||
[…]# chown root:root /var/lib/machines
|
||||
[…]# chmod 700 /var/lib/machines
|
||||
# restorecon -vFr /var/lib/machines
|
||||
# chown root:root /var/lib/machines
|
||||
# chmod 700 /var/lib/machines
|
||||
----
|
||||
3. *Adding configuration for nspawn to the `etc/systemd` directory*
|
||||
+
|
||||
[source,]
|
||||
[source,console]
|
||||
----
|
||||
[…]# mkdir /etc/systemd/nspawn
|
||||
# mkdir /etc/systemd/nspawn
|
||||
----
|
||||
|
||||
== 2. Creating a nspawn container
|
||||
|
|
@ -58,18 +58,18 @@ The creation of a container filesystem or the provision of a corresponding image
|
|||
|
||||
1. Creating a BTRFS subvolume with the name of the container
|
||||
+
|
||||
[source,]
|
||||
[source,console]
|
||||
----
|
||||
[…]# cd /var/lib/machines
|
||||
[…]# btrfs subvolume create {ctname}
|
||||
# cd /var/lib/machines
|
||||
# btrfs subvolume create {ctname}
|
||||
----
|
||||
2. Creating a minimal container directory tree
|
||||
+
|
||||
**__Fedora 34 / 35__**
|
||||
+
|
||||
[source,]
|
||||
[source,console]
|
||||
----
|
||||
[…]# dnf --releasever=35 --best --setopt=install_weak_deps=False --installroot=/var/lib/machines/{CTNAME}/ \
|
||||
# dnf --releasever=35 --best --setopt=install_weak_deps=False --installroot=/var/lib/machines/{CTNAME}/ \
|
||||
install dhcp-client dnf fedora-release glibc glibc-langpack-en glibc-langpack-de iputils less ncurses passwd systemd systemd-networkd systemd-resolved vim-default-editor
|
||||
----
|
||||
+
|
||||
|
|
@ -78,9 +78,9 @@ F35 installs 174 packages (270M) and allocates 527M in the file system.
|
|||
+
|
||||
**__Fedora 36__**
|
||||
+
|
||||
[source,]
|
||||
[source,console]
|
||||
----
|
||||
[…]# dnf --releasever=36 --best --setopt=install_weak_deps=False --installroot=/var/lib/machines/{CTNAME}/ \
|
||||
# dnf --releasever=36 --best --setopt=install_weak_deps=False --installroot=/var/lib/machines/{CTNAME}/ \
|
||||
install dhcp-client dnf fedora-release glibc glibc-langpack-en glibc-langpack-de iputils less ncurses passwd systemd systemd-networkd systemd-resolved util-linux vim-default-editor
|
||||
----
|
||||
+
|
||||
|
|
@ -90,9 +90,9 @@ F36 installs 171 packages (247M) and allocates 550M in the file system.
|
|||
+
|
||||
First create a separate CentOS repository file (e.g. /root/centos.repo) and import CentOS keys.On this basis, perform a standard installation using DNF.
|
||||
+
|
||||
[source,]
|
||||
[source,console]
|
||||
----
|
||||
[…]# vim /root/centos8.repo
|
||||
# vim /root/centos8.repo
|
||||
<insert>
|
||||
[centos8-chroot-base]
|
||||
name=CentOS-8-Base
|
||||
|
|
@ -113,11 +113,11 @@ First create a separate CentOS repository file (e.g. /root/centos.repo) and impo
|
|||
gpgcheck=1
|
||||
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-8
|
||||
|
||||
[…]# dnf install http://mirror.centos.org/centos/8-stream/BaseOS/x86_64/os/Packages/centos-gpg-keys-8-2.el8.noarch.rpm
|
||||
# dnf install http://mirror.centos.org/centos/8-stream/BaseOS/x86_64/os/Packages/centos-gpg-keys-8-2.el8.noarch.rpm
|
||||
|
||||
[…]# rpm -Uvh --nodeps https:/dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm
|
||||
# rpm -Uvh --nodeps https:/dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm
|
||||
|
||||
[…]# dnf -c /root/centos8.repo --releasever=8-stream --best --disablerepo=* --setopt=install_weak_deps=False --enablerepo=centos8-chroot-base --enablerepo=centos8-chroot-appstream --enablerepo=epel8-chroot --installroot=/var/lib/machines/{CTNAME} install centos-release dhcp-client dnf glibc-langpack-en glibc-langpack-de iproute iputils less passwd systemd systemd-networkd vim-enhanced
|
||||
# dnf -c /root/centos8.repo --releasever=8-stream --best --disablerepo=* --setopt=install_weak_deps=False --enablerepo=centos8-chroot-base --enablerepo=centos8-chroot-appstream --enablerepo=epel8-chroot --installroot=/var/lib/machines/{CTNAME} install centos-release dhcp-client dnf glibc-langpack-en glibc-langpack-de iproute iputils less passwd systemd systemd-networkd vim-enhanced
|
||||
|
||||
----
|
||||
+
|
||||
|
|
@ -130,19 +130,19 @@ The message: `install-info: File or directory not found for /dev/null` appears s
|
|||
+
|
||||
This requires temporarily setting SELinux to permissive, otherwise passwd will not make any changes.
|
||||
+
|
||||
[source,]
|
||||
[source,console]
|
||||
----
|
||||
[…]# setenforce 0
|
||||
[…]# systemd-nspawn -D /var/lib/machines/{ctname} passwd
|
||||
[…]# setenforce 1
|
||||
# setenforce 0
|
||||
# systemd-nspawn -D /var/lib/machines/{ctname} passwd
|
||||
# setenforce 1
|
||||
----
|
||||
2. Provision of network interfaces for the container within the host
|
||||
+
|
||||
If only a connection to an internal, protected network is needed (replace the host bridge interface name accordingly):
|
||||
+
|
||||
[source,]
|
||||
[source,console]
|
||||
----
|
||||
[…]# vim /etc/systemd/nspawn/{ctname}.nspawn
|
||||
# vim /etc/systemd/nspawn/{ctname}.nspawn
|
||||
(insert)
|
||||
[Network]
|
||||
Bridge=vbr6s0
|
||||
|
|
@ -150,9 +150,9 @@ If only a connection to an internal, protected network is needed (replace the ho
|
|||
+
|
||||
If a connection to the external, public network is also required, two corresponding interfaces must be provided, whereby a mac-vlan is used on the interface of the host for the external connection (again, replace the host interface names accordingly).
|
||||
+
|
||||
[source,]
|
||||
[source,console]
|
||||
----
|
||||
[…]# vim /etc/systemd/nspawn/{ctname}.nspawn
|
||||
# vim /etc/systemd/nspawn/{ctname}.nspawn
|
||||
(insert)
|
||||
[Network]
|
||||
MACVLAN=enp4s0
|
||||
|
|
@ -161,9 +161,9 @@ If a connection to the external, public network is also required, two correspond
|
|||
|
||||
3. Configuration of the connection to the internal network within the container
|
||||
+
|
||||
[source,]
|
||||
[source,console]
|
||||
----
|
||||
[…]# vim /var/lib/machines/{ctname}/etc/systemd/network/20-host0.network
|
||||
# vim /var/lib/machines/{ctname}/etc/systemd/network/20-host0.network
|
||||
(insert)
|
||||
# {ctname}.localnet
|
||||
# internal network interface via bridge
|
||||
|
|
@ -186,9 +186,9 @@ If the internal network is also to be used for external access via NAT, the gate
|
|||
+
|
||||
In this case, the gateway entry _must_ be commented _out_ in the configuration of the internal network, as mentioned in item 3.
|
||||
+
|
||||
[source,]
|
||||
[source,console]
|
||||
----
|
||||
[…]# vim /var/lib/machinec/{ctname}/etc/systemd/network/10-mv.network
|
||||
# vim /var/lib/machinec/{ctname}/etc/systemd/network/10-mv.network
|
||||
(insert)
|
||||
# {ctname}.sowi.uni-bremen.de
|
||||
# public interface via mac-vlan
|
||||
|
|
@ -228,9 +228,9 @@ Don't forget to adjust interface names and IP addresses accordingly!
|
|||
+
|
||||
Check if container boots without error messages
|
||||
+
|
||||
[source,]
|
||||
[source,console]
|
||||
----
|
||||
[…]# systemd-nspawn -D /var/lib/machines/{ctname} -b
|
||||
# systemd-nspawn -D /var/lib/machines/{ctname} -b
|
||||
OK Spawning container {ctname} on /var/l…01.
|
||||
OK …
|
||||
{ctname} login:
|
||||
|
|
@ -239,33 +239,33 @@ Check if container boots without error messages
|
|||
+
|
||||
If inactive, activate and start the service.
|
||||
+
|
||||
[source,]
|
||||
[source,console]
|
||||
----
|
||||
[…]# systemctl status systemd-networkd
|
||||
# systemctl status systemd-networkd
|
||||
…
|
||||
[…]# systemctl enable systemd-networkd
|
||||
[…]# systemctl start systemd-networkd
|
||||
[…]# systemctl status systemd-networkd
|
||||
# systemctl enable systemd-networkd
|
||||
# systemctl start systemd-networkd
|
||||
# systemctl status systemd-networkd
|
||||
----
|
||||
7. Check if all network interfaces are available
|
||||
+
|
||||
[source,]
|
||||
[source,console]
|
||||
----
|
||||
[…]# ip a
|
||||
# ip a
|
||||
----
|
||||
8. Check for correct routing
|
||||
+
|
||||
[source,]
|
||||
[source,console]
|
||||
----
|
||||
[…]# ip route show
|
||||
# ip route show
|
||||
----
|
||||
9. Configure default DNS search path
|
||||
+
|
||||
Specify a search domain to appended to a unary hostname without domain part, usually the internal network domain name, e.g. example.lan. Adjust the config file according to the pattern below:
|
||||
+
|
||||
[source,]
|
||||
[source,console]
|
||||
----
|
||||
[…]# vim /etc/systemd/resolved.conf
|
||||
# vim /etc/systemd/resolved.conf
|
||||
|
||||
[Resolve]
|
||||
...
|
||||
|
|
@ -279,49 +279,49 @@ Specify a search domain to appended to a unary hostname without domain part, usu
|
|||
----
|
||||
10. Check if name resolution is configured correctly
|
||||
+
|
||||
[source,]
|
||||
[source,console]
|
||||
----
|
||||
[…]# ls -al /etc/resolv.conf
|
||||
# ls -al /etc/resolv.conf
|
||||
lrwxrwxrwx. 1 root root 39 29. Dez 12:15 /etc/resolv.conf -> ../run/systemd/resolve/stub-resolv.conf
|
||||
----
|
||||
+
|
||||
If the file is missing or is a text file, correct it.
|
||||
+
|
||||
[source,]
|
||||
[source,console]
|
||||
----
|
||||
[…]# cd /etc
|
||||
[…]# rm -f resolv.conf
|
||||
[…]# ln -s ../run/systemd/resolve/stub-resolv.conf resolv.conf
|
||||
[…]# ls -al /etc/resolv.conf
|
||||
[…]# cd
|
||||
# cd /etc
|
||||
# rm -f resolv.conf
|
||||
# ln -s ../run/systemd/resolve/stub-resolv.conf resolv.conf
|
||||
# ls -al /etc/resolv.conf
|
||||
# cd
|
||||
----
|
||||
+
|
||||
Ensure that systemd-resolved service is enabled.
|
||||
+
|
||||
[source,]
|
||||
[source,console]
|
||||
----
|
||||
[…]# systemctl status systemd-resolved
|
||||
# systemctl status systemd-resolved
|
||||
----
|
||||
+
|
||||
Activate the service if necessary.
|
||||
+
|
||||
[source,]
|
||||
[source,console]
|
||||
----
|
||||
[…]# systemctl enable systemd-resolved
|
||||
# systemctl enable systemd-resolved
|
||||
----
|
||||
|
||||
11. Set the intended hostname
|
||||
+
|
||||
[source,]
|
||||
[source,console]
|
||||
----
|
||||
[…]# hostnamectl
|
||||
[…]# hostnamectl set-hostname <FQDN>
|
||||
# hostnamectl
|
||||
# hostnamectl set-hostname <FQDN>
|
||||
----
|
||||
12. Terminate the container
|
||||
+
|
||||
[source,]
|
||||
[source,console]
|
||||
----
|
||||
[…]# <CTRL>+]]]
|
||||
# <CTRL>+]]]
|
||||
Container <CTNAME> terminated by signal KILL.
|
||||
----
|
||||
|
||||
|
|
@ -331,19 +331,19 @@ Activate the service if necessary.
|
|||
+
|
||||
This requires temporarily setting SELinux to permissive, otherwise passwd will not make any changes.
|
||||
+
|
||||
[source,]
|
||||
[source,console]
|
||||
----
|
||||
[…]# setenforce 0
|
||||
[…]# systemd-nspawn -D /var/lib/machines/{ctname} passwd
|
||||
[…]# setenforce 1
|
||||
# setenforce 0
|
||||
# systemd-nspawn -D /var/lib/machines/{ctname} passwd
|
||||
# setenforce 1
|
||||
----
|
||||
2. Configuration of container properties
|
||||
+
|
||||
Specifying private user configuration and shared network access.
|
||||
+
|
||||
[source,]
|
||||
[source,console]
|
||||
----
|
||||
[…]# vim /etc/systemd/nspawn/{ctname}.nspawn
|
||||
# vim /etc/systemd/nspawn/{ctname}.nspawn
|
||||
(insert)
|
||||
[Exec]
|
||||
PrivateUsers=false
|
||||
|
|
@ -355,9 +355,9 @@ Specifying private user configuration and shared network access.
|
|||
+
|
||||
Check if container boots without error messages
|
||||
+
|
||||
[source,]
|
||||
[source,console]
|
||||
----
|
||||
[…]# systemd-nspawn -b -D /var/lib/machines/{ctname}
|
||||
# systemd-nspawn -b -D /var/lib/machines/{ctname}
|
||||
OK Spawning container {ctname} on /var/l…01.
|
||||
OK …
|
||||
{ctname} login:
|
||||
|
|
@ -366,32 +366,32 @@ Check if container boots without error messages
|
|||
+
|
||||
If active, deactivate the service.
|
||||
+
|
||||
[source,]
|
||||
[source,console]
|
||||
----
|
||||
[…]# systemctl status systemd-networkd
|
||||
# systemctl status systemd-networkd
|
||||
…
|
||||
[…]# systemctl disable systemd-networkd
|
||||
[…]# systemctl stop systemd-networkd
|
||||
[…]# systemctl status systemd-networkd
|
||||
[…]# systemctl status systemd-resolved
|
||||
# systemctl disable systemd-networkd
|
||||
# systemctl stop systemd-networkd
|
||||
# systemctl status systemd-networkd
|
||||
# systemctl status systemd-resolved
|
||||
…
|
||||
[…]# systemctl disable systemd-resolved
|
||||
[…]# systemctl stop systemd-resolved
|
||||
[…]# systemctl status systemd-resolved
|
||||
# systemctl disable systemd-resolved
|
||||
# systemctl stop systemd-resolved
|
||||
# systemctl status systemd-resolved
|
||||
----
|
||||
+
|
||||
If file /etc/resolv.conf is a link, remove it.
|
||||
+
|
||||
[source,]
|
||||
[source,console]
|
||||
----
|
||||
[…]# rm /etc/resolv.conf
|
||||
# rm /etc/resolv.conf
|
||||
----
|
||||
+
|
||||
Create (or edit an existing) file /etc/resolv.conf
|
||||
+
|
||||
[source,]
|
||||
[source,console]
|
||||
----
|
||||
[…]# vim /etc/resolv.conf
|
||||
# vim /etc/resolv.conf
|
||||
|
||||
nameserver 127.0.0.53
|
||||
options edns0 trust-ad
|
||||
|
|
@ -399,33 +399,33 @@ search <YOUR_DOMAIN>
|
|||
----
|
||||
5. Check if all network interfaces are available
|
||||
+
|
||||
[source,]
|
||||
[source,console]
|
||||
----
|
||||
[…]# ip a
|
||||
# ip a
|
||||
----
|
||||
+
|
||||
You should see the same interfaces and IP addresses as on the host system.
|
||||
6. Check if name resolution is working correctly
|
||||
+
|
||||
[source,]
|
||||
[source,console]
|
||||
----
|
||||
[…]# ping spiegel.de
|
||||
# ping spiegel.de
|
||||
PING spiegel.de (128.65.210.8) 56(84) bytes of data.
|
||||
64 bytes from 128.65.210.8 (128.65.210.8): icmp_seq=1 ttl=59 time=19.8 ms
|
||||
...
|
||||
----
|
||||
7. Set the intended hostname
|
||||
+
|
||||
[source,]
|
||||
[source,console]
|
||||
----
|
||||
[…]# hostnamectl
|
||||
[…]# hostnamectl set-hostname <FQDN>
|
||||
# hostnamectl
|
||||
# hostnamectl set-hostname <FQDN>
|
||||
----
|
||||
8. Terminate the container
|
||||
+
|
||||
[source,]
|
||||
[source,console]
|
||||
----
|
||||
[…]# <CTRL>+]]]
|
||||
# <CTRL>+]]]
|
||||
Container <CTNAME> terminated by signal KILL.
|
||||
----
|
||||
|
||||
|
|
@ -435,11 +435,11 @@ You should see the same interfaces and IP addresses as on the host system.
|
|||
+
|
||||
In this step, a separate UID/GID range is automatically created for the container.
|
||||
+
|
||||
[source,]
|
||||
[source,console]
|
||||
----
|
||||
[…]# systemctl enable systemd-nspawn@{ctname}
|
||||
[…]# systemctl start systemd-nspawn@{ctname}
|
||||
[…]# systemctl status systemd-nspawn@{ctname}
|
||||
# systemctl enable systemd-nspawn@{ctname}
|
||||
# systemctl start systemd-nspawn@{ctname}
|
||||
# systemctl status systemd-nspawn@{ctname}
|
||||
----
|
||||
+
|
||||
On first boot after installing systemd-container, a SELinux bug currently (Fedora 34/35) blocks execution. The solution is to fix the SELinux label(s).
|
||||
|
|
@ -451,10 +451,10 @@ On first boot after installing systemd-container, a SELinux bug currently (Fedor
|
|||
+
|
||||
The proposed solution is roughly as follows:
|
||||
+
|
||||
[source,]
|
||||
[source,console]
|
||||
----
|
||||
[…]# ausearch -c 'systemd-machine' --raw | audit2allow -M my-systemdmachine
|
||||
[…]# semodule -i my-systemdmachine.pp
|
||||
# ausearch -c 'systemd-machine' --raw | audit2allow -M my-systemdmachine
|
||||
# semodule -i my-systemdmachine.pp
|
||||
----
|
||||
* The operation must be repeated until no SELinux error is reported and the container starts as a service.
|
||||
+
|
||||
|
|
@ -462,18 +462,18 @@ Alternatively, the SELinux CLI tool can be used, which also suggests these solut
|
|||
|
||||
2. Enable automatic start of the container at system startup
|
||||
+
|
||||
[source,]
|
||||
[source,console]
|
||||
----
|
||||
[…]# systemctl enable systemd-nspawn@{ctname}
|
||||
[…]# systemctl status systemd-nspawn@{ctname}
|
||||
# systemctl enable systemd-nspawn@{ctname}
|
||||
# systemctl status systemd-nspawn@{ctname}
|
||||
----
|
||||
|
||||
3. Log in to the container
|
||||
+
|
||||
[source,]
|
||||
[source,console]
|
||||
----
|
||||
[…]# setenforce 0
|
||||
[…]# machinectl login {ctname}
|
||||
# setenforce 0
|
||||
# machinectl login {ctname}
|
||||
----
|
||||
+
|
||||
When machinectl is called with parameters for the first time, an SELinux bug (Fedora 34/35) also blocks execution. The correction is done in the same way as for the container start.
|
||||
|
|
@ -488,18 +488,18 @@ In case of a CentOS 8-stream container, the epel repository should be installed
|
|||
+
|
||||
After finishing all further work inside the container press <ctrl>]]] ( Mac: <ctrl><alt>666) to exit the container and reactivate SELinux.
|
||||
+
|
||||
[source,]
|
||||
[source,console]
|
||||
----
|
||||
[…]# setenforce 1
|
||||
# setenforce 1
|
||||
----
|
||||
|
||||
=== 3.1 Autostart of the container on reboot of the host
|
||||
|
||||
An autostart of the container in the "enabled" state fails on Fedora 35 and older. The cause can be seen in a status query after rebooting the host, which issues an error message according to the following example:
|
||||
|
||||
[source,]
|
||||
[source,console]
|
||||
----
|
||||
[…]# systemctl status systemd-nspawn@CT_NAME
|
||||
# systemctl status systemd-nspawn@CT_NAME
|
||||
systemd-nspawn[802]: Failed to add interface vb-{CT_NAME} to bridge vbr6s0: No such device
|
||||
----
|
||||
|
||||
|
|
@ -509,9 +509,9 @@ This means that systemd starts the container before all required network interfa
|
|||
|
||||
1. The service file requires an amendment (Bug #2001631). In section [Unit], for the `Wants=` and `After=` configurations, add a target `network-online.target` at the end of each line. The file must then look like this (ignore the commented out marker rows):
|
||||
+
|
||||
[source,]
|
||||
[source,console]
|
||||
----
|
||||
[…]# systemctl edit systemd-nspawn@ --full
|
||||
# systemctl edit systemd-nspawn@ --full
|
||||
...
|
||||
[Unit]
|
||||
Description=Container %i
|
||||
|
|
@ -530,9 +530,9 @@ Important is the character "@" after `nspawn`! In the opening editor make the in
|
|||
|
||||
2. Then execute
|
||||
+
|
||||
[source,]
|
||||
[source,console]
|
||||
----
|
||||
[…]# systemctl daemon-reload
|
||||
# systemctl daemon-reload
|
||||
----
|
||||
|
||||
At the next reboot the containers will be started automatically.
|
||||
|
|
@ -541,10 +541,10 @@ At the next reboot the containers will be started automatically.
|
|||
|
||||
For such interfaces (usually the bridge virbr0) the addition mentioned above does not help. The container must be started by script in an extra step after Libvirt initialization is complete. For this you can use a hook that Libvirt provides.
|
||||
|
||||
[source,]
|
||||
[source,console]
|
||||
----
|
||||
[…]# mkdir -p /etc/libvirt/hooks/network.d/
|
||||
[…]# vim /etc/libvirt/hooks/network.d/50-start-nspawn-container.sh
|
||||
# mkdir -p /etc/libvirt/hooks/network.d/
|
||||
# vim /etc/libvirt/hooks/network.d/50-start-nspawn-container.sh
|
||||
(INSERT)
|
||||
#!/bin/bash
|
||||
# Check defined nspawn container in /var/lib/machines and
|
||||
|
|
@ -589,7 +589,7 @@ if [ "$network" == "default" ]; then
|
|||
fi
|
||||
fi
|
||||
|
||||
[…]# chmod +x /etc/libvirt/hooks/network.d/50-start-nspawn-container.sh
|
||||
# chmod +x /etc/libvirt/hooks/network.d/50-start-nspawn-container.sh
|
||||
----
|
||||
You may also use the link:{attachmentsdir}/nspawn-autostart-libvirt-hook.tgz[attached script] instead of typing.
|
||||
|
||||
|
|
@ -603,20 +603,20 @@ For dnf / rpm queries the error message is displayed:
|
|||
The cause is that Fedora's dfn, which is used for the installation, uses sqlite while CentOS/RHEL use the Berkeley (bdb) format.
|
||||
|
||||
Check configuration within the running container:
|
||||
[source,]
|
||||
[source,console]
|
||||
----
|
||||
[…]# rpm -E "%{_db_backend}"
|
||||
# rpm -E "%{_db_backend}"
|
||||
----
|
||||
The output must be `bdb`. Then fix it executing
|
||||
[source,]
|
||||
[source,console]
|
||||
----
|
||||
[…]# rpmdb --rebuilddb
|
||||
# rpmdb --rebuilddb
|
||||
----
|
||||
|
||||
=== 4.2 Error message dev-hugepages
|
||||
|
||||
You will find message such as
|
||||
[source,]
|
||||
[source,console]
|
||||
----
|
||||
dev-hugepages.mount: Mount process exited, code=exited, status=32/n/a
|
||||
dev-hugepages.mount: Failed with result 'exit-code'.
|
||||
|
|
@ -632,9 +632,9 @@ The messages can be safely ignored.
|
|||
Some packages, e.g. the `filesystem` package, may not get updated in a container (error message "Error: Transaction failed"), see also https://bugzilla.redhat.com/show_bug.cgi?id=1548403 and https://bugzilla.redhat.com/show_bug.cgi?id=1912155.
|
||||
|
||||
Workaround: Run before update:
|
||||
[source,]
|
||||
[source,console]
|
||||
----
|
||||
[…]# echo '%_netsharedpath /sys:/proc' > /etc/rpm/macros.netshared
|
||||
# echo '%_netsharedpath /sys:/proc' > /etc/rpm/macros.netshared
|
||||
----
|
||||
When an update has already been performed, execute this command and update the package again.
|
||||
|
||||
|
|
|
|||
|
|
@ -110,37 +110,37 @@ Fedora 43 updates Postgresql from version 16 directly to version 18, skipping on
|
|||
+
|
||||
[source]
|
||||
----
|
||||
[…]$ systemctl status postgresql
|
||||
[…]$ sudo tar -cvJf /var/lib/pgsql/backups/postgres16-bak.tzx /var/lib/pgsql/data/
|
||||
$ systemctl status postgresql
|
||||
$ sudo tar -cvJf /var/lib/pgsql/backups/postgres16-bak.tzx /var/lib/pgsql/data/
|
||||
----
|
||||
2. Replace installed version 18 by version 17 und use it to update your database
|
||||
+
|
||||
[source]
|
||||
----
|
||||
[…]$ sudo dnf install postgresql17-server postgresql17-upgrade --allowerasing
|
||||
[…]$ sudo -u postgres postgresql-upgrade /var/lib/pgsql/data
|
||||
$ sudo dnf install postgresql17-server postgresql17-upgrade --allowerasing
|
||||
$ sudo -u postgres postgresql-upgrade /var/lib/pgsql/data
|
||||
----
|
||||
3. Stop postgres and activate checksums which is a new default in version 18
|
||||
+
|
||||
[source]
|
||||
----
|
||||
[…]$ systemctl stop postgresql
|
||||
[…]$ sudo -u postgres pg_checksums -D /var/lib/pgsql/data -e -P
|
||||
$ systemctl stop postgresql
|
||||
$ sudo -u postgres pg_checksums -D /var/lib/pgsql/data -e -P
|
||||
----
|
||||
4. Reinstall version 18 and update the data again
|
||||
+
|
||||
[source]
|
||||
----
|
||||
[…]$ mv /var/lib/pgsql/data_old /var/lib/pgsql/data_old_16
|
||||
[…]$ sudo dnf install postgresql-server postgresql-upgrade --allowerasing
|
||||
[…]$ sudo -u postgres postgresql-upgrade /var/lib/pgsql/data
|
||||
$ mv /var/lib/pgsql/data_old /var/lib/pgsql/data_old_16
|
||||
$ sudo dnf install postgresql-server postgresql-upgrade --allowerasing
|
||||
$ sudo -u postgres postgresql-upgrade /var/lib/pgsql/data
|
||||
----
|
||||
5. Start postgresql und check if everything works again
|
||||
+
|
||||
[source]
|
||||
----
|
||||
[…]$ sudo systemctl start postgresql
|
||||
[…]$ sudo systemctl status postgresql
|
||||
$ sudo systemctl start postgresql
|
||||
$ sudo systemctl status postgresql
|
||||
----
|
||||
6. Execute the maintenance steps as recommended by the update program and fix collation issues if exist.
|
||||
7. Done
|
||||
|
|
|
|||
|
|
@ -82,17 +82,17 @@ Here we describe the basic steps for creating a customized boot medium (SD card
|
|||
+
|
||||
[source,bash]
|
||||
----
|
||||
[…]$ sudo dnf -y install arm-image-installer uboot-images-armv8.noarch
|
||||
$ sudo dnf -y install arm-image-installer uboot-images-armv8.noarch
|
||||
----
|
||||
|
||||
2. Set the download directory as default, fetch a Fedora Server aarch64 system disk raw image, here F43, and check the integrity of the download.
|
||||
+
|
||||
[source,bash]
|
||||
----
|
||||
[…]$ cd ~/Downloads
|
||||
[…]$ wget https://download.fedoraproject.org/pub/fedora/linux/releases/43/Server/aarch64/images/Fedora-Server-Host-Generic-43-1.6.aarch64.raw.xz
|
||||
[…]$ wget https://download.fedoraproject.org/pub/fedora/linux/releases/43/Server/aarch64/images/Fedora-Server-43-1.6-aarch64-CHECKSUM
|
||||
[…]$ sha256sum -c *-CHECKSUM --ignore-missing
|
||||
$ cd ~/Downloads
|
||||
$ wget https://download.fedoraproject.org/pub/fedora/linux/releases/43/Server/aarch64/images/Fedora-Server-Host-Generic-43-1.6.aarch64.raw.xz
|
||||
$ wget https://download.fedoraproject.org/pub/fedora/linux/releases/43/Server/aarch64/images/Fedora-Server-43-1.6-aarch64-CHECKSUM
|
||||
$ sha256sum -c *-CHECKSUM --ignore-missing
|
||||
Fedora-Server-Host-Generic-43-1.6.aarch64.raw.xz: OK
|
||||
sha256sum: WARNING: 17 lines are improperly formatted
|
||||
----
|
||||
|
|
@ -103,7 +103,7 @@ The result message includes a complain about some not correct formated lines. It
|
|||
+
|
||||
[source,text]
|
||||
----
|
||||
[…]$ lsblk
|
||||
$ lsblk
|
||||
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
|
||||
sda 8:0 0 596,2G 0 disk
|
||||
├─sda1 8:1 0 600M 0 part /boot/efi
|
||||
|
|
@ -122,14 +122,14 @@ zram0 252:0 0 7,5G 0 disk [SWAP]
|
|||
+
|
||||
[source,bash]
|
||||
----
|
||||
[…]$ sudo umount /dev/mmcblk0p1
|
||||
$ sudo umount /dev/mmcblk0p1
|
||||
----
|
||||
|
||||
5. Identify the name of the support files for your board
|
||||
+
|
||||
[source,bash]
|
||||
----
|
||||
[…]$ sudo arm-image-installer --supported
|
||||
$ sudo arm-image-installer --supported
|
||||
AllWinner Devices:
|
||||
A10-OLinuXino-Lime A10s-OLinuXino-M A13-OLinuXino A13-OLinuXinoM A20-OLinuXino-Lime A20-OLinuXino-Lime2
|
||||
A20-OLinuXino-Lime2-eMMC A20-OLinuXino_MICRO A20-Olimex-SOM-EVB Ampe_A76 Auxtek-T003 Auxtek-T004 Bananapi
|
||||
|
|
@ -152,7 +152,7 @@ If you don't find your board, check the _boards.d_ directory directly just in ca
|
|||
+
|
||||
[source,bash]
|
||||
----
|
||||
[…]$ ls -al /usr/share/arm-image-installer/boards.d | less
|
||||
$ ls -al /usr/share/arm-image-installer/boards.d | less
|
||||
----
|
||||
+
|
||||
As an example., you will find the PINE64 "ROCKPro64" model as "rockpro64-rk3399"
|
||||
|
|
@ -161,14 +161,14 @@ As an example., you will find the PINE64 "ROCKPro64" model as "rockpro64-rk3399"
|
|||
+
|
||||
[source,bash]
|
||||
----
|
||||
[…]$ sudo arm-image-installer --image=Fedora-Server-Host-Generic-43-1.6.aarch64.raw.xz --target=rockpro64-rk3399 --media=/dev/mmcblk0
|
||||
$ sudo arm-image-installer --image=Fedora-Server-Host-Generic-43-1.6.aarch64.raw.xz --target=rockpro64-rk3399 --media=/dev/mmcblk0
|
||||
----
|
||||
+
|
||||
Just in case you already decided to fill the complete space on disk with the root file system and to dispense with segmentation, you may add the resizefs parameter which would result in an _alternative command line_:
|
||||
+
|
||||
[source,bash]
|
||||
----
|
||||
[…]$ arm-image-installer --image=Fedora-Server-Host-Generic-43-1.6.aarch64.raw.xz --target=rockpro64-rk3399 --resizefs --media=/dev/mmcblk0
|
||||
$ arm-image-installer --image=Fedora-Server-Host-Generic-43-1.6.aarch64.raw.xz --target=rockpro64-rk3399 --resizefs --media=/dev/mmcblk0
|
||||
----
|
||||
+
|
||||
Remember, this is definitely _not a recommended option_ for serious production server operation!
|
||||
|
|
@ -186,7 +186,7 @@ At the SBC terminal, we perform only the minimum, absolutely necessary configura
|
|||
2. Connect monitor, keyboard and network cable, insert the micro SD card.
|
||||
3. Connect the SBC to power and wait. After some time a lot of messages scroll across the screen. If the network interface doesn't provide DHCP, in includes a NetworkManager error message. You can safely ignore it for now. It finally ends with a simple, text-based input mask for the first boot configuration.
|
||||
+
|
||||
[source,]
|
||||
[source,console]
|
||||
----
|
||||
SoC Rockchip rk3399
|
||||
Reset cause: POR
|
||||
|
|
@ -214,7 +214,7 @@ The menu is quite simple and a bit old-fashioned, but effective and straightforw
|
|||
|
||||
4. The most important item is the configuration of an admin user and their password. Type 5 to enter the submenu.
|
||||
+
|
||||
[source,]
|
||||
[source,console]
|
||||
----
|
||||
================================================================================
|
||||
================================================================================
|
||||
|
|
@ -291,8 +291,8 @@ b. If you are a non-US keyboard user, configure your keyboard mapping. Fist list
|
|||
+
|
||||
[source,bash]
|
||||
----
|
||||
[…]$ localectl list-keymaps
|
||||
[…]$ sudo localectl setkeymap de-nodeadkeys
|
||||
$ localectl list-keymaps
|
||||
$ sudo localectl setkeymap de-nodeadkeys
|
||||
----
|
||||
+
|
||||
The mapping is imediately active.
|
||||
|
|
@ -301,20 +301,20 @@ c. Configure and activate the network. Adjust the IP, gateway and network settin
|
|||
+
|
||||
First, check the existing interfaces.
|
||||
+
|
||||
[source,]
|
||||
[source,console]
|
||||
----
|
||||
[…]# nmcli con
|
||||
# nmcli con
|
||||
NAME UUID TYPE DEVICE
|
||||
'Wired connection 2' 8d971f49-033f-398a-9714-3a4e848178fb ethernet enp2s0
|
||||
----
|
||||
+
|
||||
Most likely your interfaces are named somewhat awkward way. Let's fix that to make administration of network easier and more comfortable. Don't forget to adjust the naming to your specific installation!
|
||||
+
|
||||
[source,]
|
||||
[source,console]
|
||||
----
|
||||
[…]$ sudo nmcli con mod 'Wired connection 1' connection.id end0
|
||||
$ sudo nmcli con mod 'Wired connection 1' connection.id end0
|
||||
|
||||
[…]$ sudo nmcli con mod end0 \
|
||||
$ sudo nmcli con mod end0 \
|
||||
ipv4.method manual \
|
||||
ipv4.address "xxx.xxx.xxx.xxx/yy" \
|
||||
ipv4.gateway "xxx.xxx.xxx.zzz" \
|
||||
|
|
@ -325,8 +325,8 @@ Most likely your interfaces are named somewhat awkward way. Let's fix that to ma
|
|||
ipv6.dns "xxxx.xxxx.xxxx.xxxx::vvv" \
|
||||
connection.zone "FedoraServer"
|
||||
|
||||
[…]$ sudo nmcli con up end0
|
||||
[…]$ sudo systemctl restart NetworkManager
|
||||
$ sudo nmcli con up end0
|
||||
$ sudo systemctl restart NetworkManager
|
||||
----
|
||||
d. Reboot. You can then disconnect monitor and keyboard. The next steps all happen on the desktop.
|
||||
|
||||
|
|
@ -405,7 +405,7 @@ Any of the alternatives as above start with the same administrative tasks.
|
|||
+
|
||||
[source,bash]
|
||||
----
|
||||
[…]$ sudo cfdisk /dev/mmcblk1
|
||||
$ sudo cfdisk /dev/mmcblk1
|
||||
----
|
||||
4. Select partition 3 (Type 8e Linux LVM) using <Cursor down> and then Resize using <Curser left>
|
||||
+
|
||||
|
|
@ -423,7 +423,7 @@ Select "Write", confirm resizing and quit the program.
|
|||
+
|
||||
[source,bash]
|
||||
----
|
||||
[…]$ sudo pvresize /dev/mmcblk1p3
|
||||
$ sudo pvresize /dev/mmcblk1p3
|
||||
Physical volume "/dev/mmcblk1p3" changed
|
||||
1 physical volume(s) resized or updated / 0 physical volume(s) not resized
|
||||
----
|
||||
|
|
@ -440,9 +440,9 @@ For *alternative 3.* select "Grow" and expand the volume to a size that still le
|
|||
|
||||
9. Go back to the terminal.
|
||||
+
|
||||
[source,]
|
||||
[source,console]
|
||||
----
|
||||
[…]$ sudo df -h
|
||||
$ sudo df -h
|
||||
----
|
||||
+
|
||||
Confirm that the size of the root file system is now of the specified value.
|
||||
|
|
@ -463,8 +463,8 @@ Because in this case Cockpit is started and active on the device, use your Fedor
|
|||
+
|
||||
[source,bash]
|
||||
----
|
||||
[…]$ sudo dnf install nmap
|
||||
[…]$ sudo nmap -Pn -p9090 192.168.158.0/24
|
||||
$ sudo dnf install nmap
|
||||
$ sudo nmap -Pn -p9090 192.168.158.0/24
|
||||
Starting Nmap 7.80 ( https://nmap.org ) at 2023-03-23 08:18 CEST
|
||||
Nmap scan report for fritz.box (192.168.158.1)
|
||||
Host is up (0.00052s latency).
|
||||
|
|
@ -513,9 +513,9 @@ Beforehand you need to create pair of SSH keys if not already exist. It is best
|
|||
+
|
||||
[source,bash]
|
||||
----
|
||||
[…]$ cd
|
||||
[…]$ mkdir ~/.ssh
|
||||
[…]$ ssh-keygen -t rsa -b 4096 -C "root@example.com" -f ~/.ssh/<outputkeyfile>
|
||||
$ cd
|
||||
$ mkdir ~/.ssh
|
||||
$ ssh-keygen -t rsa -b 4096 -C "root@example.com" -f ~/.ssh/<outputkeyfile>
|
||||
----
|
||||
+
|
||||
As an example you may use the name "__id_mysbc_rsa__". Although the type rsa is widely used, you may adjust your key type accordingly.
|
||||
|
|
@ -524,8 +524,8 @@ Turn off the SBC, remove the SD card and connect it to your desktop again as in
|
|||
+
|
||||
[source,bash]
|
||||
----
|
||||
[…]$ cd
|
||||
[…]$ sudo arm-image-installer --image=Fedora-Server-Host-Generic-43-1.6.aarch64.raw.xz --target=rockpro-rk3399 --addkey=~/.ssh/id_mysbc_rsa.pub --media=/dev/mmcblk0
|
||||
$ cd
|
||||
$ sudo arm-image-installer --image=Fedora-Server-Host-Generic-43-1.6.aarch64.raw.xz --target=rockpro-rk3399 --addkey=~/.ssh/id_mysbc_rsa.pub --media=/dev/mmcblk0
|
||||
----
|
||||
+
|
||||
When the process has finished, reinstall the CD card in the SBC, and connect to power to start the device again.
|
||||
|
|
@ -534,8 +534,8 @@ Ping the address and as soon as you are connected, use ssh to log in.
|
|||
+
|
||||
[source,bash]
|
||||
----
|
||||
[…]$ ping 192.168.158.120
|
||||
[…]$ ssh -i .ssh/id_mysbc_rsa root@192.168.158.172
|
||||
$ ping 192.168.158.120
|
||||
$ ssh -i .ssh/id_mysbc_rsa root@192.168.158.172
|
||||
----
|
||||
+
|
||||
You can now create an user account, set the password and add it to group wheel to grant administrative sudo privileges.
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@ To get an overview of available graphical user interfaces, simply list all insta
|
|||
+
|
||||
[source,bash]
|
||||
----
|
||||
[…]# dnf group list
|
||||
# dnf group list
|
||||
----
|
||||
You will find
|
||||
* KDE Plasma Workspaces
|
||||
|
|
@ -33,14 +33,14 @@ You may either use the groups pretty name as shown in the group listing or the c
|
|||
+
|
||||
[source,bash]
|
||||
----
|
||||
[…]# dnf groupinstall "Cinnamon Desktop"
|
||||
# dnf groupinstall "Cinnamon Desktop"
|
||||
----
|
||||
+
|
||||
or
|
||||
+
|
||||
[source,bash]
|
||||
----
|
||||
[…]# dnf install @cinnamon-desktop-environment
|
||||
# dnf install @cinnamon-desktop-environment
|
||||
----
|
||||
3. *Adjustment of systemd to start in graphic mode*
|
||||
+
|
||||
|
|
@ -48,14 +48,14 @@ To boot into graphical mode by default, you have to adjust the default target.
|
|||
+
|
||||
[source,bash]
|
||||
----
|
||||
[…]# systemctl set-default graphical.target
|
||||
# systemctl set-default graphical.target
|
||||
----
|
||||
+
|
||||
With some desktop you may also need:
|
||||
+
|
||||
[source,bash]
|
||||
----
|
||||
[…]# systemctl enable gdm.service
|
||||
# systemctl enable gdm.service
|
||||
----
|
||||
+
|
||||
Try it, but you may get a "Service not found" message with some desktops. No need to worry, the installed desktop will come up without that.
|
||||
|
|
@ -63,7 +63,7 @@ Try it, but you may get a "Service not found" message with some desktops. No nee
|
|||
+
|
||||
[source,bash]
|
||||
----
|
||||
[…]# reboot
|
||||
# reboot
|
||||
----
|
||||
+
|
||||
Your system will start with the selected graphical desktop.
|
||||
|
|
@ -73,13 +73,13 @@ Your system will start with the selected graphical desktop.
|
|||
You may install multiple desktops. The utilities `switchdesk` and `switchdesk-gui` can be used to switch the desktop GUI.
|
||||
[source,bash]
|
||||
----
|
||||
[…]# dnf install switchdesk switchdesk-gui
|
||||
# dnf install switchdesk switchdesk-gui
|
||||
----
|
||||
|
||||
In a terminal window, you can directly switch to another desktop:
|
||||
[source,bash]
|
||||
----
|
||||
[…]# switchdesk cinnamon
|
||||
# switchdesk cinnamon
|
||||
----
|
||||
|
||||
Without naming the new desktop, a window with the available options will be displayed.
|
||||
|
|
@ -90,12 +90,12 @@ The graphical `_Desktop Switcher_` is included in the Systemadministration menu
|
|||
You can switch back to booting to a text console:
|
||||
[source,bash]
|
||||
----
|
||||
[…]# systemctl set-default multi-user.target
|
||||
[…]# reboot
|
||||
# systemctl set-default multi-user.target
|
||||
# reboot
|
||||
----
|
||||
|
||||
After having switched back into text mode, you can switch to the selected desktop just for the current session using
|
||||
|
||||
[…]# startx
|
||||
# startx
|
||||
|
||||
However, this does not work flawlessly for every available desktop.
|
||||
Loading…
Add table
Add a link
Reference in a new issue