---
# System prepended metadata

title: CentOS8 setup
tags: [c4lab]

---

# CentOS8 setup
###### tags: `c4lab`

## Download Iso
Download `CentOS-8.2.2004-x86_64-minimal.iso`
http://isoredirect.centos.org/centos/8/isos/x86_64/
Copy Image to USB via Rufus and use USB to boot

## Setup Netowrk
`/etc/sysconfig/network-scripts/*`
```
ONBOOT = true
```

And set interface device up
```
ifup eno1
```

## Upgrade and install basic packages
```
cat /etc/centos-release
sudo yum update -y
sudo yum install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm
sudo yum install -y vim git python3-pip htop yum-utils lftp
```

## Podman
https://podman.io/getting-started/installation.html
```
sudo dnf -y module disable container-tools
sudo dnf -y install 'dnf-command(copr)'
sudo dnf -y copr enable rhcontainerbot/container-selinux
sudo curl -L -o /etc/yum.repos.d/devel:kubic:libcontainers:stable.repo https://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/stable/CentOS_8/devel:kubic:libcontainers:stable.repo
sudo dnf -y install podman fuse-overlayfs
```

## ZFS
https://openzfs.github.io/openzfs-docs/Getting%20Started/RHEL%20and%20CentOS.html
```
sudo yum install -y http://download.zfsonlinux.org/epel/zfs-release.el8_2.noarch.rpm
sudo yum install -y epel-release
sudo yum-config-manager --disable zfs
sudo yum-config-manager --enable zfs-kmod
sudo yum install zfs
sudo yum install zfs
```

## grub(If needed)
```
vim /etc/default/grub
sudo grub2-mkconfig -o /boot/efi/EFI/centos/grub.cfg
```

## NVIDIA runtime
```
sudo yum install -y elfutils-libelf-devel
sudo yum group install -y "Development Tools"

```
https://hackmd.io/o3p8vAUvRi6EVfIV56W-sA#Install-Driver

```
curl -s -L https://nvidia.github.io/nvidia-docker/centos8/nvidia-docker.repo | sudo tee /etc/yum.repos.d/nvidia-docker.repo
sudo dnf repolist -v -y
sudo dnf clean expire-cache --refresh
sudo dnf install -y nvidia-container-runtime
sudo dnf install nvidia-docker2
```
```
sudo nvidia-persistenced --persistence-mode
```


## Setup Podman
`/etc/containers/containers.conf`
``` toml
[containers]
hooks_dir = [
 "/usr/share/containers/oci/hooks.d/"
]
label = false

[engine]
cgroup_manager = "cgroupfs"

[engine.runtimes]
runc = [
        "/usr/lib/cri-o-runc/sbin/runc",
        "/usr/sbin/runc",
        "/usr/bin/runc",
        "/usr/local/bin/runc",
        "/usr/local/sbin/runc",
        "/sbin/runc",
        "/bin/runc",
]

nvidia = [
        "/usr/bin/nvidia-container-runtime",
]
```

`/etc/nvidia-container-runtime/config.toml`
```
[nvidia-container-cli]
no-cgroups = true
```

and run

Original command
``` !
podman run  --rm -it -v $PWD:/app --hooks-dir /usr/share/containers/oci/hooks.d  --security-opt=label=disable linnil1/torch python3 main.py
```

### You can also setup config per user
https://hackmd.io/o3p8vAUvRi6EVfIV56W-sA?both#User-config

## nfs
```
sudo yum -y install nfs-utils
```