Hello! Has anyone used LocalSend with Qubes? I installed it via Flatpak but it doesnt see, and cant be seen, by any other devices. It’s on the same local network. There is probably something I missed, does anyone have any pointers please? Ques 4.2, Fedora 38 xfce.
It’s only in the same network if you’re running it directly in sys-net.
Otherwise it’ll be behind multiple routers e.g. sys-net, sys-firewall, etc.
So you need to forward the ports needed by LocalSend from sys-net to the qube where you run LocalSend:
Btw: Has anyone figured out, how performance of LocalSend can be optimized when running in Qubes? It goes heavy on CPU for a minute or so after startup in the “Receive” tab. My guess would be unneeded networking polling requests due to special Qubes environment. Or is it similar in non-Qubes systems?
Configure qubes policy to allow LocalSend port forwarding.
Execute script either manually or automatically at startup .
Just put this script somewhere in the qube where your LAN controller is in - most probably sys-net, if using default names. Preferred location is /usr/local/bin/localsend_forward.sh, as the script needs root permission and needs to have a persistent location in the AppVM. Adjust the LAN interface name by looking up via ip a in sys-net. If you don’t know what an interface is, just put your device IP after ip=...:
# leave this alone
#if_lan=<your LAN network interface> # see ip -a
Add above policy line in /etc/qubes/policy.d/30-user.policy and pay attention to replace <your-localsend-qube> by the qube name, where you have installed LocalSend app. Same as above, sys-net needs to be the name of your NetVM with LAN controller (sys-net in example). You can use the policy editor with Qubes 4.2.
Having met point 1,2 you can either start script manually to get LocalSend going temporarily (you need root, as iptables requires superuser permission):
# ... when done with LocalSend, stop forwarding
Or enable port forwarding permanently for LocalSend, by adding first line in /rw/config/rc.local of your sys-net (again, adjust name) qube.
Are you using VPN on other devices?
Concept of Localsend is files sharing on same local network devices.
Probably your Qubes os PC is connecting to router through wired, so Qubes os can self detect other devices.
But your other devices are using VPN, and they connect to router through wi-fi, Localsend on them can not recognize on same local network devices.
If they are on same local network, Localsend on wired connecting device is recognize other devices, but if they use VPN, Localsend on wi-fi connecting devices can not recognize other devices.
Because router can know wired network (If it use VPN), but router can not know VPN over wi-fi network as same local network.
Problem of your issues is most likely it.
If you stop to VPN on other devices, Localsend on them are able to self detect your Qubes os PC, but using you Localsend is known from ISP in this way (ISP can know using you Localsend, but ISP don’t know your sent files).
Concept of Localsend is guarding privacy, you hope to continue to guard your privacy, you should be manually add IP of other devices.
This is not only Qubes os issues, Localsend is working as designed.
Even without a vpn on the other devices, I cannot see the qubes instance.
I’m testing on an iPhone, an iPad, and a Qube. The iDevices see each other fine but cannot see the qubes device. If I type in the IP displayed on the qube into either iDevice, I get an error. Same with the hashtag. If I use the qubes device, I cannot see any other device, but I can type in the IP address and it works for sending.
The received hashtag is different than the actual hashtag, but that’s not recognised either.
Most simple probably is to right click on NetworkManager applet in status bar (icon with two computers) → Connection information. Or look up device in your router. Or more technical, ip a in sys-net and search for the entry not being lo / vif (likely ethx / ensx).
@mmmm Two last tipps I can think of given your provided information:
1.) Above script was written for Qubes OS 4.1. With installation of v4.2 I just noticed, that iptables has been dropped in favor of nftables (sorry). iptables apparently stills exists in the Fedora 38 Xfce template, but not in Debian 12 Xfce template. So I guess, it depends on what template sys-net has on your system.
Below script works for me in 4.2 using nft:
if_lan=<your LAN network interface> # see ip -a
ip=$(ip -f inet addr show $if_lan | sed -En -e 's/.*inet ([0-9.]+).*/\1/p')
case $1 in
nft add rule ip qubes custom-input ip daddr $ip tcp dport $port ct state new accept
pkill -f "socat TCP-LISTEN:$port"
nft flush chain ip qubes custom-input
>&2 echo "usage: $0 start|stop"
Note: You should adjust the line nft flush chain ip qubes custom-input if you have other port forwarding rules you want to keep, when stopping this script.
2.) As you mentioned VPN usage: pay attention to not use localsend with VPN. This should look similar to:
localsend --netvm--> sys-firewall --netvm--> sys-net --> LAN
Well thank you so so much for the help. I still can’t get it working unfortunately - sorry to waste your time like this!
I don’t think I am putting the correct ip address in, but I can’t seem to find it. Plus, every time I restart sys-net, the ip changes anyway. I have found this ip by right clicking on the wifi icon.
I have clearly got something wrong or misunderstood something. The qube containing Localsend is attached to sys-firewall for its net qube, perhaps that’s incorrect?
I have checked with ipleak and the localsend qube definitely isnt going through my vpn. I set that up in a standalone qube for the protonvpn app, and every qube want going through that I attach to that ‘sys-vpn’. That seems to all be fine.
I just dont fully understand, and especially as I can send my devices things from qubes, just not the other way round…
Anyway, thank you again. Don’t worry anymore, I’m think I’m going to give up because its really annoying and clearly above my head!
You may use VPN on Qubes os, LocalSend can self detect your other devices. But if you use VPN on mobile device, LocalSend on it is can not self detect your Qubes os.
If it is not danger for you, you stop VPN on mobile device, so LocalSend on them is self detect IP of your Qubes os.
And you check IP of Qubes os displaying on LocalSend of your mobile device, after restart VPN on mobile device, you add IP yourself of your checked Qubes os, you can use LocalSend.
LocalSend works following as designed.
But this is if you use LocalSend on AppVM, if you hope to use on disp-VM, you must check and add IP of Qubes os every time you use LocalSend.
Because IP of disp-VM is change every time it runs.
@scales thanks for the advice, as I wrote below, Vpn on or off makes no difference to my issue.
And in fact it’s just my devices that cannot see qubes. The qubes instance can see my devices. I think it’s a simple matter of my not being able to identify the correct IP for qubes, as ridiculous as that sounds.
One: LocalSend on Qubes os can see iPhone and iPad, but LocalSend on iPhone and iPad can not see Qubes os.
Two: LocalSend on Qubes os can not see iPhone and iPad, but Localsend on iPhone and iPad can see Qubes os.
Is your issue one or two?
Case of one, LocalSend works same to on Windows and Android, this is not issue.
If case of two, this is possible issue of on only Qubes os.