Script to quick start your virtual machines (libvirtd/qemu) and connect to them using virt-viewer
Find a file
2026-02-17 15:47:24 +01:00
archlinux push version to 20260217.2 2026-02-17 15:47:24 +01:00
Documentation/Images update README.md 2019-11-05 20:49:06 +01:00
.gitignore 20180610.1 2018-06-10 11:42:32 +02:00
README.md use yad instead of zenity 2023-07-10 21:34:31 +02:00
sv push version to 20260217.2 2026-02-17 15:47:24 +01:00
sv-completion enhance bash completion 2026-02-17 15:43:33 +01:00

sv

Bashscript-based starter for virtual machines (libvirt)

overview

sv will ask your running libvirtd for your available virtual machines and present them in a list to choose from. The selected domain will be started, and virt-viewer will connect to it.

screenshots

graphical interface

sv graphical mode

text mode interface

sv text mode

why?

I prefer using virt-viewer over the embedded viewer in virt-manager. Using sv you have the opportunity to start and use any of your virtual machines with just 1 or 2 clicks.

It is also possible using libvirt running on a remote machine. This is as easy as running sv -c user@host or by setting the environment variable SV_CONNECTION to user@host. Forget about connection strings like qemu+ssh://user@host/system. sv is managing this for you.

key features

  • choose domain by number (text mode), mouse click (graphical mode) or parameter (cli, -d)
  • start virtual domain and connect to it (default, -d), only start domain (-n), or shutdown domain (-s)
  • connect to local running libvirt (default) or to libvirt running on a remote machine (for this using public key authentication is strongly recommended).
  • If a domain is given on the command line, this domain is started/attached to/shutdown directly. No menu for selection is shown in this case.
  • bash completion is included

usage

Just start sv for text mode or sv -g for graphical mode.

Here are all available options:

   -a:   select/attach to a already running domain
   -c c: c is connection for ssh-access like user@host
   -C:   check for running libvirtd before using it
   -d D: start domain named D
   -f:   start virt-viewer fullscreen (needs wmctrl)
   -g:   use graphical layout
   -h:   show this help
   -H:   height of graphical window (default 380)
   -l:   list all known domains
   -n:   only start domain, don't start virt-viewer
   -o:   once: exit sv after first selection (default)
   -O:   not once: loop until quit is selected
   -s:   shutdown a running domain
   -t:   time to wait in s before refreshing the domain list (2.5 s)
   -v:   show versions and exit

installation

archlinux user

Download the zipped repo from this site, unzip it. Change to the directory sv and execute

makepkg -sic

The installation will take care for fulfilling the requirements (see below).

other distros

Download the zipped repo from this site, unzip it. Change to the directory sv and execute

sudo install sv /usr/local/bin
sudo install -m644 sv-completion /usr/share/bash-completion/completions/sv

Make sure the requirements (see below) are met.

hints

  • sv will run in a loop until quit is selected if -O/--notonce is given.
  • normally only inactive domains are listed. Giving -a or -s inverts this and only active domains are listed.

requirements

  • bash
  • libvirt
  • virt-viewer
  • yad
  • wmctrl (optional, needed for -f/--fullscreen)