Customizations to Proxmox VE 6.0 Persistent

This document worked for VE 7.X edition too.

Preparation

First, we’ll create a directory where we’ll store our customizations (you can call it whatever you want, as long as you are consistent across the commands):

$ sudo mkdir /usr/share/custom

Next, create the script which will apply the customizations and make it executable:

$ sudo echo '#!/usr/bin/env bash' > /usr/share/custom/apply.sh
$ sudo chmod a+x /usr/share/custom/apply.sh

Create the Hook

Finally, create a file telling apt to execute the script after being invoked:

$ sudo echo 'DPkg::Post-Invoke { "/usr/share/custom/apply.sh"; };' > /etc/apt/apt.conf.d/90custom

Now /usr/share/custom/apply.sh will be executed when apt installs or upgrades a package, reapplying the customizations. Be careful of what you put in there, though!

Read more

Share

Preparing Cloud-Init Templates

The first step is to prepare your VM. Basically you can use any VM. Simply install the Cloud-Init packages inside the VM that you want to prepare. On Debian/Ubuntu based systems this is as simple as:

apt-get install cloud-init

This command is not intended to be executed on the Proxmox VE host, but only inside the VM.

Already many distributions provide ready-to-use Cloud-Init images (provided as .qcow2 files), so alternatively you can simply download and import such images. For the following example, we will use the cloud image provided by Ubuntu at https://cloud-images.ubuntu.com.

# download the image
wget https://cloud-images.ubuntu.com/bionic/current/bionic-server-cloudimg-amd64.img
# create a new VM with VirtIO SCSI controller
qm create 9000 --memory 2048 --net0 virtio,bridge=vmbr0 --scsihw virtio-scsi-pci
# import the downloaded disk to the local-lvm storage, attaching it as a SCSI drive
qm set 9000 --scsi0 local-lvm:0,import-from=/path/to/bionic-server-cloudimg-amd64.img

Ubuntu Cloud-Init images require the virtio-scsi-pci controller type for SCSI drives.

The next step is to configure a CD-ROM drive, which will be used to pass the Cloud-Init data to the VM.

Read more

Share

Proxmox Firewall Service Disable using Command

Chrooting and then doing:

systemctl disable pve-firewall
systemctl mask pve-firewall

should do the trick. then after rebooting and fixing your config,

systemctl unmask pve-firewall
systemctl enable pve-firewall
systemctl start pve-firewall

Should return to the defaults again.

Ports used by Proxmox VE

  • Web interface: 8006 (TCP, HTTP/1.1 over TLS)
  • VNC Web console: 5900-5999 (TCP, WebSocket
  • SPICE proxy: 3128 (TCP)
  • sshd (used for cluster actions): 22 (TCP)
  • rpcbind: 111 (UDP)
  • sendmail: 25 (TCP, outgoing)
  • corosync cluster traffic: 5405-5412 UDP
  • live migration (VM memory and local-disk data): 60000-60050 (TCP)

Ref:
https://pve.proxmox.com/wiki/Firewall
https://forum.proxmox.com/threads/how-to-disable-pve-firewall-after-lock-out-datacenter-level-firewall.60557/

Share

Migrating Windows 2022 from proxmox to Oracle Cloud Infrastructure (OCI)

I was doing a requirement work where a customized windows 2022 needs to be ported to OCI. In order to achieve this, following steps were considered-

  1. Creating a KVM virtual guest on my Proxmox 7 Infra and install windows 2022 with virtio drivers.
  2. Stopping the VM and copying the qcow2 file to OCI object storage
  3. Importing custom image from object storage and create an OCI instance.
  4. Accessing the newly created OCI instances.

Step-1: Creating a windows 2022 guest VM on Proxmox node

In order to create the vm, I selected the following parameters for vm specification-

Read more

Share

Proxmox create VXLAN using its native SDN

Prerequisite:

You need to have an Installed Proxmox and Configure a Clustered setup.

The first step in any installation is to make sure your hosts are updated. By default, Proxmox hosts will reach out to the enterprise repository, so I need to configure the pve-no-subscription repository. To enable that, I added it to /etc/apt/sources.list like the image below.

Add the pve-no-subscription repository

After adding the repository, I run an apt update and upgrade to install the latest patches and make sure the new repository works.

# apt update && apt upgrade -y

Now I can install the needed dependencies on each host. Important note here, the next few steps are run on EVERY node in the cluster.

Read more

Share

Importing Legacy Windows XP or Windows 2003 from Virtualbox to Proxmox

Problem Statement:

  • I have an old Windows 2003 32 bit server running in Virtualbox.
  • Since Virtualbox is under decommissioned, it is intended to be migrated to Proxmox VE

Before Migration or export of VM from Virtualbox, following .reg file is required to be installed on Windows 2003 server to avoid IDE incompatibility and avoid BSOD or Blue Scree of Death

Download file: https://pve.proxmox.com/mediawiki/images/f/f5/Mergeide.zip

Once the registry file is imported, you can shut down the virtual machine and start exporting.

You can follow my earlier post of https://tweenpath.net/convert-virtualbox-vm-proxmox-ve/ and continue.

This worked on Windows 2003 the same will work for Windows XP VM.

Share

Install Proxmox 7 on Debian 12

Install a standard Debian Bookworm, for details consider the Debian installation guide, and configure a static IP.

Note: The Debian installer performs network configuration by IPv6 autoconfiguration and DHCP by default, if available. To force manual network configuration in the UEFI installer, press E and add netcfg/disable_autoconfig=true to the linux command line. For the BIOS installer, select the Help entry and start the installation by typing installgui netcfg/disable_autoconfig=true. For further details, see the Debian installer documentation.

It is recommended to only install the “standard system utilities” and “SSH server” package selection, as Proxmox VE brings its own packages for QEMU and LXC. A desktop environment is not necessary.

Add an /etc/hosts entry for your IP address

The hostname of your machine must be resolvable via /etc/hosts. This means that in /etc/hosts you need one of the following entries for your hostname:

Read more

Share

Fixing Proxmox Delete user failed: cannot update tfa config, following nodes are not up to date:

Please check if all the nodes are on the same package versions: run

pveversion -v

and compare the outputs.

If they’re not matching, you can run

apt update && apt dist-upgrade

To upgrade the nodes. if there’s a kernel upgrade you will also need to reboot the machines. If after the upgrades you still don’t see the same versions of the packages, then maybe you have wrong repositories set up [0]

Share

VNC Client Access on Proxmox KVM guests

Configure VNC Access in the Configuration File

Add a line to the VM’s configuration file /etc/pve/local/qemu-server/<VMID>.conf which specifies the VNC display number as follows (“77” in the example below):

args: -vnc 0.0.0.0:77

If you want to use password protection, add:

args: -vnc 0.0.0.0:77,password=on

The display number can be freely chosen, but each number must occur only once. The VNC service then listens at port 5900+display_number. Note that connections via noVNC use display number 0 and following, therefore it is recommended to use higher numbers in order to avoid conflicts.

You can now connect the VNC client to the host IP address and port as chosen (“5977” in the example above).

Read more

Share