How to have VM start on boot in the background?

Thanks for the feedback. The question was when several qubes are set to auto boot, are they’re waited to be booted first and then the login screen would be shown. For me it’s not happening anymore it looks.

Yeah, I had no idea (before I saw this topic) that that was why it took so infernally long to boot (once, of course, I had unlocked the encrypted partition)!

So that’s a big relief. I’ll probably be a lot more willing to reboot my system now.

hi @Sven ,

forgive me if this answer is already documented somewhere, but what method do you recommend to start applications via a script on a hotkey shortcut? i don’t want the script to remain open in the background until i close all the applications, as it does when sending qvm-run from a terminal. and i’m not sure exactly how this works, if different, when you execute qvm-run via a hotkey

1 Like

So does this mean your comp is fast, or you’re slow… making a tea :slight_smile: :rofl:

@weyoun.six that’s basic Unix command line usage: adding an ampersand at the end of your command will launch it and immediately return to the bash.

e.g. qvm-run work thunderbird &

1 Like

thanks for clearing that up! i’ve been using the & in my update script to start vm’s at the same time as i initiate updates, to speed up the process. should have occurred to me that this was the case…

This would help my workflow immensely. I’ve drafted the below code for a single autostart script to allow a user to choose (work profile would also load requisite sys- qubes). This script requires Zenity in Dom0, which isn’t ideal, but I couldn’t quite figure out how to manage a hotkey setup, xmessage wasn’t available and less visually-appealing – thoughts and feedback always appreciated.

#!/bin/bash

declare -a work_qubes=("work-qube1" "work-qube2" "work-qube3")
declare -a system_qubes=("sys-net" "sys-firewall" "sys-usb")
declare -a admin_qubes=("" "" "")

start_qubes() {
  qubes_to_start=("${!1}")

  for qube in "${qubes_to_start[@]}"; do
    echo "Starting $qube..."
    qvm-start "$qube" || echo "Failed to start $qube"
  done
}

prompt_user() {
  startup_choice=$(zenity --list --radiolist --height 250 --width 350 --title="Select Start>

  case "$startup_choice" in
    "Work Qubes")
      echo "Starting work qubes..."
      start_qubes work_qubes[@]
      ;;
    "System Qubes")
      echo "Starting system qubes..."
      start_qubes system_qubes[@]
      ;;
    "Admin Qubes")
      echo "Starting admin qubes..."
      start_qubes admin_qubes[@]
      ;;
    *)
      echo "No option selected. Exiting."
      ;;
  esac
}

echo "QubesOS autostart script initialized"
prompt_user