Howto proxmox raspberrypi5: Difference between revisions

From Vidalinux Wiki
Jump to navigation Jump to search
 
(22 intermediate revisions by the same user not shown)
Line 1: Line 1:
= install os =
download latest raspios:
wget https://downloads.raspberrypi.com/raspios_arm64/images/raspios_arm64-2024-03-15/2024-03-15-raspios-bookworm-arm64.img.xz
raspberrypi official tool for windows:
https://downloads.raspberrypi.org/imager/imager_latest.exe
raspberrypi official tool for mac:
https://downloads.raspberrypi.org/imager/imager_latest.dmg
install raspberrypi official tool on archlinux:
yay -S rpi-imager-bin
install raspberrypi official tool on ubuntu:
apt install -y https://downloads.raspberrypi.org/imager/imager_latest_amd64.deb
= configure repo =
= configure repo =
install gpg key:
download repo public gpg key:
  curl -o /usr/share/keyrings/pveport.gpg https://mirrors.apqa.cn/proxmox/debian/pveport.gpg  
  curl -o /usr/share/keyrings/pveport.gpg https://mirrors.apqa.cn/proxmox/debian/pveport.gpg  
install proxmox repo:
configure proxmox repo:
  echo "deb [deb=arm64 signed-by=/usr/share/keyrings/pveport.gpg] https://mirrors.apqa.cn/proxmox/debian/pve bookworm port" | tee /etc/apt/sources.list.d/pvport.list
  echo "deb [deb=arm64 signed-by=/usr/share/keyrings/pveport.gpg] https://mirrors.apqa.cn/proxmox/debian/pve bookworm port" | tee /etc/apt/sources.list.d/pvport.list
= configure rpi =
= configure rpi =
update to latest:
update to latest:
Line 35: Line 48:
  nameserver 8.8.8.4
  nameserver 8.8.8.4
  EOF
  EOF
permit root login:
sed -i 's|^#PermitRootLogin*.*|PermitRootLogin yes|g' /etc/ssh/sshd_config
set root password:
passwd root
= install packages =
= install packages =
install this packages:
install this packages:
Line 47: Line 65:
= access web gui =
= access web gui =
  https://192.168.77.125:8006
  https://192.168.77.125:8006
= create vm =
 
create vm using cli:
= download image =
qm create 100 --name testing --ostype l26 --cpu max --cores 1 --memory 512 --scsihw virtio-scsi-pci --net0 virtio,bridge=vmbr0 --bios ovmf --efidisk0 local:0,efitype=4m,pre-enrolled-keys=0 --serial0 socket
'''do this in another computer with more resources'''  
= costumize image =
'''do this in another machine with more resources'''  


download image:
download image:
cd /var/lib/vz/images
  wget https://cloud-images.ubuntu.com/jammy/current/jammy-server-cloudimg-arm64.img
  wget https://cloud-images.ubuntu.com/jammy/current/jammy-server-cloudimg-arm64.img
in debian install guestfs-tools:
in debian or ubuntu install guestfs-tools:
  apt install guestfs-tools -y
  apt install guestfs-tools -y
in arch install guestfs-tools:
in arch install guestfs-tools:
  pacman -S guestfs-tools --noconfirm
  pacman -S guestfs-tools --noconfirm
in rhel install libguestfs-tools:
yum install libguestfs-tools -y
change image root password:
change image root password:
  virt-sysprep -a jammy-server-cloudimg-arm64.img -q --root-password password:vidalinux
  virt-sysprep -a jammy-server-cloudimg-arm64.img -q --root-password password:vidalinux
uninstall cloud-init:
resize image:
  virt-sysprep -a jammy-server-cloudimg-arm64.img --run-command "apt remove -y cloud-init"
cp jammy-server-cloudimg-arm64.img jammy-server-cloudimg-arm64_10G.img
qemu-img resize jammy-server-cloudimg-arm64_10G.img +8G
expand image:
  virt-resize --expand /dev/sda1 jammy-server-cloudimg-arm64.img jammy-server-cloudimg-arm64_10G.img
 
= create vm =
transfer image to raspi:
scp jammy-server-cloudimg-arm64_10G.img root@192.168.77.125:/var/lib/vz/images/
create vm using cli:
qm create 100 --name ubuntu --ostype l26 --cpu max --cores 1 --memory 512 --scsihw virtio-scsi-pci --net0 virtio,bridge=vmbr0 --bios ovmf --efidisk0 local:0,efitype=4m,pre-enrolled-keys=0 --serial0 socket
add image to vm:
add image to vm:
  qm importdisk 100 ./jammy-server-cloudimg-arm64.img local
cd /var/lib/vz/images
for download lxc container images:
  qm importdisk 100 ./jammy-server-cloudimg-arm64_10G.img local
to enter with ssh edit vim /etc/ssh/sshd_config:
PermitRootLogin yes
PasswordAuthentication yes
#KbdInteractiveAuthentication no
then restart sshd service:
systemctl restart sshd
remove cloud-init:
apt remove cloud-init -y
 
