Skip to content

Instantly share code, notes, and snippets.

@jxsl13
Created May 30, 2025 16:12
Show Gist options
  • Select an option

  • Save jxsl13/5e16269233c9fa52a3a8f90830592d55 to your computer and use it in GitHub Desktop.

Select an option

Save jxsl13/5e16269233c9fa52a3a8f90830592d55 to your computer and use it in GitHub Desktop.
Proxmox - Reset Linux VM for Templating
#!/bin/bash -ex
sudo apt update -y
sudo apt upgrade -y
sudo apt install cloud-init qemu-guest-agent -y
sudo apt clean
sudo apt autoremove
sudo rm /etc/ssh/ssh_host_*
sudo truncate -s 0 /etc/machine-id
sudo rm -f /var/lib/dbus/machine-id
sudo ln -s /etc/machine-id /var/lib/dbus/machine-id
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment