Reverse Tethering & Screen Mirroring Qube for Android Device
Control your Android Device from Qubes OS while providing Network to the Android Device
Guide utilizes USB Debugging which can add significant Attack Surface to your Android Device, use at your own risk!
- Create Template Qube from fedora-40-xfce Template
- Install scrcpy with
sudo dnf copr enable zeno/scrcpy && sudo dnf install scrcpy
- Create App Qube from the Template we just created
- Passthrough USB Controller to App Qube, switch Virt Mode to hvm
- Run Terminal on App Qube
- Install homebrew with
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
- Install gnirehtet with
brew install gnirehtet
- Create connect_android.sh
nano ~/.local/connect_android.sh
With the following Content:
sudo adb devices
/home/user/start_scrcpy.sh &
/home/user/start_gnirehtet.sh
Make it executable:
chmod u+x ~/.local/connect_android.sh
- Create start_scrcpy.sh
nano ~/.local/start_scrcpy.sh
With the following Content:
scrcpy
Make it executable:
chmod u+x ~/.local/start_scrcpy.sh
- Create start_gnirehtet.sh
nano ~/.local/start_gnirehtet.sh
With the following Content:
/home/linuxbrew/.linuxbrew/Cellar/gnirehtet/2.5.1/bin/gnirehtet run
Make it executable:
chmod u+x ~/.local/start_gnirehtet.sh
- Create connect_android.desktop
nano ~/.local/share/applications/connect_android.desktop
With the following Content:
[Desktop Entry]
Name=Connect Android
GenericName=Connect Android Hardware Device
Comment=Authorize ADB, Control & Reverse Tether
Exec=/home/user/connect_android.sh
Icon=terminal
Terminal=true
Type=Application
Categories=Utility;Network;
StartupNofity=true
Make it executable:
chmod u+x ~/.local/share/applications/connect_android.desktop
- Refresh App List in Qubes Settings
- Enable Developer Settings & USB Debugging on Android Device
- Connect Android Device via USB
- Make sure other Qubes which passthrough the same USB Controller (e.g. sys-usb) are shutted down
- Launch “Connect Android” Shortcut
- Authorize ADB when prompt is shown on Android Device