@unman: I agree that this approach is not the best, while also having stated that neglecting whonix is also not the way to go unless Qubes OS offers an alternative to sys-whonix on their next install media (or your tor recipe being a dependency of cacher and also deployed by default). The real solution (implementation detail) is outlined under
Which would require @adrelanos to implement his template proxy check against a real tor url instead of depending on a fixed proxy advertising tor support. Nothing more I can do here but have at least agreement of reality where Whonix is deployed in most deployments (default) today and where sys-whonix is ticked to be the update proxy used by most, and where cacher is expected to be really used as a drop-in replacement without it partly caching things.
On app-qube temporary installation:
I have problems with that, which is why Iām writing about it here. It works flawlessly with app-qubes where update-proxy-setup
is activated, permitting network traffic to go through whatever userās netvm preference but using cacher to download packages the same way that app-qubeās template is configured to use cacher.
On the a running app-qube, configured to use cacher as netvm without further modification (and simulating that cacher rpc is not available)
1-
user@heads-tests:~/heads$ sudo systemctl stop qubes-updates-proxy-forwarder.socket
user@heads-tests:~/heads$ sudo apt update
Ign:1 http://HTTPS///deb.debian.org/debian bookworm InRelease
Ign:2 http://HTTPS///deb.debian.org/debian-security bookworm-security InRelease
Ign:3 http://HTTPS///deb.qubes-os.org/r4.1/vm bookworm InRelease
Ign:4 http://HTTPS///updates.signal.org/desktop/apt xenial InRelease
Ign:1 http://HTTPS///deb.debian.org/debian bookworm InRelease
Ign:2 http://HTTPS///deb.debian.org/debian-security bookworm-security InRelease
Ign:3 http://HTTPS///deb.qubes-os.org/r4.1/vm bookworm InRelease
Ign:4 http://HTTPS///updates.signal.org/desktop/apt xenial InRelease
Ign:1 http://HTTPS///deb.debian.org/debian bookworm InRelease
Ign:2 http://HTTPS///deb.debian.org/debian-security bookworm-security InRelease
Ign:3 http://HTTPS///deb.qubes-os.org/r4.1/vm bookworm InRelease
Ign:4 http://HTTPS///updates.signal.org/desktop/apt xenial InRelease
Err:1 http://HTTPS///deb.debian.org/debian bookworm InRelease
Could not connect to 127.0.0.1:8082 (127.0.0.1). - connect (111: Connection refused)
Err:2 http://HTTPS///deb.debian.org/debian-security bookworm-security InRelease
Unable to connect to 127.0.0.1:8082:
Err:3 http://HTTPS///deb.qubes-os.org/r4.1/vm bookworm InRelease
Unable to connect to 127.0.0.1:8082:
Err:4 http://HTTPS///updates.signal.org/desktop/apt xenial InRelease
Unable to connect to 127.0.0.1:8082:
Reading package lists... Done
E: Failed to fetch http://HTTPS///deb.debian.org/debian/dists/bookworm/InRelease Could not connect to 127.0.0.1:8082 (127.0.0.1). - connect (111: Connection refused)
E: Failed to fetch http://HTTPS///deb.debian.org/debian-security/dists/bookworm-security/InRelease Unable to connect to 127.0.0.1:8082:
E: Failed to fetch http://HTTPS///deb.qubes-os.org/r4.1/vm/dists/bookworm/InRelease Unable to connect to 127.0.0.1:8082:
E: Failed to fetch http://HTTPS///updates.signal.org/desktop/apt/dists/xenial/InRelease Unable to connect to 127.0.0.1:8082:
E: Some index files failed to download. They have been ignored, or old ones used instead.
user@heads-tests:~/heads$ wget perdue.org
--2022-08-29 14:47:31-- http://perdue.org/
Resolving perdue.org (perdue.org)... 216.40.34.37
Connecting to perdue.org (perdue.org)|216.40.34.37|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: unspecified [text/html]
Saving to: āindex.htmlā
index.html [ <=> ] 6.00K --.-KB/s in 0.04s
2022-08-29 14:47:32 (143 KB/s) - āindex.htmlā saved [6141]
Or
2- Deactivating proxy for AppVMs and restarting app-qube:
[user@dom0 ~]$ sudo vim /etc/qubes/policy.d/30-user.policy
#qubes.UpdatesProxy * @tag:whonix-updatevm @default allow target=sys-whonix
#qubes.UpdatesProxy * @type:AppVM @default allow target=cacher
qubes.UpdatesProxy * @type:TemplateVM @default allow target=cacher
[user@dom0 ~]$ sudo systemctl restart qubesd
[user@dom0 ~]$ qvm-features heads-tests | grep proxy
service.updates-proxy-setup
[user@dom0 ~]$ qvm-prefs heads-tests | grep netvm
netvm - cacher
And starting heads-tests to check apt downloads capabilities:
user@heads-tests:~$ sudo apt update
Ign:1 http://HTTPS///deb.debian.org/debian bookworm InRelease
Ign:2 http://HTTPS///deb.debian.org/debian-security bookworm-security InRelease
Ign:3 http://HTTPS///deb.qubes-os.org/r4.1/vm bookworm InRelease
Ign:4 http://HTTPS///updates.signal.org/desktop/apt xenial InRelease
Ign:1 http://HTTPS///deb.debian.org/debian bookworm InRelease
Ign:2 http://HTTPS///deb.debian.org/debian-security bookworm-security InRelease
Ign:3 http://HTTPS///deb.qubes-os.org/r4.1/vm bookworm InRelease
Ign:4 http://HTTPS///updates.signal.org/desktop/apt xenial InRelease
Ign:1 http://HTTPS///deb.debian.org/debian bookworm InRelease
Ign:2 http://HTTPS///deb.debian.org/debian-security bookworm-security InRelease
Ign:3 http://HTTPS///deb.qubes-os.org/r4.1/vm bookworm InRelease
Ign:4 http://HTTPS///updates.signal.org/desktop/apt xenial InRelease
Err:1 http://HTTPS///deb.debian.org/debian bookworm InRelease
Could not resolve 'HTTPS'
Err:2 http://HTTPS///deb.debian.org/debian-security bookworm-security InRelease
Could not resolve 'HTTPS'
Err:3 http://HTTPS///deb.qubes-os.org/r4.1/vm bookworm InRelease
Could not resolve 'HTTPS'
Err:4 http://HTTPS///updates.signal.org/desktop/apt xenial InRelease
Could not resolve 'HTTPS'
Reading package lists... Done
E: Failed to fetch http://HTTPS///deb.debian.org/debian/dists/bookworm/InRelease Could not resolve 'HTTPS'
E: Failed to fetch http://HTTPS///deb.debian.org/debian-security/dists/bookworm-security/InRelease Could not resolve 'HTTPS'
E: Failed to fetch http://HTTPS///deb.qubes-os.org/r4.1/vm/dists/bookworm/InRelease Could not resolve 'HTTPS'
E: Failed to fetch http://HTTPS///updates.signal.org/desktop/apt/dists/xenial/InRelease Could not resolve 'HTTPS'
E: Some index files failed to download. They have been ignored, or old ones used instead.
And where setting proxy to local doesnāt work as expected:
user@heads-tests:~$ export https_proxy=http://127.0.0.1:8082
user@heads-tests:~$ sudo apt update
Ign:1 http://HTTPS///deb.debian.org/debian bookworm InRelease
Ign:2 http://HTTPS///deb.debian.org/debian-security bookworm-security InRelease
Ign:3 http://HTTPS///deb.qubes-os.org/r4.1/vm bookworm InRelease
Ign:4 http://HTTPS///updates.signal.org/desktop/apt xenial InRelease
Ign:1 http://HTTPS///deb.debian.org/debian bookworm InRelease
Ign:2 http://HTTPS///deb.debian.org/debian-security bookworm-security InRelease
Ign:3 http://HTTPS///deb.qubes-os.org/r4.1/vm bookworm InRelease
Ign:4 http://HTTPS///updates.signal.org/desktop/apt xenial InRelease
Ign:1 http://HTTPS///deb.debian.org/debian bookworm InRelease
Ign:2 http://HTTPS///deb.debian.org/debian-security bookworm-security InRelease
Ign:3 http://HTTPS///deb.qubes-os.org/r4.1/vm bookworm InRelease
Ign:4 http://HTTPS///updates.signal.org/desktop/apt xenial InRelease
Err:1 http://HTTPS///deb.debian.org/debian bookworm InRelease
Could not resolve 'HTTPS'
Err:2 http://HTTPS///deb.debian.org/debian-security bookworm-security InRelease
Could not resolve 'HTTPS'
Err:3 http://HTTPS///deb.qubes-os.org/r4.1/vm bookworm InRelease
Could not resolve 'HTTPS'
Err:4 http://HTTPS///updates.signal.org/desktop/apt xenial InRelease
Could not resolve 'HTTPS'
Reading package lists... Done
E: Failed to fetch http://HTTPS///deb.debian.org/debian/dists/bookworm/InRelease Could not resolve 'HTTPS'
E: Failed to fetch http://HTTPS///deb.debian.org/debian-security/dists/bookworm-security/InRelease Could not resolve 'HTTPS'
E: Failed to fetch http://HTTPS///deb.qubes-os.org/r4.1/vm/dists/bookworm/InRelease Could not resolve 'HTTPS'
E: Failed to fetch http://HTTPS///updates.signal.org/desktop/apt/dists/xenial/InRelease Could not resolve 'HTTPS'
E: Some index files failed to download. They have been ignored, or old ones used instead.
user@heads-tests:~$
And where setting the proxy address to cacher IP provides the same results, since the cacher is not used as proxy, but used as netvm:
Could not resolve 'HTTPS'
Err:2 http://HTTPS///deb.debian.org/debian-security bookworm-security InRelease
Could not resolve 'HTTPS'
Err:3 http://HTTPS///deb.qubes-os.org/r4.1/vm bookworm InRelease
Could not resolve 'HTTPS'
Err:4 http://HTTPS///updates.signal.org/desktop/apt xenial InRelease
Could not resolve 'HTTPS'
Reading package lists... Done
E: Failed to fetch http://HTTPS///deb.debian.org/debian/dists/bookworm/InRelease Could not resolve 'HTTPS'
E: Failed to fetch http://HTTPS///deb.debian.org/debian-security/dists/bookworm-security/InRelease Could not resolve 'HTTPS'
E: Failed to fetch http://HTTPS///deb.qubes-os.org/r4.1/vm/dists/bookworm/InRelease Could not resolve 'HTTPS'
E: Failed to fetch http://HTTPS///updates.signal.org/desktop/apt/dists/xenial/InRelease Could not resolve 'HTTPS'
E: Some index files failed to download. They have been ignored, or old ones used instead.
@unman: unless I skipped and misunderstood something, I do not understand how this is supposed to work. Of course cacher has its firewall open (accept) for port 8082 as per normal deployment.
Also reread your notes under notes/apt-cacher-ng.md at 6e752c5b80b4d581266b452720a4e87505437c16 Ā· unman/notes Ā· GitHub which didnāt help me resolve the current issue being app qubes via apt-cacher-ng (so app qubes)