# Proxmox

# Install



# Default

1. Graphical option
2. Just do it
3. [https://docs.napo280.ovh/link/1#bkmrk-page-title](https://docs.napo280.ovh/link/1#bkmrk-page-title)

# Old screens (black screen issue)

use [https://dev-pages.info/troubleshooting-proxmox-installation-issues-fixing-black-screen-problem/](https://dev-pages.info/troubleshooting-proxmox-installation-issues-fixing-black-screen-problem/) to fix it

# Nodes



# Rename

[https://pve.proxmox.com/wiki/Renaming\_a\_PVE\_node](https://pve.proxmox.com/wiki/Renaming_a_PVE_node)

# Ceph



# Install

Use proxmox WebUI, no special options needed

# Pool setup

Setup osds

Create a pool, set min size to 2 ( min size and size are nb of hosts )  
After it was created, set it to 1. This is not recommended, but for now we only have 1 host operational ( and with enough storage )

# Remove

```
systemctl stop ceph-mon.target
systemctl stop ceph-mgr.target
systemctl stop ceph-mds.target
systemctl stop ceph-osd.target
rm -rf /etc/systemd/system/ceph*
killall -9 ceph-mon ceph-mgr ceph-mds
rm -rf /var/lib/ceph/mon/  /var/lib/ceph/mgr/  /var/lib/ceph/mds/
pveceph purge
apt purge ceph-mon ceph-osd ceph-mgr ceph-mds
apt purge ceph-base ceph-mgr-modules-core
rm -rf /etc/ceph/*
rm -rf /etc/pve/ceph.conf
rm -rf /etc/pve/priv/ceph.*
```

These HAVE to be run on each nodes

Don't forget to restart your node after running these commands !

# Lvm



# Remove old drives

Delete it in proxmox web UI

If ghost drive, go to your node's /etc/pve/storage.cfg file and edit it.

# Vm



# Create a vm

Using proxmox webUI, don't forget to check Qemu agent.  
After having installed it EACH vm, don't forget to remove CD/DVD iso as it won't be used anymore, otherwise you'll get an error if you need to migrate your vm.

# Resize vm disk

- Resize disk in the vm's hardware tab using proxmox webUI
- Find disk's name (usually for us sda)
- launch parted `parted /dev/sda`
- use `print` to print the current partition table (replace sda with disk's name)
- resize your taget partition with `resizepart <PART's ID>  100%`
- Finally, `quit` parted and run `resize2fs /dev/sda{PART's ID}`

<span style="color: rgb(0, 0, 0);">Useful : [https://stackoverflow.com/questions/57302142/why-df-h-and-lsblk-show-different-sizes-of-my-one-and-only-xvda1](https://stackoverflow.com/questions/57302142/why-df-h-and-lsblk-show-different-sizes-of-my-one-and-only-xvda1)</span>

<span style="color: rgb(0, 0, 0);">Source :</span>

<span style="color: rgb(224, 62, 45);">DON'T DO PART 2 **AND** 3, do only one of them</span>  
Part 3 is a replacement or part 2.  
[https://pve.proxmox.com/wiki/Resize\_disks](https://pve.proxmox.com/wiki/Resize_disks)

# Disable swap

If you have GParted open, close it. Its Swapoff feature does not appear to to be permanent.

Open terminal and become root (su); if you have sudo enabled, you may also do for example sudo -i; see man sudo for all options):

 sudo -i (Or use sudo for each command)

Turn off the particular swap partition and / or all of the swaps:

```shell
swapoff --all
```

Make 100% sure the particular swap partition partition is off:

```shell
cat /proc/swaps
```

Open a text editor you are skilled in with this file, e.g. nano if unsure:

```shell
nano /etc/fstab
```

Comment out / remove the swap partition's UUID, e.g.:

```bash
# UUID=1d3c29bb-d730-4ad0-a659-45b25f60c37d    none    swap    sw    0    0
```

Open a text editor you are skilled in with this file, e.g. nano if unsure:

```shell
 nano /etc/initramfs-tools/conf.d/resume
```

Comment out / remove / change with 'none' the previously identified swap partition's UUID, e.g.:

```bash
RESUME=none
```

If your swap is encrypted, do the same with /etc/crypttab.

# SSH setup

 28 sudo vim /etc/ssh/sshd\_config.d/disable\_root\_login.conf  
 29 /etc/init.d/ssh reload  
 30 sudo systemctl restart ssh

sudo vim /etc/ssh/sshd\_config.d/disable\_root\_login.conf  
sudo systemctl restart sshd

arthur\_wambst@wingsBackup:~$ cat /etc/ssh/sshd\_config.d/disable\_root\_login.conf

sudo echo "ChallengeResponseAuthentication no\\nPasswordAuthentication no\\nUsePAM no\\nPermitRootLogin no" &gt; /etc/ssh/sshd\_config.d/disable\_root\_login.conf

```shell
export PORT=.
ssh-copy-id -p $PORT napo280.ovh
ssh napo280.ovh -p $PORT
```

```bash
cat <<EOF | sudo tee /etc/ssh/sshd_config.d/disable_root_login.conf   
ChallengeResponseAuthentication no
PasswordAuthentication no
UsePAM no
PermitRootLogin no
EOF
sudo systemctl restart sshd
```

arthur\_wambst@WORK-KARTOFFEL:~/TP\_assembleur$ ssh-copy-id -p 2331 napo280.ovh

# Arch install

```bash
fdisk /dev/sda
```

```
g
n
w
```

```bash
mkfs.ext4 /dev/sda1
pacman -Syy
pacman -S reflector
cp /etc/pacman.d/mirrorlist /etc/pacman.d/mirrorlist.bak
reflector -c "FR" -f 12 -l 10 -n 12 --save /etc/pacman.d/mirrorlist
mount /dev/sda1 /mnt
pacstrap /mnt base linux linux-firmware vim nano
genfstab -U /mnt >> /mnt/etc/fstab
arch-chroot /mnt
pacman -Sy grub sudo cni-plugins dhcpcd qemu-guest-agent openssh
systemctl enable --now sshd
systemctl enable --now dhcpcd
echo HOSTNAME > /etc/hostname
cat <<EOF | tee /etc/hosts  
127.0.0.1	localhost
::1		localhost
127.0.1.1	HOSTNAME
EOF
passwd
```

```bash
grub-install /dev/sda
grub-mkconfig -o /boot/grub/grub.cfg
useradd -m arthur_wambst
usermod -aG wheel,audio,video,storage arthur_wambst
passwd arthur_wambst
```

```
visudo
```

Change %wheel.... all (uncomment to allow...)

```bash
umount /mnt
shutdown now
```