= create container =
download devuan image:
wget https://images.linuxcontainers.org/images/devuan/beowulf/arm64/default/20240429_11%3A50/rootfs.tar.xz -O ./devuan-rootfs.tar.xz
create container in using pct:
pct create 102 ./devuan-rootfs.tar.xz --hostname devuan --memory 512 --net0 name=eth0,bridge=vmbr0 --storage local --unprivileged 1 --password="vidalinux" --arch arm64
 
= references =
* https://images.linuxcontainers.org/images/
* https://images.linuxcontainers.org/images/
* https://mirrors.apqa.cn/proxmox/isos/
* https://github.com/jiangcuo/Proxmox-Port/wiki/Install-Proxmox-VE-on-Debian-bookworm

Latest revision as of 17:44, 3 May 2024

install os

download latest raspios:

wget https://downloads.raspberrypi.com/raspios_arm64/images/raspios_arm64-2024-03-15/2024-03-15-raspios-bookworm-arm64.img.xz

raspberrypi official tool for windows:

https://downloads.raspberrypi.org/imager/imager_latest.exe

raspberrypi official tool for mac:

https://downloads.raspberrypi.org/imager/imager_latest.dmg

install raspberrypi official tool on archlinux:

yay -S rpi-imager-bin

install raspberrypi official tool on ubuntu:

apt install -y https://downloads.raspberrypi.org/imager/imager_latest_amd64.deb

configure repo

download repo public gpg key:

curl -o /usr/share/keyrings/pveport.gpg https://mirrors.apqa.cn/proxmox/debian/pveport.gpg 

configure proxmox repo:

echo "deb [deb=arm64 signed-by=/usr/share/keyrings/pveport.gpg] https://mirrors.apqa.cn/proxmox/debian/pve bookworm port" | tee /etc/apt/sources.list.d/pvport.list

configure rpi

update to latest:

apt update && apt dist-upgrade -y

add hostname to /etc/host:

cat >> /etc/hosts << EOF
127.0.0.1 localhost
127.0.1.1 raspberrypi
192.168.77.125 raspberrypi
EOF

edit network configuration:

cat >> /etc/network/interfaces << EOF
# loopback
auto lo
iface lo inet loopback
# eth0
iface eth0 inet static
# vmbr0 bridge
auto vmbr0
iface vmbr0 inet static
        address 192.168.77.125
        netmask 255.255.255.0
        gateway 192.168.77.254
        bridge-ports eth0
        bridge-stp off
        bridge-fd 0
EOF

configure nameservers:

cat >> /etc/resolv.conf << EOF
nameserver 8.8.8.8
nameserver 8.8.8.4
EOF

permit root login:

sed -i 's|^#PermitRootLogin*.*|PermitRootLogin yes|g' /etc/ssh/sshd_config

set root password:

passwd root

install packages

install this packages:

apt install ifupdown2 bridge-utils rsyslog -y

install firmware:

apt install pve-edk2-firmware -y

install proxmox packages:

apt install proxmox-ve postfix open-iscsi chrony mmc-utils usbutils pve-edk2-firmware-aarch64 -y

reboot system:

reboot

access web gui

https://192.168.77.125:8006

download image

do this in another computer with more resources

download image:

wget https://cloud-images.ubuntu.com/jammy/current/jammy-server-cloudimg-arm64.img

in debian or ubuntu install guestfs-tools:

apt install guestfs-tools -y

in arch install guestfs-tools:

pacman -S guestfs-tools --noconfirm

in rhel install libguestfs-tools:

yum install libguestfs-tools -y

change image root password:

virt-sysprep -a jammy-server-cloudimg-arm64.img -q --root-password password:vidalinux

resize image:

cp jammy-server-cloudimg-arm64.img jammy-server-cloudimg-arm64_10G.img
qemu-img resize jammy-server-cloudimg-arm64_10G.img +8G

expand image:

virt-resize --expand /dev/sda1 jammy-server-cloudimg-arm64.img jammy-server-cloudimg-arm64_10G.img

create vm

transfer image to raspi:

scp jammy-server-cloudimg-arm64_10G.img root@192.168.77.125:/var/lib/vz/images/

create vm using cli:

qm create 100 --name ubuntu --ostype l26 --cpu max --cores 1 --memory 512 --scsihw virtio-scsi-pci --net0 virtio,bridge=vmbr0 --bios ovmf --efidisk0 local:0,efitype=4m,pre-enrolled-keys=0 --serial0 socket

add image to vm:

cd /var/lib/vz/images
qm importdisk 100 ./jammy-server-cloudimg-arm64_10G.img local

to enter with ssh edit vim /etc/ssh/sshd_config:

PermitRootLogin yes
PasswordAuthentication yes
#KbdInteractiveAuthentication no

then restart sshd service:

systemctl restart sshd

remove cloud-init:

apt remove cloud-init -y

create container

download devuan image:

wget https://images.linuxcontainers.org/images/devuan/beowulf/arm64/default/20240429_11%3A50/rootfs.tar.xz -O ./devuan-rootfs.tar.xz

create container in using pct:

pct create 102 ./devuan-rootfs.tar.xz --hostname devuan --memory 512 --net0 name=eth0,bridge=vmbr0 --storage local --unprivileged 1 --password="vidalinux" --arch arm64

references