Run custom command after VM start?

SirMaster

Renowned Member
May 20, 2015
23
2
68
I am looking for a way to run a custom shell command as root automatically sometime after a VM is started.

I need the command to be run at least after the main KVM process and all it's threads have been created.

The command I want to run is this:

Code:
ls /proc/$(pgrep -f nick-htpc)/task | xargs -n 1 chrt -f -p 1

Anyone have any suggestions for how I can trigger this command to run after a VM has been started?

It doesn't even have to be only after a specific VM is started since the command will only affect a specific VM's PIDs. However that would be a bonus if the way can be set to only run for a specific VM as that might come in handy in the future.

Thanks
 
Not really.

What I did for now was to create a script inside the VM that runs when the VM starts up and that connects to Proxmox via SSH and runs my command.
 

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!