{"id":2602,"date":"2021-12-23T02:06:42","date_gmt":"2021-12-23T02:06:42","guid":{"rendered":"https:\/\/dft.wiki\/?p=2602"},"modified":"2026-01-19T13:31:10","modified_gmt":"2026-01-19T18:31:10","slug":"proxmox-cheat-sheet","status":"publish","type":"post","link":"https:\/\/dft.wiki\/?p=2602","title":{"rendered":"Proxmox VE and Backup Server Cheat Sheet"},"content":{"rendered":"<p><strong>Proxmox Virtual Environment<\/strong> (PVE) is an open-source hypervisor manager.<\/p>\n<p>Based on Debian and with a modified Ubuntu LTS kernel, it allows deployment and management of virtual machines (KVM) and containers (LXD).<\/p>\n<p>Unlike XCP-ng, Proxmox VE includes a web interface and provides a REST API for third-party tools.<\/p>\n<p>It can be downloaded for free at [<a href=\"https:\/\/proxmox.com\/en\/downloads\/category\/iso-images-pve\">Link<\/a>]. If necessary, use the USB Imager to create a bootable thumb drive [<a href=\"https:\/\/gitlab.com\/bztsrc\/usbimager\">Link<\/a>].<\/p>\n<hr \/>\n<p>Creating a bootable USB for installation:<\/p>\n<pre>dd bs=1M conv=fdatasync if=.\/proxmox-ve_<strong>8.4-1<\/strong>.iso of=\/dev\/sd<strong>c<\/strong><\/pre>\n<p>Updating and upgrading:<\/p>\n<pre>apt update\r\napt upgrade -y\r\napt dist-upgrade -y<\/pre>\n<p>In order to avoid error messages about a repo that is not signed (because it requires a subscription), comment all lines in the file <code>\/etc\/apt\/sources.list.d\/pve-enterprise.list<\/code> and append:<\/p>\n<pre>deb http:\/\/download.proxmox.com\/debian\/pve bookworm pve-no-subscription<\/pre>\n<p>Go to your browser to https:\/\/<strong>192.168.1.103<\/strong>:8006\/ and create a new and strong password for the default user <strong>root<\/strong>.<\/p>\n<hr \/>\n<p><strong>CLI COMMANDS<\/strong><\/p>\n<ul>\n<li>man qm<\/li>\n<li>qm list<\/li>\n<li>qm start 100<\/li>\n<li>qm shutdown 100<\/li>\n<li>qm reboot 100<\/li>\n<li>qm reset 100<\/li>\n<li>qm stop 100<\/li>\n<li>qm config 100<\/li>\n<li>qm set -onboot 1 100<\/li>\n<li>man pct<\/li>\n<li>pct list<\/li>\n<li>pct start 101<\/li>\n<li>pct shutdown 101<\/li>\n<li>pct reboot 101<\/li>\n<li>pct config 101<\/li>\n<li>pct set -memory 1024 101<\/li>\n<li>pct enter 101<\/li>\n<\/ul>\n<hr \/>\n<p><strong>INSTALLING THE GUEST AGENT<\/strong><\/p>\n<pre>sudo apt install qemu-guest-agent -y<\/pre>\n<hr \/>\n<p><strong>BEFORE CREATING AN IMAGE FROM A VM<\/strong><\/p>\n<pre>sudo rm -rf \/etc\/ssh\/ssh_host_*\r\nsudo truncate -s 0 \/etc\/machine-id\r\nsudo dpkg-reconfigure openssh-server<\/pre>\n<hr \/>\n<p><strong>IMPORTING A VM<\/strong><\/p>\n<pre>wget http:\/\/192.168.1.100:8080\/Kali-Linux-2021.4-virtualbox-amd64.ova\r\ntar xvf Kali-Linux-2021.4-virtualbox-amd64.ova\r\nqm importovf 100 .\/Kali-Linux-2021.4-virtualbox-amd64.ovf Storage --format qcow2<\/pre>\n<p>If the import of the disk (*.ovf) fails, create a new VM manually, then:<\/p>\n<pre>qemu-img convert -f vmdk Kali-Linux-2021.4-virtualbox-amd64-disk001.vmdk Kali-disk001.qcow2 -O qcow2\r\nqm importdisk 100 Kali-disk001.qcow2 Storage<\/pre>\n<hr \/>\n<p><strong>OTHER CLI TIPS<\/strong><\/p>\n<p>Wiping a secondary disk from CLI:<\/p>\n<pre>wipefs -fa \/dev\/<strong>nvme0n1<\/strong>\r\ndd if=\/dev\/zero of=\/dev\/<strong>nvme0n1<\/strong> bs=1M count=1000\r\nudevadm settle\r\nreboot<\/pre>\n<hr \/>\n<p><strong>APPLIANCE MANAGER<\/strong><\/p>\n<pre>pveam update\r\npveam available\r\npveam download local debian-10-turnkey-nextcloud_16.1-1_amd64.tar.gz<\/pre>\n<hr \/>\n<p><strong>ATTACHING AN USB DEVICE TO A VM (PASSTHROUGH)<\/strong><\/p>\n<p>On the example below, I am attaching a Wireless Adapter model AX200 from Intel (WIFI-6).<\/p>\n<pre>lsusb | grep AX200<\/pre>\n<p><strong>Output:<\/strong> Bus 001 Device 002: ID <strong>8087:0029<\/strong> Intel Corp. AX200 Bluetooth<\/p>\n<pre>qm set <strong>112<\/strong> -usb0 host=<strong>8087:0029<\/strong>,usb3=yes<\/pre>\n<p><strong>Output: <\/strong>update VM <strong>112<\/strong>: -usb0 host=<strong>8087:0029\u00a0<\/strong><\/p>\n<p>OR<\/p>\n<p>Using the Web-UI:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-3037 aligncenter\" src=\"https:\/\/dft.wiki\/wp-content\/uploads\/sites\/15\/2021\/12\/Screenshot_2022-06-19_18-55-29.png\" alt=\"\" width=\"607\" height=\"346\" srcset=\"https:\/\/dft.wiki\/wp-content\/uploads\/sites\/15\/2021\/12\/Screenshot_2022-06-19_18-55-29.png 607w, https:\/\/dft.wiki\/wp-content\/uploads\/sites\/15\/2021\/12\/Screenshot_2022-06-19_18-55-29-300x171.png 300w\" sizes=\"auto, (max-width: 607px) 100vw, 607px\" \/><\/p>\n<p>Experiment to find the option that matches better to your needs:<\/p>\n<p style=\"text-align: center;\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-3040\" src=\"https:\/\/dft.wiki\/wp-content\/uploads\/sites\/15\/2021\/12\/Screenshot_2022-06-19_18-55-50_.png\" alt=\"\" width=\"366\" height=\"224\" srcset=\"https:\/\/dft.wiki\/wp-content\/uploads\/sites\/15\/2021\/12\/Screenshot_2022-06-19_18-55-50_.png 366w, https:\/\/dft.wiki\/wp-content\/uploads\/sites\/15\/2021\/12\/Screenshot_2022-06-19_18-55-50_-300x184.png 300w\" sizes=\"auto, (max-width: 366px) 100vw, 366px\" \/> <img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-3041\" src=\"https:\/\/dft.wiki\/wp-content\/uploads\/sites\/15\/2021\/12\/Screenshot_2022-06-19_20-06-28.png\" alt=\"\" width=\"365\" height=\"222\" srcset=\"https:\/\/dft.wiki\/wp-content\/uploads\/sites\/15\/2021\/12\/Screenshot_2022-06-19_20-06-28.png 365w, https:\/\/dft.wiki\/wp-content\/uploads\/sites\/15\/2021\/12\/Screenshot_2022-06-19_20-06-28-300x182.png 300w\" sizes=\"auto, (max-width: 365px) 100vw, 365px\" \/><\/p>\n<p>Pull and list the latest list of available container templates:<\/p>\n<pre>sudo pveam update\r\nsudo pveam available<\/pre>\n<hr \/>\n<p><strong>ATTACHING DISK TO A VM (PASSTHROUGH)<\/strong><\/p>\n<p>Stop the VM, then set the disk you want to attach.<\/p>\n<pre>qm set <strong>101<\/strong> -scsi1 \/dev\/sd<strong>X<\/strong><\/pre>\n<hr \/>\n<p><strong>PROXMOX BACKUP SERVER (PBS)<\/strong><\/p>\n<p>PBS is an open-source backup software for VMs, containers, and physical (Debian\/Ubuntu) hosts [<a href=\"https:\/\/www.proxmox.com\/en\/downloads\/category\/proxmox-backup-server\">Link<\/a>].<\/p>\n<p>After the installation, the web interface of the PBS will be available on port 8007 (i.e., https:\/\/10.10.10.10:8007\/).<\/p>\n<p>Installing PBS Client on Debian\/Ubuntu physical instances:<\/p>\n<pre>echo \"deb [arch=amd64] http:\/\/download.proxmox.com\/debian\/pbs-client bullseye main\" | sudo tee \/etc\/apt\/sources.list.d\/pbs-client.list\r\nsudo wget http:\/\/enterprise.proxmox.com\/debian\/proxmox-release-bullseye.gpg -O \/etc\/apt\/trusted.gpg.d\/proxmox-release-bullseye.gpg\r\nsudo apt update\r\nsudo apt install proxmox-backup-client -y<\/pre>\n<p>Backing up the root of the file system:<\/p>\n<pre>sudo su -\r\nproxmox-backup-client backup root.pxar:\/ --repository 10.10.10.10:backup1<\/pre>\n<p>Backing up with encryption key:<\/p>\n<pre>proxmox-backup-client key create backup.key\r\nproxmox-backup-client backup root.pxar:\/ --repository 10.10.10.10:backup1 --keyfile .\/backup.key<\/pre>\n<p>Listing backups and snapshots:<\/p>\n<pre>proxmox-backup-client list --repository 10.10.10.10:backup1\r\nproxmox-backup-client snapshot list --repository 10.10.10.10:backup1<\/pre>\n<p>Creating an environment variable for the target repository:<\/p>\n<pre>export PBS_REPOSITORY=\"10.10.10.10:backup1\"\r\necho $PBS_REPOSITORY<\/pre>\n<p>Mapping a directory from the Host to the Guest CT:<\/p>\n<pre>sudo nano \/etc\/pve\/nodes\/&lt;NODE&gt;\/lxc\/&lt;ID&gt;.conf<\/pre>\n<pre>...\r\nmp0: \/HOST\/PATH\/,mp=\/GUEST\/PATH,mountoptions=noatime<\/pre>\n<hr \/>\n<p><strong>BONUS<\/strong><\/p>\n<p>Proxmox officially does not run on <strong>Raspberry Pi,<\/strong>\u00a0but <strong>Pimox<\/strong> does [<a href=\"https:\/\/github.com\/pimox\/pimox7\">Link<\/a>].<\/p>\n<p><strong>Pimox<\/strong> is an adapted build of Proxmox that was tailored to work on the <strong>Raspberry Pi 4<\/strong>.<\/p>\n<p>See the following post with a step-by-step to install, configure, and leverage [<a href=\"https:\/\/dft.wiki\/?p=3430\">Link<\/a>].<\/p>\n<p>Apply <strong>NAT<\/strong> to the network on <code>vmbr1<\/code>:<\/p>\n<pre>sudo nano \/etc\/sysctl.conf<\/pre>\n<pre>net.ipv4.ip_forward = 1<\/pre>\n<pre>sudo nano \/etc\/nftables.conf<\/pre>\n<pre>table inet nat {\r\n    chain prerouting {\r\n        type nat hook prerouting priority -100; policy accept;\r\n    }\r\n    chain postrouting {\r\n        type nat hook postrouting priority 100; policy accept;\r\n        oifname \"vmbr0\" masquerade\r\n    }\r\n}\r\ntable inet filter {\r\n    chain forward {\r\n        type filter hook forward priority 0; policy drop;\r\n        iifname \"vmbr1\" oifname \"vmbr0\" accept\r\n        ct state established,related accept\r\n    }\r\n}<\/pre>\n<pre>sudo sysctl -p\r\nsudo nft -f \/etc\/nftables.conf<\/pre>\n<p><strong>Disabling, recovering, and managing MFA via CLI.<\/strong><\/p>\n<pre>mv \/etc\/pve\/priv\/tfa.cfg \/etc\/pve\/priv\/tfa.crg<strong>_DISABLED<\/strong><\/pre>\n<pre>mv \/etc\/pve\/priv\/tfa.cfg<strong>_DISABLED<\/strong> \/etc\/pve\/priv\/tfa.cfg<\/pre>\n<p><strong>Running SNAP packages inside LXC<\/strong><\/p>\n<p>On Proxmox, edit the LXC config.<\/p>\n<pre>nano \/etc\/pve\/lxc\/<strong>XXX<\/strong>.conf<\/pre>\n<p>Then add the following lines.<\/p>\n<pre>lxc.mount.entry = \/dev\/fuse dev\/fuse none bind,create=file,optional\r\nlxc.mount.auto=cgroup:rw<\/pre>\n<p>Inside the LXC, install the following dependencies.<\/p>\n<pre>sudo apt update &amp;&amp; sudo apt dist-upgrade\r\nsudo apt install squashfuse fuse\r\nsudo apt install snapd\r\nsudo mkdir \/lib\/modules<\/pre>\n<p>Install the Snap package. It might fail the first time, but <span style=\"text-decoration: underline;\"><strong>it will work on the second attempt<\/strong><\/span>.<\/p>\n<p><strong>Tips for IPv4 and IPv6 Networks<\/strong><\/p>\n<p>This example has a &#8220;<strong>WAN<\/strong>&#8221; interface configured, and two isolated &#8220;<strong>LANs<\/strong>&#8221; where one of them is on a <strong>Physical IPv4<\/strong> and the other is a <strong>Virtual IPv6<\/strong>.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-5103\" src=\"https:\/\/dft.wiki\/wp-content\/uploads\/sites\/15\/2021\/12\/Screenshot_2025-08-02_11-13-27.png\" alt=\"\" width=\"1163\" height=\"158\" srcset=\"https:\/\/dft.wiki\/wp-content\/uploads\/sites\/15\/2021\/12\/Screenshot_2025-08-02_11-13-27.png 1163w, https:\/\/dft.wiki\/wp-content\/uploads\/sites\/15\/2021\/12\/Screenshot_2025-08-02_11-13-27-300x41.png 300w, https:\/\/dft.wiki\/wp-content\/uploads\/sites\/15\/2021\/12\/Screenshot_2025-08-02_11-13-27-1024x139.png 1024w, https:\/\/dft.wiki\/wp-content\/uploads\/sites\/15\/2021\/12\/Screenshot_2025-08-02_11-13-27-768x104.png 768w\" sizes=\"auto, (max-width: 1163px) 100vw, 1163px\" \/><\/p>\n<pre>auto lo\r\niface lo inet loopback\r\n\r\niface enp0s31f6 inet manual\r\n\r\niface enx7cc2c6357dd7 inet manual\r\n\r\nauto vmbr0\r\niface vmbr0 inet static\r\n        address 192.168.1.103\/24\r\n        gateway 192.168.1.1\r\n        bridge-ports enp0s31f6\r\n        bridge-stp off\r\n        bridge-fd 0\r\n#IPv4 LAN\r\n\r\nauto vmbr1\r\niface vmbr1 inet static\r\n        address 10.1.1.1\/24\r\n        bridge-ports enx7cc2c6357dd7\r\n        bridge-stp off\r\n        bridge-fd 0\r\n#IPv4 PXE\r\n\r\nauto vmbr2\r\niface vmbr2 inet6 static\r\n        address 2a11:6c7:2000:c500::1\/56\r\n        bridge-ports none\r\n        bridge-stp off\r\n        bridge-fd 0\r\n#IPv6 Only\r\n\r\nsource \/etc\/network\/interfaces.d\/*<\/pre>\n<p>For aggregating multiple physical adapters into one logical.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-5113\" src=\"https:\/\/dft.wiki\/wp-content\/uploads\/sites\/15\/2021\/12\/Screenshot_2025-08-02_15-08-54.png\" alt=\"\" width=\"1041\" height=\"182\" srcset=\"https:\/\/dft.wiki\/wp-content\/uploads\/sites\/15\/2021\/12\/Screenshot_2025-08-02_15-08-54.png 1041w, https:\/\/dft.wiki\/wp-content\/uploads\/sites\/15\/2021\/12\/Screenshot_2025-08-02_15-08-54-300x52.png 300w, https:\/\/dft.wiki\/wp-content\/uploads\/sites\/15\/2021\/12\/Screenshot_2025-08-02_15-08-54-1024x179.png 1024w, https:\/\/dft.wiki\/wp-content\/uploads\/sites\/15\/2021\/12\/Screenshot_2025-08-02_15-08-54-768x134.png 768w\" sizes=\"auto, (max-width: 1041px) 100vw, 1041px\" \/><\/p>\n<p>&nbsp;<\/p>\n<pre>auto lo\r\niface lo inet loopback\r\n\r\nauto nic0\r\niface nic0 inet manual\r\n\r\nauto nic1\r\niface nic1 inet manual\r\n\r\nauto nic2\r\niface nic2 inet manual\r\n\r\nauto nic3\r\niface nic3 inet manual\r\n\r\nauto bond0\r\niface bond0 inet manual\r\n        bond-slaves nic0 nic1 nic2 nic3\r\n        bond-miimon 100\r\n        bond-mode 802.3ad\r\n        bond-xmit-hash-policy layer2+3\r\n\r\nauto vmbr0\r\niface vmbr0 inet static\r\n        address 192.168.1.104\/24\r\n        gateway 192.168.1.1\r\n        bridge-ports bond0\r\n        bridge-stp off\r\n        bridge-fd 0\r\n\r\nsource \/etc\/network\/interfaces.d\/*<\/pre>\n<p><strong>Enable No-Subscription Package Repository<\/strong><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-5104\" src=\"https:\/\/dft.wiki\/wp-content\/uploads\/sites\/15\/2021\/12\/Screenshot_2025-08-02_11-07-32.png\" alt=\"\" width=\"1412\" height=\"700\" srcset=\"https:\/\/dft.wiki\/wp-content\/uploads\/sites\/15\/2021\/12\/Screenshot_2025-08-02_11-07-32.png 1412w, https:\/\/dft.wiki\/wp-content\/uploads\/sites\/15\/2021\/12\/Screenshot_2025-08-02_11-07-32-300x149.png 300w, https:\/\/dft.wiki\/wp-content\/uploads\/sites\/15\/2021\/12\/Screenshot_2025-08-02_11-07-32-1024x508.png 1024w, https:\/\/dft.wiki\/wp-content\/uploads\/sites\/15\/2021\/12\/Screenshot_2025-08-02_11-07-32-768x381.png 768w\" sizes=\"auto, (max-width: 1412px) 100vw, 1412px\" \/><\/p>\n<hr \/>\n<p><strong>DHCP ON PROXMOX<\/strong><\/p>\n<pre>nano \/etc\/network\/interfaces<\/pre>\n<pre>auto vmbr0\r\niface vmbr0 inet dhcp\r\n        bridge-ports bond0\r\n        bridge-stp off\r\n        bridge-fd 0<\/pre>\n<pre>ifreload -a<\/pre>\n<hr \/>\n<p><strong>TROUBLESHOTING<\/strong><\/p>\n<p>Eventually, a new drive attached ot the data drives left behind after re-installing Proxmox might get stuck.<\/p>\n<pre>dmsetup ls\r\ndmsetup remove &lt;NAME_TO_REMOVE&gt;<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Proxmox Virtual Environment (PVE) is an open-source hypervisor manager. Based on Debian and with a [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4],"tags":[],"class_list":["post-2602","post","type-post","status-publish","format-standard","hentry","category-linux"],"_links":{"self":[{"href":"https:\/\/dft.wiki\/index.php?rest_route=\/wp\/v2\/posts\/2602","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/dft.wiki\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/dft.wiki\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/dft.wiki\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/dft.wiki\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=2602"}],"version-history":[{"count":33,"href":"https:\/\/dft.wiki\/index.php?rest_route=\/wp\/v2\/posts\/2602\/revisions"}],"predecessor-version":[{"id":5250,"href":"https:\/\/dft.wiki\/index.php?rest_route=\/wp\/v2\/posts\/2602\/revisions\/5250"}],"wp:attachment":[{"href":"https:\/\/dft.wiki\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2602"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/dft.wiki\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=2602"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/dft.wiki\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=2602"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}