[virt-tools-list] virt-manager shortcut to boot guest os

Justin Clift jclift at redhat.com
Fri Sep 17 13:16:49 UTC 2010


On 09/17/2010 05:28 PM, Grant Williamson wrote:
> Hi,
> is there way to use virt-manager to open & power on a guest OS from say
> a desktop link.
>
> i.e.
> virt-manager boot "name"

Hi Grant,

"Kind of". :)

It depends upon what you want to do.  "virt-manager" doesn't seem to 
have all of the right command line options itself, but you can probably 
get what you want through simple shell scripting.

For example, lets say I have a guest called "myGuest", on a remote host 
called "myHost".

With a simple script, you can use "virsh" to start the guest, then 
launch your desired viewing program to connect to it.

   Example: launch_myGuest.sh
   (NOTE: Complete lack of error checking for simplicity. :>)

   #!/bin/bash

   # Connect to the remote host using SSH, then launch the guest
   virsh -c qemu+ssh://myuser@myHost/system start myGuest

   # virt-manager needs to be given a domain's unique ID number
   # (UUID), so we retrieve that info first
   UUID=`virsh -c qemu+ssh://myuser@myHost/system domuuid myGuest`

   # Now we launch virt-manager, automatically connecting to the guest's
   # display
   virt-manager -c qemu+ssh://myuser@myHost/system \
                --show-domain-console=${UUID}

Does that help?

(btw, that would ask for the SSH password for each command being run 
above, so setting up ssh keys would be useful... no password promping!)

:)

Regards and best wishes,

Justin Clift

> thanks.




More information about the virt-tools-list mailing list