Skip to content

Instantly share code, notes, and snippets.

View marmarek's full-sized avatar

Marek Marczykowski-Górecki marmarek

View GitHub Profile
@Joeviocoe
Joeviocoe / qvm-portfwd-socat
Last active January 3, 2024 22:44
Qubes-OS socket connection to allow external connections
NetVM=$1
TargetVM=$2
Service=$3
TCP_Port=$4
wasrunning=$(qvm-ls | grep $TargetVM | grep -i RUNNING)
echo -ne "TCP socket connection for $Service from $NetVM to $TargetVM on port $TCP_Port...\nPress Any Key to End\n\n"
trap cleanup 1 2 3 6 15
cleanup() {
# qvm-run -p -u root $NetVM "iptables-save | grep -v 'SOCAT_PortFwd-$Service' | iptables-restore"