Jump to content

Switch VM from within an VM


Recommended Posts

Hi, 

I use three "desktop" VMs (Win,Mac,Linux) with unRAID and each of them has the same GPU passed through, so I can't use them at the same time. 

 

Is there a way to "queue" VM actions so I can for example stop Linux and immediately start Windows from within Linux using the webgui?

Right now I have to use a second device to shut down one VM and then start the other, because once the first shut down is done I cannot interact with UnRAID to start the next VM.

Link to comment

maybe from terminal, something like this:

#!/bin/bash

virsh shutdown $1 && sleep 1 && virsh start $2

(this is only an extremely simple example script - pls dont use it in production)


save as /boot/extra/switch.sh and then, from terminal:
nohup /boot/extra/switch.sh WindowsVMName LinuxVMName &

Edited by me.so.bad
updated bash - still very hacky ;))
Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...