gnome-do and kupfer have plugins for searching files and probably for doing web searches. Maybe just bind a keyboard shortcut in dom0 to qvm-run <appvm> gnome-do?
Or just bind a browser to a keyboard shortcut, since the browser interface contains a search bar you’ll end up opening a browser to view search results anyway.
Here’s a dmenu script which requests user input and then searches that in Firefox in a specified AppVM. You first tell dmenu whether you want to give Firefox a URL or a web search using Firefox’s default search engine. Then you put in your query.
If you want to open https://eff.org, then you first select URL and then type eff.org. If you want to search on the web eff.org, you first select Web and then type eff.org.
#!/bin/bash
# This dmenu script asks for a web search,
# and runs that search in an AppVM.
APP_VM=productivity
# Choose URL or Web search, exit if empty (i.e. <Esc>)
QUERY_TYPE=$(echo -e "URL\nWeb" | dmenu -i)
[[ -z $QUERY_TYPE ]] && exit
# Input search query, exit if empty
QUERY=$(echo "" | dmenu)
[[ -z $QUERY ]] && exit
[[ $QUERY_TYPE = "URL" ]] &&
qvm-run $APP_VM firefox -- -new-window $QUERY ||
qvm-run $APP_VM firefox -- -new-window --search $QUERY || exit
Notes
Sometimes dmenu accepts the user’s input without having to pipe something to dmenu, but this hasn’t worked for me. So I just pipe in an empty list with echo "" | dmenu.
If you want to choose from a list of VMs instead of only defining one VM in the script, you can pipe a list of VMs into dmenu and make a VM variable which you use with qvm-run $VM.
If you want a list of currently running VMs to pipe into dmenu, you can use VM_LIST=$(qvm-ls | awk '{print $1}' | tail -n+2). Alternatively, you can use a cron job (I use */5 * * * *) to write $VM_LIST to a file, and then use echo "$VM_LIST" | dmenu to choose the VM (this shaves off the noticeable half second that it takes qvm-ls to run).
If you need to visit .com URL, you don’t need to type .com, as either qvm-run or Firefox seems to default to this top-level domain.
You could add a search engine selection to this script by getting the search engine’s search URL, and then piping a list of those into dmenu. See this (Invidious) video by Distrotube.