VM Management
- Reduce VM boot time - Debian 12 only - [TemplateVM] Enter sudo cp /lib/systemd/system/systemd-binfmt.service /etc/systemd/system
, then delete After=local-fs.target
from /etc/systemd/system/systemd-binfmt.service
@renehoj
Shut down selected window's VM - [dom0] Create /bin/halt-vm-by-window
containing the code below, run chmod +x /bin/halt-vm-by-window
, then map to shortcut @tasket
[details="halt-vm-by-window"]
#!/bin/bash
CUR_WIN_ID=`xdotool getwindowfocus`
CUR_VM=`xprop _QUBES_VMNAME -id $CUR_WIN_ID |cut -d \" -f2`
qvm-run $CUR_VM 'xdotool search --name "Mozilla Firefox" key ctrl+q'
qvm-run $CUR_VM 'xdotool search --name "Mozilla Thunderbird" key ctrl+q'
sleep 4
/usr/bin/qvm-shutdown $CUR_VM --wait --timeout=40
Memory warning notifications - [dom0] Create the files below as needed, then for each file: chmod +x [FILENAME]
, enter crontab -e
, then add */5 * * * * [FILENAME]
and save @ddevz
[details="/bin/dom0-Memory-Notification"]
#!/bin/bash
FREE_MEMORY=$((`free -m | grep '^Mem' | awk '{print $7}'`))
if (( $FREE_MEMORY < 500 )); then
notify-send --expire-time=360000 --urgency=critical 'dom0: Low memory' "Remaining: $FREE_MEMORY MBs"
fi
#!/bin/bash
FREE_MEMORY=$((`xl info | grep free_memory | sed 's/^.*:\([0-9]*\)/\1/'` / 1000))
if (( $FREE_MEMORY < 8 )); then
notify-send --expire-time=360000 --urgency=critical 'Xen: Low memory' "Remaining:
$FREE_MEMORY GBs"
fi
Input Devices
Prevent loss of control from sys-usb shutdown - [dom0] crontab -e
, then enter * * * * * qvm-start --skip-if-running sys-usb > /dev/null 2>&1
and save. Reverse the change by commenting out that line @SteveC
Create a toggle to hide the cursor - [dom0] Install unclutter
, run the code below (expandable), then map toggle-unclutter.sh
to a key @ludovic vecna13 from the 2676 issue
[details="Hide cursor (dom0)"]
mkdir $HOME/bin
cat << 'EOF' | tee $HOME/bin/toggle-unclutter.sh
#! /bin/sh
if pgrep unclutter &> /dev/null 2>&1
then
killall unclutter
else
unclutter -idle 1 &
fi
EOF
chmod +x $HOME/bin/toggle-unclutter.sh
Storage - Send files directly to external storage mounted in other qube - [AppVM] Run the code below (expandable), then copy/move your file(s) @SteveC
[details="In destination qube:"]
In the following instructions [ORIGIN QUBE]
is the qube name without brackets or slashes!
mkdir ~/QubesIncoming
mv ~/QubesIncoming/[ORIGIN QUBE] ~/QubesIncoming/[ORIGIN QUBE]_backup
ln -s [MOUNT POINT] ~/QubesIncoming/[ORIGIN QUBE]
WiFi
Keep WiFi off by default on boot - [TemplateVM] In sys-net's template, create /var/lib/NetworkManager/NetworkManager.state
containing the code below (expandable) @Bearillo
[details="NetworkManager.state"]
[main]
WirelessEnabled=false
Soft toggle WiFi - [dom0] qvm-run sys-net -- "if nmcli radio wifi | head -c1 | egrep 'e'; then nmcli radio wifi off; else nmcli radio wifi on; fi"
(can be mapped to shortcut) @Bearillo
Video playback
Reduce VLC's CPU usage - [AppVM] In VLC's preferences, open 'Video' and change 'Output' to 'X11 video output (XCB)' @solene
Reduce mpv's CPU usage (link includes guide for YouTube too) - [TemplateVM] In /etc/mpv/mpv.conf
, insert vo=x11
and profile=sw-fast
as separate lines @Bearillo
Etc.
xfce4-notifyd-config
, then xfconf-query -c xfce4-notifyd -p /do-not-disturb --set true
@solene
This is a thread where we collect quick tips and tricks that can improve the Qubes experience.
Feel free to add your tip to this wiki post (anyone can edit this)
Guidelines 1. Your tip should contain as few words as possible 2. If your tip can't be condensed into a few lines, it doesn't belong here 3. If your tip is niche with regard to Qubes users, it doesn't belong here* 4. Follow the established style convention 5. Give credit, even to yourself, and link to the original (if needed, also post your tip as reply so you have a link)
* "What's niche?" is going to spawn a lot of debate and angst, but this constraint is necessary to prevent the post from getting bloated and mostly irrelevant