Laptop as Proxmox VE host passthrough GPU to Windows VM and start the VM on hardware event

文章目录[隐藏]

[This tutorial is still working in progress]

Start the VM on hardware event

In my case, I don't use the SD card in daily workflow and it's nice to be used as a "switch". You can always use a handy USB device as an event trigger.
Create a service called `start-on-remove-sd`:



sudo nano /etc/systemd/system/start-on-remove-sd.service

Replace the contents of the file with the following:



[Unit]

Description=Start VM on SD card removal

After=network.target

[Service] ExecStart=/usr/bin/bash -c “journalctl -fn0 | grep –line-buffered ‘mmc0: card 0007 removed’ | while read -r line; do qm start 106; done”

[Install] WantedBy=default.target

Save the file and exit the text editor. Reload the systemd daemon to apply the changes:



sudo systemctl daemon-reload

Enable and start the service using the following commands:



sudo systemctl enable start-on-remove-sd.service

sudo systemctl start start-on-remove-sd.service


This article is under CC BY-NC-SA 4.0 license.
Please quote the original link:https://www.liujason.com/article/1240.html
Licensed under CC BY-NC-SA 4.0
comments powered by Disqus
Built with Hugo
Theme Stack designed by Jimmy