Script to launch Looking Glass for Convenience and to work around AMD GPUs

I am currently passing an AMD RX 6700XT through to a virtual machine. The GPU refuses to reset after the VM is shutdown. This is not a thread to troubleshoot that issue, I have already done extensive research and attempts at various solutions. The 6700XT is also not supported by the vendor-reset fix that resolves the issue with other, older AMD GPUs.

What this is about is just sharing my workaround and how I made it so I don’t have to restart my computer every time I exit Looking Glass and want to close the VM.

I wrote a script and created a Desktop Entry file to be able to treat launching the VM and Looking Glass Client like any other application. If anyone is interested, you can find it here:

Here is what the script does.

  1. Checks if a given VM is running.
  2. If the VM is not running, start it and open Looking Glass Client
  3. If the VM is running, but suspended/pause, resume the VM and open Looking Glass Client
  4. If the VM is running normally, open Looking Glass Client
  5. Monitor Looking Glass Client and when it is exited, suspend the given VM.

The script allows me to quickly open Looking Glass Client and the VM like a normal application. When I close the Looking Glass Client, it automatically suspends the VM for me.

This can of course be used by anyone if they like the simplicity it provides, but it is a decent workaround for not being able to startup and shutdown a VM fully without the need to restart the entire computer the next time I want to use the VM.

2 Likes