script

  1. B

    [TUTORIAL] After searching for a way to automagically connect to SPICE and coming up empty handed, I've created a script for anyone with the same issue!

    Let me preface this by saying this is specifically for Windows. A large part of my solution actually uses the officially recommended BASH script, and what I've created is essentially a batch file that executes said script on a remote Linux machine and then copies the output to be executed by the...
  2. S

    Edit configuration before starting VM through custom hook script

    First of all I would like to thank the Proxmox team for the great software and the nice community they built. I'm using a custom hook script (hookscript.pl) to manage VMs on a system with various GPUs passed through. The first motivation to do so is to avoid a VM (which requires a GPU) being...
  3. C

    Start VM => run rsync => stop VM

    Hello all I am looking for suggestions or maybe an ready to use script to accomplish this scenario: Start a VM on schedule => run rsync (may take awhile) => stop VM Thx in advance.
  4. T

    [TUTORIAL] Aussperrschutz, wenn man an der Proxmox Firewall (iptables) rumschraubt

    Wer kennt das nicht, man will die PVE Kiste securen und erstellt Rules in den iptables. Plötzlich hat man sich selber ausgesperrt. Ärgerlich und kann dann nur noch mittels Rescuemodus behoben werden. Bei grossen Kisten mit vielen VMs ist das nicht sonderlich toll. Habe mir ein Script...
  5. J

    My `pct create` script: seeking feedback, have questions about `--storage`

    1. can anyone find problems or offer general feedback on the script below? (The IP addresses have been redacted. Said script seems to run fine in initial testing.) 2. I have questions about the --rootfs vs --storage options as noted in my post reply below. 3. Is there a collection of...
  6. G

    [SOLVED] "script":"Only root may set this option."

    In PVE5 we could'n add serial port via user, only via root, in PVE6 it became possible. In PVE6 (6.2-11), method --script in api call "/api2/json/nodes/{node}/vzdump" executed under admin user causes the same error: {"data":null,"errors":{"script":"Only root may set this option."}} Can we expect...
  7. D

    Scripting VM Console (tty access to VM console)

    Hi everyone, Excuse me if this question has already been posted, but I could not find any solution. My question is about to script the console of a VM. I want to start a pre-configured VM with an automatic builded config, and launch some command inside the VM (when the prompt is ready), so it...
  8. J

    Creating a simple bash script menu on reboot

    Hey guys. Apologies in advance for a naive question amidst these deep technical discussions. I run a simple setup. Home lab, virtualised hackintosh, windows 10 PC, ubuntu, that I run generally one VM at a time with GPU PCI passthrough. I generally boot the machine and use my ipad to select the...
  9. J

    vzdump-hook-script not working as expected

    Hi there, We are trying to use a vzdump hook script to do some things. We have a Proxmox cluster setup with several hypervisors. We took a look at /usr/share/doc/pve-manager/examples/vzdump-hook-script.pl and made an adaptation: #!/bin/bash LIST_BORG_BACKUPS=${DUMPDIR}/list_borg_backups...
  10. 5

    Autostart Script

    Hello there, I have recently installed Proxmox on my homeserver and on it I installed nextcloud in a lxc. Due to electricity cost I want to shut my server down when the server is idling and when I want to start it I usually connect to a website hosted on my rpi zero where I click a button...
  11. W

    post backup script issues...

    I'm trying to send backup files to a remote Restic server but there seems to be an issue with the shell that proxmox runs backups in. I had to add a lot of things to try and get bash commands to work, bash -lic has helped in a few places but I'm sure there's something neater which could make...
  12. R

    Curl current proxmox release version from web

    Bit weird but I'm setting up various scripts that announce when software is due for an update - mainly so I can check release notes before applying. Is there somewhere I can reliably get (curl or similar) the latest release number from - so the script can use it to compare it to pveversion.
  13. S

    Simple reset script - ping

    I noticed that there does not seem to be a simple reset / reboot script for problematic clients so I made one. Copy / Paste this to autorestart-vm1100.sh using nano #! /bin/bash # Replace VM id number and IP address with your own "VM" id number and IP address ping -c 1 10.168.100.100 &>...
  14. D

    lxc-start fails! --> unsupported Ubuntu version '18.04'

    Hello, today I install an lxc Container with ubuntu 16.04 and do an dist-upgrade (after added the ubuntu 18.04 sources.list files), now I am not able to start the container anymore because I get the Error Message root@michael-server:~# lxc-start -F -n 100 --logfile=lxc100.log...
  15. T

    [SOLVED] Setting LXC user password with pct when calling from a script

    Hello everyone, I am looking for a non-interactive way to set the password for the root user (or any user really) when creating a LXC container from the official Proxmox Ubuntu 16.04 template using pct. For some background: I am currently trying to automate most of my homelab, including LXC...
  16. J

    Auto Provisioning and IP Assignment Provisioning script

    Hi All, I've been working hard to make the job of provisioning and assigning ips easier. So I'd like to share a little script I've made that I hope some of you will find it helpful in your mission to automate the world. I apologise to mods if this isn't the right section. The reason I...
  17. V

    Post-Installation script

    Is there any way to run a post-installation script (bash) when a new VM is created using a fresh linux image or a template ? I want to create and setup Nginx/FTP (well LEMP) automatically when a new VM is created. I thought about creating a template with both of them installed but that will...
  18. B

    Script when vm migrates

    Hi everybody, I need to execute a script when a vm has migrated, due to fail of a node. Any idea to catch the event ? Thanks
  19. W

    Firewall file manual edit

    Hello, I wanna update my firewall file for the cluster everyday with an updated list of blocked spam IPs. Therefore I created a bash script but unfortunately I can't execute it in /etc/pve/firewall/ and I can't copy files to this directory with the script. Any idea how to do it then? Thanks for...

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!