• Welcome to LiuJason's Blog!

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

Linux笔记 Jason 12 months ago (05-15) 220 Views 0 Comments QR code of this page

[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:

Description=Start VM on SD card removal

ExecStart=/usr/bin/bash -c "journalctl -fn0 | grep --line-buffered 'mmc0: card 0007 removed' | while read -r line; do qm start 106; done"


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
Like (0)

表情 贴图 加粗 删除线 居中 斜体 签到


  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址