Install Proxmox VE with NAT on Hetzner: Difference between revisions
No edit summary |
No edit summary |
||
| Line 4: | Line 4: | ||
curl http://download.proxmox.com/iso/proxmox-ve_8.2-1.iso -o /tmp/proxmox-ve.iso | curl http://download.proxmox.com/iso/proxmox-ve_8.2-1.iso -o /tmp/proxmox-ve.iso | ||
</pre> | </pre> | ||
2. Might need to install qemu and ovmf: | 2. Might need to install qemu and ovmf: | ||
| Line 9: | Line 10: | ||
sudo apt-get install -y qemu ovmf | sudo apt-get install -y qemu ovmf | ||
</pre> | </pre> | ||
== Install == | == Install == | ||
1. Start system in rescue mode | 1. Start system in rescue mode | ||
2. Set variables | 2. Set variables | ||
| Line 29: | Line 32: | ||
3. Start qemu with installer cd-rom: | 3. Start qemu with installer cd-rom: | ||
<pre> | <pre> | ||
qemu-system-x86_64 -daemonize -enable-kvm -m 10240 -k en-us \ | qemu-system-x86_64 -daemonize -enable-kvm -m 10240 -k en-us \ | ||
| Line 44: | Line 45: | ||
</pre> | </pre> | ||
4. Stop the virtual machine: | |||
4. Connect to the system via VNC: | |||
Use the port 5900 and install the system. At the end, uncheck the restart option | |||
5. Stop the virtual machine: | |||
<pre> | <pre> | ||
printf "quit\n" | nc 127.0.0.1 4444 | printf "quit\n" | nc 127.0.0.1 4444 | ||
</pre> | |||
6. Start again without the installer: | |||
<pre> | |||
qemu-system-x86_64 -daemonize -enable-kvm -m 10240 -k en-us \ | |||
-drive file=/dev/$PRIMARY_DISK,format=raw,media=disk,if=virtio,id=$PRIMARY_DISK \ | |||
-drive file=/dev/$SECONDARY_DISK,format=raw,media=disk,if=virtio,id=$SECONDARY_DISK \ | |||
-drive file=/dev/$THIRD_DISK,format=raw,media=disk,if=virtio,id=$THIRD_DISK \ | |||
-drive file=/usr/share/OVMF/OVMF_CODE.fd,if=pflash,format=raw,readonly=on \ | |||
-drive file=/usr/share/OVMF/OVMF_VARS.fd,if=pflash,format=raw \ | |||
-vnc :0,password=on -monitor telnet:127.0.0.1:4444,server,nowait \ | |||
-net user,hostfwd=tcp::2222-:22 -net nic | |||
echo "change vnc password th1s1sSCRT" | nc -q 1 127.0.0.1 4444 | |||
</pre> | </pre> | ||
Revision as of 16:52, 28 August 2024
Prequisites
1. Download PVE iso:
curl http://download.proxmox.com/iso/proxmox-ve_8.2-1.iso -o /tmp/proxmox-ve.iso
2. Might need to install qemu and ovmf:
sudo apt-get install -y qemu ovmf
Install
1. Start system in rescue mode
2. Set variables
INTERFACE_NAME=$(udevadm info -q property /sys/class/net/eth0 | grep "ID_NET_NAME_PATH=" | cut -d'=' -f2)
IP_CIDR=$(ip addr show eth0 | grep "inet\b" | awk '{print $2}')
GATEWAY=$(ip route | grep default | awk '{print $3}')
IP_ADDRESS=$(echo "$IP_CIDR" | cut -d'/' -f1)
CIDR=$(echo "$IP_CIDR" | cut -d'/' -f2)
# Get the primary and secondary disks
PRIMARY_DISK=$(lsblk -dn -o NAME,SIZE,TYPE -e 1,7,11,14,15 | sed -n 3p | awk '{print $1}')
SECONDARY_DISK=$(lsblk -dn -o NAME,SIZE,TYPE -e 1,7,11,14,15 | sed -n 1p | awk '{print $1}')
THIRD_DISK=$(lsblk -dn -o NAME,SIZE,TYPE -e 1,7,11,14,15 | sed -n 2p | awk '{print $1}')
3. Start qemu with installer cd-rom:
qemu-system-x86_64 -daemonize -enable-kvm -m 10240 -k en-us \ -drive file=/dev/$PRIMARY_DISK,format=raw,media=disk,if=virtio,id=$PRIMARY_DISK \ -drive file=/dev/$SECONDARY_DISK,format=raw,media=disk,if=virtio,id=$SECONDARY_DISK \ -drive file=/dev/$THIRD_DISK,format=raw,media=disk,if=virtio,id=$THIRD_DISK \ -drive file=/usr/share/OVMF/OVMF_CODE.fd,if=pflash,format=raw,readonly=on \ -drive file=/usr/share/OVMF/OVMF_VARS.fd,if=pflash,format=raw \ -cdrom /tmp/proxmox-ve.iso -boot d \ -vnc :0,password=on -monitor telnet:127.0.0.1:4444,server,nowait echo "change vnc password pa$$w0rd6" | nc -q 1 127.0.0.1 4444
4. Connect to the system via VNC:
Use the port 5900 and install the system. At the end, uncheck the restart option
5. Stop the virtual machine:
printf "quit\n" | nc 127.0.0.1 4444
6. Start again without the installer:
qemu-system-x86_64 -daemonize -enable-kvm -m 10240 -k en-us \ -drive file=/dev/$PRIMARY_DISK,format=raw,media=disk,if=virtio,id=$PRIMARY_DISK \ -drive file=/dev/$SECONDARY_DISK,format=raw,media=disk,if=virtio,id=$SECONDARY_DISK \ -drive file=/dev/$THIRD_DISK,format=raw,media=disk,if=virtio,id=$THIRD_DISK \ -drive file=/usr/share/OVMF/OVMF_CODE.fd,if=pflash,format=raw,readonly=on \ -drive file=/usr/share/OVMF/OVMF_VARS.fd,if=pflash,format=raw \ -vnc :0,password=on -monitor telnet:127.0.0.1:4444,server,nowait \ -net user,hostfwd=tcp::2222-:22 -net nic echo "change vnc password th1s1sSCRT" | nc -q 1 127.0.0.1 4444